how to move vm from local storage to LVM?

nate

Member
Mar 15, 2011
63
0
6
I had a couple vms in local directory storage. I added a LVM that uses drbd (in a 2 server cluster). How can I move the vm from local storage to the new lvm storage? Can I just copy the directories and files or is there more to it?

thanks for the help!!
 
The safest and easiest way is to backup the VM and then restore with --storage VLMSTORAGENAME flag. VLMSTORAGENAME is the name of LVM storage as assigned through web interface, not the volume group name or whatever (i.e. '--storage local' would restore to /var/lib/vz/images).
 
thank you fro the help. I just want to make sure I understand this. I should use these commands. (say my vmid is 101)
vzdump 101

to get a backup

then

vzrestore --storage /space/backup/vzdump-101.tar myGUILVMName

to restore into new LVM space
Is that right?