[Fedora-xen] xen and lvm

Richard W.M. Jones rjones at redhat.com
Mon Nov 5 16:17:45 UTC 2007


Augusto Castelan Carlson wrote:
> I'm using fedora 7 for both host and guests. I would like to be able
> to borrow unused space from one guest to be used in another one.
> 
> Looking for how to do that I only found instructions from people that
> creates logical volumes and install the system using debootstrap. I
> would like to use virt-manager to install my guests with lvm. How can
> I do the partitioning for guests during my host install?

I think a number of separate issues to address here.

The advantages of LVM when combined with virtualisation or Xen are that 
you can create guest partitions easily and flexibly, that they can have 
nice names, and that you can resize and also delete them simply.  LVM 
also lets you do this flexibly across physical disks, add extra physical 
disks if you run out of space, and so on.

So the basic command you need is:

   lvcreate -L 10G -n myguest VolGroup00

which would create a 10 GB partition called /dev/VolGroup00/myguest 
within an existing volume group called VolGroup00.  (This isn't going to 
be a tutorial about LVM - there are plenty out there, go and use Google).

With the partition created above, just use the name of the partition 
directly within the virt-manager creation dialog.  Forthcoming versions 
of virt-manager will be able to do the provisioning of LVM storage more 
automatically.  If you want to follow this work, take a look at libvir-list.

This doesn't address directly your problem "to be able to borrow unused 
space from one guest to be used in another one".  All that you'll get 
with basic LVM is the ability to resize one guest down and another guest up.

If all your guests are "related" -- that is they are derived from say a 
single distribution, there are several options: run an NFS server and 
share parts of the guests' filesystems, eg. home directories or /usr if 
you're feeling adventurous.

You could also look at LVM snapshotting, which will let guests "share" a 
single installation, but writes all modifications to their private 
partitions.  The disadvantage of snapshotting is that although your 
guests start small, they grow indefinitely over time and later common 
changes cannot be shared.

Rich.

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/fedora-xen/attachments/20071105/152dda6b/attachment.bin>


More information about the Fedora-xen mailing list