Proxmox: virtuelle Maschine exportieren/deployen

Datum

Ich wollte eine virtuelle Maschine, die in Proxmox aktuell gehalten werden soll, auf physische Datenträger exportieren, damit diese mit dem Betriebssystem vollständig deployed werden kann.

Die virtuelle Maschine besitzt eine virtuelle Disk im RAW Format, damit ich diese einfach als Loop Device einbinden kann. Wie im Artikel Proxmox RAW-virtual Disk mit LVM mounten beschrieben.

Die Zielfestplatte benötigt keine Partitionen und somit keine notwendige Vorbereitung.

Disk /dev/sda: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk model: TOSHIBA THNSNJ12
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x598c94e3

Die vDisk der VM ist eingebunden als /dev/loop5

root@pve:~# fdisk -l
Disk /dev/loop5: 32 GiB, 34359738368 bytes, 67108864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1f3c59b9
Device       Boot   Start      End  Sectors  Size Id Type
/dev/loop5p1 *       2048  1953791  1951744  953M 83 Linux
/dev/loop5p2      1955838 67106815 65150978 31.1G  5 Extended
/dev/loop5p5      1955840 67106815 65150976 31.1G 83 Linux

Anschließend kann die virtuelle Festplatte mit dd auf die physische geklont werden.

root@pve:~# dd status=progress if=/dev/loop5 of=/dev/sda
34357330432 bytes (34 GB, 32 GiB) copied, 786 s, 43.7 MB/s
67108864+0 records in
67108864+0 records out
34359738368 bytes (34 GB, 32 GiB) copied, 793.558 s, 43.3 MB/s

Anschließend wurden die Partitionierung, Bootloader und die Daten auf die physische Festplatte geschrieben.

Disk /dev/sda: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk model: TOSHIBA THNSNJ12
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1f3c59b9
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048  1953791  1951744  953M 83 Linux
/dev/sda2       1955838 67106815 65150978 31.1G  5 Extended
/dev/sda5       1955840 67106815 65150976 31.1G 83 Linux

Die Festplatte kann nun in ein Gerät eingebaut werden und ist ohne weiteren Aufwand bootfähig und benutzbar.

Autor
Kategorien Proxmox

PRTG Map