Is there a simple way to directly install a vm on an lvm (or proably seperate LVM's for root and swap)? For example something like:
lvcreate -L 10G -n testvm_root vg_myvg lvcreate -L 1G -n testvm_swap
Then somehow setup the VM to be able to directly install and boot the vm from these LV's. How do I do this?
Could you then pause the virtual machine and safely take an LVM snapshot, continue the VM and then mount the snapshot on the host and do a backup?
This would be for CentOS/Redhat 6.
Thanks, Nataraj
On 02/13/2011 10:27 AM, Nataraj wrote:
Is there a simple way to directly install a vm on an lvm (or proably seperate LVM's for root and swap)? For example something like:
lvcreate -L 10G -n testvm_root vg_myvg lvcreate -L 1G -n testvm_swap
Then somehow setup the VM to be able to directly install and boot the vm from these LV's. How do I do this?
Could you then pause the virtual machine and safely take an LVM snapshot, continue the VM and then mount the snapshot on the host and do a backup?
This would be for CentOS/Redhat 6.
I am not sure that I have correctly understood your question, but I have the following setup functional in Centos 5 for several years = dedicated logical volumes,similar to your example = a xen configuration as below disk = [ 'phy:/dev/VG1/biblioteca,hda1,w','phy:/dev/VG2/disk2,hdb,w','phy:/dev/hde,hdc,w','phy:/dev/hdh,hdd,w' ] ( mind hda and hdb which are LVs created during the first step)
On 02/13/2011 09:27 AM, Nataraj wrote:
Is there a simple way to directly install a vm on an lvm (or proably seperate LVM's for root and swap)? For example something like:
lvcreate -L 10G -n testvm_root vg_myvg lvcreate -L 1G -n testvm_swap
Then somehow setup the VM to be able to directly install and boot the vm from these LV's. How do I do this?
You can do this with virt-manager. Just specify the logical volume as storage instead of a file. You'd have to add the swap space after the installation though.
The way I do this is to create just one logical volume for the VM with 11G and the in the guest specify one 10G volume for root and 1G for swap. That way you only have one logical volume per VM on the host.
Could you then pause the virtual machine and safely take an LVM snapshot, continue the VM and then mount the snapshot on the host and do a backup?
Probably not. If you pause the guest then the filesystem on it might be in an inconsistent state. You will be able to make a snapshot since that happens on the block level but you might have problems mounting it.
Regards, Dennis
2011/2/13 Dennis Jacobfeuerborn dennisml@conversis.de:
On 02/13/2011 09:27 AM, Nataraj wrote:
Is there a simple way to directly install a vm on an lvm (or proably seperate LVM's for root and swap)? For example something like:
Use a volume group as a storage pool in virsh/virt-manager: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualiza...
Best regards Kenni
On 02/13/2011 12:18 PM, Kenni Lund wrote:
2011/2/13 Dennis Jacobfeuerborn dennisml@conversis.de:
On 02/13/2011 09:27 AM, Nataraj wrote:
Is there a simple way to directly install a vm on an lvm (or proably seperate LVM's for root and swap)? For example something like:
Use a volume group as a storage pool in virsh/virt-manager: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualiza...
Best regards Kenni _______________________________________________ CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
Thank you. This is what I was looking for.
Nataraj
On 02/13/2011 10:21 AM, Dennis Jacobfeuerborn wrote:
Could you then pause the virtual machine and safely take an LVM snapshot, continue the VM and then mount the snapshot on the host and do a backup?
Probably not. If you pause the guest then the filesystem on it might be in an inconsistent state. You will be able to make a snapshot since that happens on the block level but you might have problems mounting it.
Regards, Dennis
I've heard of somebody doing something to make this work. I think you could create another LV (from inside the VM - assuming a linux VM) on top of whatever raw partition was available to the VM. Then you could take the snapshot within the VM (which I believe guarantees that the filesystem is sync'ed when the snapshot is taken.) Then you use losetup and lvscan to make the lvm vg available on the host and I think you could access the snapshot without even pausing the vm.
Nataraj
On 02/13/2011 02:30 PM, Nataraj wrote:
On 02/13/2011 10:21 AM, Dennis Jacobfeuerborn wrote:
Could you then pause the virtual machine and safely take an LVM snapshot, continue the VM and then mount the snapshot on the host and do a backup?
Probably not. If you pause the guest then the filesystem on it might be in an inconsistent state. You will be able to make a snapshot since that happens on the block level but you might have problems mounting it.
Regards, Dennis
I've heard of somebody doing something to make this work. I think you could create another LV (from inside the VM - assuming a linux VM) on top of whatever raw partition was available to the VM. Then you could take the snapshot within the VM (which I believe guarantees that the filesystem is sync'ed when the snapshot is taken.) Then you use losetup and lvscan to make the lvm vg available on the host and I think you could access the snapshot without even pausing the vm.
Nataraj
I guess this is not the case. You can attach the VM virtual disk to the loopback and see the VG and it's LV's, but they show up as unavailable. I guess changing the snapshot to be available would be writing to the LV structure and could cause corruption while the vm is running, so better not.
Nataraj