is it possible to migrate from local to drbd

Discussion in 'Proxmox VE: Installation and configuration' started by bread-baker, Oct 8, 2011.

  1. bread-baker

    bread-baker Member

    Joined:
    Mar 6, 2010
    Messages:
    432
    Likes Received:
    0
    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.
     
  2. sel

    sel New Member

    Joined:
    Jul 17, 2008
    Messages:
    15
    Likes Received:
    0
    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
     
  3. bread-baker

    bread-baker Member

    Joined:
    Mar 6, 2010
    Messages:
    432
    Likes Received:
    0
    thanks for the reply.

    could you tell me how you did this step: 3- Create a new disk with the same size?
     
  4. e100

    e100 Active Member
    Proxmox Subscriber

    Joined:
    Nov 6, 2010
    Messages:
    1,231
    Likes Received:
    23
    I think he means to create the disk on the DRBD volume using the web interface.
     
  5. sel

    sel New Member

    Joined:
    Jul 17, 2008
    Messages:
    15
    Likes Received:
    0
    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.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice