proxmox

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
proxmox [18/12/2023 - 15:30] – [LXC: Loop Device mounten] adminproxmox [20/03/2024 - 07:39] (aktuell) admin
Zeile 10: Zeile 10:
 ===== Verzeichnisstruktur ===== ===== Verzeichnisstruktur =====
  
-^Was ^Wo ^Anmerkung | +^Was^Wo^Anmerkung| 
-|kvm VM images |/mnt/data/images, /var/lib/vz/images |  +|kvm VM images|/mnt/data/images, /var/lib/vz/images|   
-|kvm VM configs |/etc/pve/nodes/tokoeka/qemu-server |  +|kvm VM configs|/etc/pve/nodes/tokoeka/qemu-server|   
-|LXC images |/var/lib/vz/images |  +|LXC images|/var/lib/vz/images|   
-|LXC configs |/etc/pve/nodes/tokoeka/lxc |  |+|LXC configs|/etc/pve/nodes/tokoeka/lxc|   |
  
 ===== PVE Server Backup ===== ===== PVE Server Backup =====
  
-https://xcruft.com/content/proxmox-config-backups+[[https://xcruft.com/content/proxmox-config-backups|https://xcruft.com/content/proxmox-config-backups]]
  
 ===== User Management ===== ===== User Management =====
  
 User in PVE erstellen (entspricht dem shell User). Erst dann ist die Administration per Web GUI möglich. User in PVE erstellen (entspricht dem shell User). Erst dann ist die Administration per Web GUI möglich.
 +<code>
 +
 +pveum user add [user@pam]
  
-<code>pveum user add [user@pam] 
 </code> </code>
  
 Gruppe erstellen: Gruppe erstellen:
  
-<code> pveum groupadd admin -comment "System Administrators" +<code> 
-</code> + pveum groupadd admin -comment "System Administrators" 
 + 
 +</code>
  
 Rechte zuweisen: Rechte zuweisen:
  
-<code> pveum aclmod / -group admin -role Administrator +<code> 
-</code> + pveum aclmod / -group admin -role Administrator 
 + 
 +</code>
  
 Benutzer der Gruppe zuweisen: Benutzer der Gruppe zuweisen:
  
-<code> pveum user modify testuser@pam -group admin +<code> 
-</code> + pveum user modify testuser@pam -group admin 
 + 
 +</code>
  
 User auflisten User auflisten
Zeile 55: Zeile 63:
 │ thommie@pam │         │                     │ 1      │      0 │           │        │      │          │ pam        │        │ │ thommie@pam │         │                     │ 1      │      0 │           │        │      │          │ pam        │        │
 └─────────────┴─────────┴─────────────────────┴────────┴────────┴───────────┴────────┴──────┴──────────┴────────────┴────────┘ └─────────────┴─────────┴─────────────────────┴────────┴────────┴───────────┴────────┴──────┴──────────┴────────────┴────────┘
 +
 </code> </code>
  
Zeile 61: Zeile 70:
 <code> <code>
 pveum user modify root@pam -enable 0 pveum user modify root@pam -enable 0
 +
 </code> </code>
  
Zeile 67: Zeile 77:
 <code> <code>
 pveum user modify admin@pam -email admin@netzwissen.de pveum user modify admin@pam -email admin@netzwissen.de
 +
 </code> </code>
  
Zeile 78: Zeile 89:
 │ admin   │ System Administrators │ alex@pam,thommie@pam │ │ admin   │ System Administrators │ alex@pam,thommie@pam │
 └─────────┴───────────────────────┴──────────────────────┘ └─────────┴───────────────────────┴──────────────────────┘
 +
 </code> </code>
  
 2FA löschen: über gleichberechtigten User, dann Löschen von "x" im Feld "Key ID" 2FA löschen: über gleichberechtigten User, dann Löschen von "x" im Feld "Key ID"
  
-===== Command Line ===== +===== Command Line =====
  
 **qm**  = Management der **kvm**  VMs **qm**  = Management der **kvm**  VMs
Zeile 92: Zeile 104:
 <code> <code>
 pvenode stopall pvenode stopall
 +
 </code> </code>
  
Zeile 98: Zeile 111:
 <code> <code>
 qm destroy 105 qm destroy 105
 +
 </code> </code>
  
Zeile 104: Zeile 118:
 <code> <code>
 pct mount 108 mounted CT 108 in '/var/lib/lxc/108/rootfs' pct mount 108 mounted CT 108 in '/var/lib/lxc/108/rootfs'
 +
 </code> </code>
- 
  
 Gemeinsames Guest Share (smb) Gemeinsames Guest Share (smb)
Zeile 111: Zeile 125:
 <code> <code>
 mount.cifs \\\\10.10.10.1\\guests /mnt/guests mount.cifs \\\\10.10.10.1\\guests /mnt/guests
 +
 </code> </code>
  
Zeile 117: Zeile 132:
 <code> <code>
 du -a /home | sort -n -r | head -n 5 find / -type f -size +100M du -a /home | sort -n -r | head -n 5 find / -type f -size +100M
 +
 </code> </code>
  
 Container umbenennen Container umbenennen
- 
 <code> <code>
 +
 pct set <VMID> --hostname <newname> pct set <VMID> --hostname <newname>
 +
 </code> </code>
  
Zeile 129: Zeile 146:
 <code> <code>
 pct enter <VMID> pct enter <VMID>
 +
 </code> </code>
  
Zeile 137: Zeile 155:
 <code> <code>
 pct push <VMID> <file> <target> pct push <VMID> <file> <target>
 +
 </code> </code>
  
Zeile 143: Zeile 162:
 <code> <code>
 pct pull <vmid> <path> <destination> [OPTIONS] pct pull <vmid> <path> <destination> [OPTIONS]
 +
 </code> </code>
  
 ===== Backups manuell ===== ===== Backups manuell =====
  
-<code>vzdump 102 118 122 --compress zstd --mode stop --prune-backups 'keep-last=2' --mailnotification failure --mailto admin@netzwissen.de --quiet 1 --storage storagebox_191707+<code> 
 +vzdump 102 118 122 --compress zstd --mode stop --prune-backups 'keep-last=2' --mailnotification failure --mailto admin@netzwissen.de --quiet 1 --storage storagebox_191707 
 </code> </code>
  
Zeile 154: Zeile 176:
 <code> <code>
 pvesh create /nodes/localhost/stopall pvesh create /nodes/localhost/stopall
 +
 </code> </code>
  
-Doku: https://www.historiantech.com/increasing-operational-efficiency-in-proxmox-with-pvesh/+Doku: [[https://www.historiantech.com/increasing-operational-efficiency-in-proxmox-with-pvesh/|https://www.historiantech.com/increasing-operational-efficiency-in-proxmox-with-pvesh/]]
  
 ===== PVE Templates ===== ===== PVE Templates =====
  
 Erreichbare Templates auflisten Erreichbare Templates auflisten
- 
 <code> <code>
 +
 pveam update pveam update
  
 pveam available pveam available
 +
 </code> </code>
  
Zeile 172: Zeile 196:
 <code> <code>
 pveam download local debian-10.0-standard_10.0-1_amd64.tar.gz pveam download local debian-10.0-standard_10.0-1_amd64.tar.gz
 +
 </code> </code>
  
Zeile 189: Zeile 214:
  
  pve-firewall start  pve-firewall start
 +
 </code> </code>
  
-**Wenn die Firewall den Host blockiert:** Mit diesem Skript in rc.local wird die FW beim Neustart immer ausgeschaltet:+**Wenn die Firewall den Host blockiert:**  Mit diesem Skript in rc.local wird die FW beim Neustart immer ausgeschaltet:
  
 <code> <code>
Zeile 213: Zeile 239:
 </code> </code>
  
 +===== Meckermails von CERT-BUND wegen RPC =====
 +
 +Portt 11 ist normalerweise offen, wird aber nicht gebraucht, Zitat Proxmox Staff
 +
 +//regarding port 111 - it should work to just remove `rpcbind, nfs-common` if you don't need it \\ We might consider doing so in a future version, but since it's expected to deploy PMG behind a firewall (or configure iptables/nft on it) it's not really high priori//ty
 +
 +Service abschalten mit
 +
 +<code>
 +root@kakariki ~ # systemctl stop rpcbind
 +Warning: Stopping rpcbind.service, but it can still be activated by:
 +  rpcbind.socket
 +root@kakariki ~ # systemctl stop rpcbind.socket
 +root@kakariki ~ # systemctl stop rpcbind
 +root@kakariki ~ # systemctl disable rpcbind
 +Synchronizing state of rpcbind.service with SysV service script with /lib/systemd/systemd-sysv-install.
 +Executing: /lib/systemd/systemd-sysv-install disable rpcbind
 +Removed "/etc/systemd/system/multi-user.target.wants/rpcbind.service".
 +Removed "/etc/systemd/system/sockets.target.wants/rpcbind.socket".
 +
 +</code>
  
 ===== SMB Mount mit Containern ===== ===== SMB Mount mit Containern =====
  
-Geht nur mit **privileged** container. Unter /Your LXC Option/Feature muss die "CIFS capability" aktiviert sein.+Geht nur mit **privileged**  container. Unter /Your LXC Option/Feature muss die "CIFS capability" aktiviert sein.
  
 ===== LXC und KVM Netplan Beispielconfigs ===== ===== LXC und KVM Netplan Beispielconfigs =====
Zeile 245: Zeile 292:
           via:  136.243.85.129           via:  136.243.85.129
           metric:  100           metric:  100
 +
 </code> </code>
  
Zeile 256: Zeile 304:
     eth0:     eth0:
       dhcp4:  no       dhcp4:  no
-      addresses:  +      addresses:
         - 10.10.10.16/24         - 10.10.10.16/24
       gateway4:  10.10.10.1       gateway4:  10.10.10.1
Zeile 266: Zeile 314:
           on-link:  true           on-link:  true
 /etc/netplan/01-netcfg.yaml (END) /etc/netplan/01-netcfg.yaml (END)
 +
 </code> </code>
  
 Testen: Testen:
  
-sudo netplan generate +sudo netplan generate
  
 Testen mit automatischem zurücksetzen auf den vorherigen Stand Testen mit automatischem zurücksetzen auf den vorherigen Stand
  
-sudo netplan try -timeout 180 +sudo netplan try -timeout 180
  
 Anwenden Anwenden
  
-sudo netplan apply +sudo netplan apply
  
 ===== LXC speziell ===== ===== LXC speziell =====
  
-https://pve.proxmox.com/wiki/Linux_Container+[[https://pve.proxmox.com/wiki/Linux_Container|https://pve.proxmox.com/wiki/Linux_Container]]
  
 Debug Modus beim Start Debug Modus beim Start
  
-pct start 110 --debug+pct start 110 debug
  
 ===== Port 111 rpcbind ===== ===== Port 111 rpcbind =====
Zeile 303: Zeile 352:
  
 zst dekomprimieren zst dekomprimieren
- 
 <code> <code>
 +
 zstd -d vzdump-lxc-113-2022_05_14-01_30_57.tar.zst zstd -d vzdump-lxc-113-2022_05_14-01_30_57.tar.zst
 +
 </code> </code>
  
-danach mit tar xf ...tar auspacken.+danach mit tar xf tar auspacken.
  
 <file> <file>
- 
 lzop -x [*.lzo Datei] lzop -x [*.lzo Datei]
  
Zeile 359: Zeile 408:
 </file> </file>
  
-Der Offset ist also **<font inherit/inherit;;#c0392b;;inherit>4096 x 512 = 2097152.</font>**  Der Mountbefehl sieht so aus:+Der Offset ist also ** 
 + <font inherit/inherit;;#c0392b;;inherit>4096 x 512 = 2097152.</font> **  Der Mountbefehl sieht so aus:
  
 <file> <file>
Zeile 387: Zeile 437:
  
 qemu-nbd --connect=/dev/nbd0 /var/lib/vz/images/100/vm-100-disk-1.qcow2 qemu-nbd --connect=/dev/nbd0 /var/lib/vz/images/100/vm-100-disk-1.qcow2
 +
 </code> </code>
  
Zeile 412: Zeile 463:
 <code> <code>
 mount /dev/nbd0p1 /mnt/somepoint/ mount /dev/nbd0p1 /mnt/somepoint/
 +
 </code> </code>
  
Zeile 422: Zeile 474:
  
 rmmod nbd rmmod nbd
 +
 </code> </code>
  
 ===== LXC: raw Device mounten ===== ===== LXC: raw Device mounten =====
  
-Ablauf manuell+Welche loop devices werden aktuell benutzt
  
-welche loop devices sind frei+<code> 
 + <font inherit/monospace;;inherit;;#ff5454background-color:#ffffff;>root</font> 
 + <font inherit/inherit;;inherit;;#ffff54background-color:#ffffff;>@</font> 
 + <font inherit/inherit;;inherit;;#54ffffbackground-color:#ffffff;>tokoeka</font> 
 + <font inherit/inherit;;inherit;;#ffff54background-color:#ffffff;>/mnt</font> 
 + <font inherit/inherit;;inherit;;#ff54ffbackground-color:#ffffff;>#</font> 
 + <font inherit/inherit;;inherit;;#000000background-color:#ffffff;>losetup -l</font>   NAME        SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE                              DIO LOG-SEC 
 +/dev/loop1          0      0          0 /mnt/data/images/108/vm-108-disk-1.raw       512 
 +/dev/loop27              0          0 /mnt/data/images/112/vm-112-disk-0.raw       512 
 +/dev/loop17              0          0 /mnt/data/images/111/vm-111-disk-2.raw       512 
 +/dev/loop8          0      0          0 /mnt/data/images/110/vm-110-disk-0.raw       512 
 +/dev/loop25              0          0 /mnt/data/images/125/vm-125-disk-1.raw       512 
 +/dev/loop6          0      0          0 /mnt/data/images/100/vm-100-disk-0.raw       512 
 +/dev/loop23              0          0 /mnt/data/images/122/vm-122-disk-1.raw       512 
 +/dev/loop13              0          0 /mnt/data/images/113/vm-113-disk-0.raw       512 
 + 
 +</code> 
 + 
 +Ablauf manuell
  
-''ls /dev/loop* /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/loop-control '' 
 <code> <code>
 losetup /dev/loop22 disk-drive-ide0.raw losetup /dev/loop22 disk-drive-ide0.raw
Zeile 492: Zeile 562:
  
 Offen: offset? p1 ? Offen: offset? p1 ?
- 
  
 ===== Daten-Konvertierungen ===== ===== Daten-Konvertierungen =====
  
-https://stafwag.github.io/blog/blog/2018/07/01/migrate-a-windows-vmware-vrtual-machine-to-kvm/+[[https://stafwag.github.io/blog/blog/2018/07/01/migrate-a-windows-vmware-vrtual-machine-to-kvm/|https://stafwag.github.io/blog/blog/2018/07/01/migrate-a-windows-vmware-vrtual-machine-to-kvm/]]
  
 Split disks in eine Datei umwandeln Split disks in eine Datei umwandeln
- 
 <code> <code>
 +
 vmware-vdiskmanager -r leapsrv.vmdk -t 0 /tmp/leapsrv_combined.vmdk vmware-vdiskmanager -r leapsrv.vmdk -t 0 /tmp/leapsrv_combined.vmdk
 +
 </code> </code>
  
Zeile 508: Zeile 578:
 <code> <code>
 qemu-img convert -f vmdk -O qcow2 leapsrv_combined.vmdk leapsrv_combined.vmdk.qcow2 qemu-img convert -f vmdk -O qcow2 leapsrv_combined.vmdk leapsrv_combined.vmdk.qcow2
 +
 </code> </code>
  
 Andersrum von qcow2 (kvm) nach raw (lxc): Andersrum von qcow2 (kvm) nach raw (lxc):
  
-<code>qemu-img convert -f qcow2 -O raw vm-109-disk-1.qcow2 /mnt/data/images/114/vm-114-disk-3.raw+<code> 
 +qemu-img convert -f qcow2 -O raw vm-109-disk-1.qcow2 /mnt/data/images/114/vm-114-disk-3.raw 
 </code> </code>
  
 ====== SPICE ====== ====== SPICE ======
  
-Doku: https://pve.proxmox.com/wiki/SPICE#Requirements_for_SPICE +Doku: [[https://pve.proxmox.com/wiki/SPICE#Requirements_for_SPICE|https://pve.proxmox.com/wiki/SPICE#Requirements_for_SPICE]] Hilfs-Skript in /etc/scripts/spice.sh
-Hilfs-Skript in /etc/scripts/spice.sh +
 <code> <code>
 +
 Usage: ./spice.sh [-u <string>] [-p <string>] vmid [node [proxy]] Usage: ./spice.sh [-u <string>] [-p <string>] vmid [node [proxy]]
  
Zeile 529: Zeile 601:
 node: Proxmox cluster node name node: Proxmox cluster node name
 proxy: DNS or IP (use <node> as default) proxy: DNS or IP (use <node> as default)
 +
 </code> </code>
- 
  
 Client: virt-viewer, Remmina Client: virt-viewer, Remmina
- +
 ====== ZFS Installation ====== ====== ZFS Installation ======
  
Zeile 540: Zeile 612:
 apt install linux-headers-amd64 zfsutils-linux zfs-dkms zfs-zed apt install linux-headers-amd64 zfsutils-linux zfs-dkms zfs-zed
  
-[https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bullseye%20Root%20on%20ZFS.html](https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bullseye%20Root%20on%20ZFS.html)+[[:https:openzfs.github.io_openzfs-docs_getting_20started_debian_debian_20bullseye_20root_20on_20zfs.html|https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bullseye%20Root%20on%20ZFS.html]]]([[https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bullseye%20Root%20on%20ZFS.html|https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bullseye%20Root%20on%20ZFS.html]])
  
 ===== Partitionieren ===== ===== Partitionieren =====
Zeile 548: Zeile 620:
 (Achtung: gdisk konvertiert MBR nach GPT) (Achtung: gdisk konvertiert MBR nach GPT)
  
-/dev/disk/by-id/nvme-eui.0025388511c55959 +/dev/disk/by-id/nvme-eui.0025388511c55959 /dev/disk/by-id/nvme-eui.0025388511c5595b
-/dev/disk/by-id/nvme-eui.0025388511c5595b+
  
-DISK1=/dev/disk/by-id/nvme-eui.0025388511c55959-part7 +DISK1=/dev/disk/by-id/nvme-eui.0025388511c55959-part7 DISK2=/dev/disk/by-id/nvme-eui.0025388511c5595b-part7
-DISK2=/dev/disk/by-id/nvme-eui.0025388511c5595b-part7+
  
 Dannach zpool anlegen. "mirror" entspricht RAID1 Dannach zpool anlegen. "mirror" entspricht RAID1
- 
 <code> <code>
 +
 zpool create [-dfn] [-m mountpoint] [-o property=value]… [-o feature@feature=value] zpool create [-dfn] [-m mountpoint] [-o property=value]… [-o feature@feature=value]
            [-o compatibility=off|legacy|file[,file]…] [-O file-system-property=value]… [-R root] [-t tname] pool vdev…            [-o compatibility=off|legacy|file[,file]…] [-O file-system-property=value]… [-R root] [-t tname] pool vdev…
-</code> 
  
 +</code>
 <code> <code>
 +
 zpool create \ zpool create \
     -o ashift=12 \     -o ashift=12 \
Zeile 588: Zeile 659:
     /dev/disk/by-id/nvme-eui.0025388511c55959-part7 \     /dev/disk/by-id/nvme-eui.0025388511c55959-part7 \
    /dev/disk/by-id/nvme-eui.0025388511c5595b-part7    /dev/disk/by-id/nvme-eui.0025388511c5595b-part7
 +
 </code> </code>
  
Zeile 606: Zeile 678:
  
 root@kakariki /etc/pve # pvenode acme cert order root@kakariki /etc/pve # pvenode acme cert order
 +
 </code> </code>
  
-Loading ACME account details +Loading ACME account details Placing ACME order Order URL: <[[https://acme-v02.api.letsencrypt.org/acme/order/1232182246/198286068416|https://acme-v02.api.letsencrypt.org/acme/order/1232182246/198286068416]]>
-Placing ACME order +
-Order URL: <https://acme-v02.api.letsencrypt.org/acme/order/1232182246/198286068416>+
  
-Getting authorization details from '<https://acme-v02.api.letsencrypt.org/acme/authz-v3/250346582026>' +Getting authorization details from '<[[https://acme-v02.api.letsencrypt.org/acme/authz-v3/250346582026|https://acme-v02.api.letsencrypt.org/acme/authz-v3/250346582026]]>' The validation for kakariki.netzwissen.de is pending! Setting up webserver Triggering validation Sleeping for 5 seconds Status is 'valid', domain 'kakariki.netzwissen.de' OK!
-The validation for kakariki.netzwissen.de is pending! +
-Setting up webserver +
-Triggering validation +
-Sleeping for 5 seconds +
-Status is 'valid', domain 'kakariki.netzwissen.de' OK!+
  
 All domains validated! All domains validated!
  
-Creating CSR +Creating CSR Checking order status Order is ready, finalizing order valid!
-Checking order status +
-Order is ready, finalizing order +
-valid!+
  
-Downloading certificate +Downloading certificate Setting pveproxy certificate and key Restarting pveproxy Task OK
-Setting pveproxy certificate and key +
-Restarting pveproxy +
-Task OK+
  
 ### ACME DNS validation Hetzner DNS API ### ACME DNS validation Hetzner DNS API
  
 export HETZNER_Token="<token>" export HETZNER_Token="<token>"
- 
 <code> <code>
 +
 ./acme.sh --issue --dns dns_hetzner -d example.com -d *.example.com ./acme.sh --issue --dns dns_hetzner -d example.com -d *.example.com
 +
 </code> </code>
 +
 +
 +
  
  • proxmox.1702913420.txt.gz
  • Zuletzt geändert: 05/03/2024 - 10:52
  • (Externe Bearbeitung)