Moving VMs from Old Disk

vmslinger

Active Member
Apr 24, 2019
4
1
43
44
I had a Proxmox server fail on me. Luckily, the old disk is still fine. I did purchase a new server, with faster disk, and would like to move the VMs from the old disk to the new disk. I am able to install the old disk in the new server. But I am lost as to how to get the new server to "recognize" the VMs on the old disk and how to move them.

Right now, I have it set up with two PVs:
new disk: pve
old disk: pve2 (was pve, but renamed to avoid conflict with new disk)

I tried to copy the LVs by creating a 'dd' from the old disk's LV. But I can not create the LV on the new disk ("insufficient free space... but there are no VMs yet on the new disk). Also, while this would copy the disks, it wouldn't copy the VM configuration files.

Any advise? Is there a way to "import" the VMs from the old disk? Thanks.
 
I had a Proxmox server fail on me. Luckily, the old disk is still fine. I did purchase a new server, with faster disk, and would like to move the VMs from the old disk to the new disk. I am able to install the old disk in the new server. But I am lost as to how to get the new server to "recognize" the VMs on the old disk and how to move them.

Right now, I have it set up with two PVs:
new disk: pve
old disk: pve2 (was pve, but renamed to avoid conflict with new disk)

I tried to copy the LVs by creating a 'dd' from the old disk's LV. But I can not create the LV on the new disk ("insufficient free space... but there are no VMs yet on the new disk). Also, while this would copy the disks, it wouldn't copy the VM configuration files.

Any advise? Is there a way to "import" the VMs from the old disk? Thanks.

- For accessing virtual disks at the old PV: create a new storage type "LVM" which refers to the old VG (probably pve2-data)

- For reading the old configuration files (and "import" them into the new server):

pve's configration data are in /var/lib/pve-cluster/config.db, they are accessible via fuse file system at mountpoint /etc/pve , to read the old data you have to unmount the current data first by

Code:
systemctl stop pve-cluster

then save the current /var/lib/pve-cluster/config.db somewhere and replace it by the old /var/lib/pve-cluster/config.db and mount the old one by

Code:
systemctl start pve-cluster

copy the VM configuration (and some other if needed) data to another directory, e.g.
Code:
cp /etc/pve/qemu-server/* /tmp/config-old/.

Then return to the new config.db which you have seved before as described above and copy the config files
Code:
cp /tmp/config-old/* /etc/pve/qemu-server/.

Take care that you do not have any contradictions regarding VM names, probably you have also to adapt the storage reference (your storage at the new server which refers to the old PV will have a different name) and possibly some other data as e.g. network.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!