Copying (duplicating) a VM disk (ceph/rbd)

Nov 22, 2020
80
11
13
51
Hi,

To help upgrade a VM with a large disk (on ceph/rbd storage) we'd like to copy the VM disk and mount the copy on a new VM.

I didn't see an obvious way to do it in the proxmox VE UI, did I miss something?

I'm thinking of doing like described here:

https://pve.proxmox.com/wiki/Moving_disk_image_from_one_KVM_machine_to_another

But replacing the "rbd mv rbd/vm-400-disk-1 rbd/vm-2300-disk-1" command by a "rbd cp" (or deep cp but we don't have live snapshots).

Would that work?

Ceph doc also mention "rbd clone mypool/myimage@mysnap otherpool/cloneimage" which would be COW on a protected snapshot but even if that would be more efficient it seems tricky to get it right:

https://docs.ceph.com/en/latest/man/8/rbd/
 
I would just stop the VM, get a cold snapshot, boot again and start upgrading things inside the VM. If it goes wrong, stop the VM and rollback to the snapshot.

You can also restore a backup of the VM with another VMID, change the MAC address, boot without network, change the IP in the VM OS and connect the network back. Keep in mind that this procedure might not be applicable to you as there might be scheduled jobs or connections to other services/VMs that might interfere with the "original" VM if both are up and running (i.e. cronjobs importing something and storing anything in an external DB).
 
I would just stop the VM, get a cold snapshot, boot again and start upgrading things inside the VM. If it goes wrong, stop the VM and rollback to the snapshot.

You can also restore a backup of the VM with another VMID, change the MAC address, boot without network, change the IP in the VM OS and connect the network back. Keep in mind that this procedure might not be applicable to you as there might be scheduled jobs or connections to other services/VMs that might interfere with the "original" VM if both are up and running (i.e. cronjobs importing something and storing anything in an external DB).
We already have a new VM with the newer software and operating system installed and validated by our user test team.

The new VM just lacks the real data which is on the current (old) VM in production and quite large in size relative to our infrastructure (otherwise we would just have copied the data).

Both the current and new VM are backuped daily on PBS, I think that copying/moving the existing disk rather than using rsync will likely be more efficient from a PBS standpoint (perfectly efficient vs probably lots of blocks moving around).
 

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!