Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

On a Debian wheezy i installed KVM for virtualization and install some VMs on it. I use separate LVM disks because of its performance for my VMs disk.

Now i need to clone one of them in new LVM disk. I searched too much for it and i found virt-clone, but unfortunately The virt-clone just clone Vms with disk in files and cannot clone LVM disks. I think it is possible by dd like so:

dd if=/dev/vg_kvm/lv_disk1 of=/dev/vg_kvm/lv_disk2

Is there any more optimize solution? How can i clone my VM which is installed on a LVM disk to a new LVM disk?

share|improve this question
    
What was wrong with my question for down vote it? –  shgnInc Apr 20 at 4:36

1 Answer 1

up vote 1 down vote accepted

You can use LVM volumes as targets for the copy without a problem

virt-clone -o source_system --name new_system --file /dev/vg_kvm/lv_disk2

should do the trick. It handles the source block device (instead of a file) as well.

share|improve this answer
    
If i do so, Is there any problem for network-UUID and VM-UUID? If so, how to solve it? –  shgnInc Apr 19 at 12:03
1  
No, there is not. Please read the virt-clone man page. Cite: Elements which require uniqueness will be updated to avoid a clash between old and new guests. What has this to do with whether you use a file or a LVM volume as a target anyway? Either virt-clone handles this correctly or it doesn't, but it wouldn't make a difference depending on the target device. Remember: A block device is a file, that's one of the core principles of Unix: Devices are files. –  Sven Apr 19 at 12:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.