Using LVM under MLN
LVM - logical volume management, is a dynamic way to create partitions -
called volumes. In terms of virtualization, it is popular to use LVM volumes
as harddisks for the VMs because of a improved disk performance compared to
the default filesystem image files. This will work both for UML and Xen
virtual machines.
Setting up LVM for MLN is not a very difficult task. First of all, you need
to have the lvm tools installed, but they come with most of todays
distributions already. The summary of this example, is that it will show you
how to create a LVM volume group and how to make MLN place its filesystems
there.
1. Assigning the partitions to use
First of all, you'll need one or more partitions. You can increase the size
of the LVM volume group later with more partitions. If you want better
performance and have several disks, you can create a software RAID first,
and then use that for the volume group. Lets say you want to use partition
/dev/sdb1:
pvcreate /dev/sdb1
2. Creating the volume group
Next, we create the actual LVM volume group. You can choose any name you
want for it, but the default for MLN is "mln-images", and we will use that
here:
vgcreate mln-images /dev/sdb1
3. Modifying /etc/mln/mln.conf
This is not strictly necessary if you called your volume group "mln-images".
Make sure you have the following line in
/etc/mln/mln.conf:
lvm_vg /dev/your-vg-name
4. Building a project with LVM
This is a very simple project, that will put the filesystem on on the LVM
volume group:
global {
project lvm-test
}
host one {
lvm
term screen
}
Build this project, start it, and connect to the screen terminal:
screen
-r one.lvm-test. Also, you can check the presence of the LVM filesystem:
ls /dev/mln-images/one.lvm-test
.