Доки, маны, напоминалки


Posted on Июль 27, 2016

You should be able to image your disks from a snapshot:

First you wil need to make sure the Vm is not running:
virsh suspend vm
Now you can create a snapshot make sure to adjust the size 100M and the name vm-root-snapshot to your own needs.
lvcreate -L 100M -n vm-root-snapshot -s /dev/sysvg/vm-root
After this you can start the VM again.
virsh resume vm

Now that you have the snapshot you can create the image and delete the snapshot:
dd if=/dev/mapper/sysvg-vm--root--snapshot of=/tmp/vm-root.img bs=1M
lvremove /dev/mapper/sysvg-vm--root--snapshot

The image can be copied to the new server and imported to the LVM on the new server with dd
dd if=/tmp/vm-root.img of=/dev/mapper/sysvg-vm--root bs=1M

Also don't forget to import your XML file.
virsh define /path/to/vm.xml

Метки записи: , , Нет комментариев