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