[CentOS-virt] using an lvm for kvm vm
dennisml at conversis.de
Sun Feb 13 13:21:06 EST 2011
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
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.
More information about the CentOS-virt