is it possible to migrate from local to drbd

bread-baker

Member
Mar 6, 2010
432
0
16
I have a few kvm's on local storage.

Is it possible to migrate those to drbd storage?

drbd is working great , and online migration is very fast. it is magical.
 
There is no automatic way to do this, but this is what I did a couple of hours ago.

1) Stop the virtual machine in question
2) Back up your config file (/etc/pve/qemu-server/<vmid>.conf)
3) Create a new disk with the same size
4) Log in to a console, and do " dd if=/dev/<src vg>/<src lv> of=/dev/<dst vg>/<dst lv> bs=4096k
5) Delete the old disk from the config file, and change the disknumbers

Example:

old:
virtio0: localvg:vm-100-disk-1
virtio1: drbdvg:vm-100-disk-1

new:
virtio0: drbdvg:vm-100-disk-1
 
thanks for the reply.

could you tell me how you did this step: 3- Create a new disk with the same size?
 
I think he means to create the disk on the DRBD volume using the web interface.

Sorry for not making that clear. It could be done using the commandline using lvcreate, but I'm not sure how pve picks up logical volumes into a virtual machine.
 

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!