FAQ
Greetings -

I am a novice system administrator and will soon be purchasing a new server
to replacing an aging file server for my company. I am considering setting
up the new server as a KVM host with two guests; one guest as the Samba file
server and a second guest as a testing area. My old server was set up about
7 years ago and has a 5 disk raid 5 configuration without LVM. I understand
the benefits of using LVM and KVM in the right circumstances, but have never
used either of them. I have spent a couple of days over the last week
trying to understand how to setup a KVM host with guests, but there is an
area that I still don't understand; that is the relationship between the
underlying raid partitions, LVM, and allocating space to a host and guests.
Many of the standard search term combinations in Google don't seem to be
getting me anywhere. From what I have read so far I think that I want to
have my file server guest using a raw partition rather than an image file,
but I haven't found anything with examples or best-practices guidance for
partitioning or volume management with hosts and guest VMs. So I am hoping
that someone here can give me some pointers, or point me to some clear
how-to's somewhere. Any help is appreciated. Thanks.

Jeff Boyce
Meridian Environmental
www.meridianenv.com

Search Discussions

  • Miguel Medalha at Jun 13, 2011 at 5:24 pm

    (...) I am hoping that someone here can give me some pointers, or point me to some clear
    how-to's somewhere. Any help is appreciated. Thanks
    Some good guides on virtualization and LVM reside here:

    https://access.redhat.com/knowledge/docs/Red_Hat_Enterprise_Linux/

    vmware also has some very useful documentation:

    http://www.vmware.com/support/pubs/
  • Gordon Messmer at Jun 15, 2011 at 8:06 pm

    On 06/13/2011 02:00 PM, Jeff Boyce wrote:
    I am a novice system administrator and will soon be purchasing a new server
    to replacing an aging file server for my company. I am considering setting
    up the new server as a KVM host with two guests; one guest as the Samba file
    server and a second guest as a testing area. My old server was set up about
    7 years ago and has a 5 disk raid 5 configuration without LVM.
    My first piece of advice would be to avoid RAID5. The performance is
    terrible.
    I understand
    the benefits of using LVM and KVM in the right circumstances, but have never
    used either of them. I have spent a couple of days over the last week
    trying to understand how to setup a KVM host with guests, but there is an
    area that I still don't understand; that is the relationship between the
    underlying raid partitions, LVM, and allocating space to a host and guests.
    That should be pretty simple... During the installation of the host
    system, you'll partition your drives as you need them. I try to keep
    mine simple, for example:
    http://home.dragonsdawn.net/kickstart/centos5

    That configuration will put two partitions on each of two drives. Each
    drive gets a small partition which will be arranged in a RAID1 set; that
    RAID1 set is mounted at /boot. The other partition, which fills the
    rest of each disk, form another RAID1 set. That RAID1 set is an LVM
    physical volume. That PV forms a volume group named VolGroup. All of
    the host's filesystems and its swap are created on logical volumes
    inside that volume group.

    So on my "simple" setup, I have four partitions on two drives. Two
    partitions are used for /boot, and the other two are used for the
    physical volume. All filesystems other than /boot are on logical volumes.

    In that kickstart file, /var will fill all of the available space. On a
    KVM host, you'd want to set a fixed size for /var instead. That would
    leave you with some of your volume group unallocated when the
    installation is complete.

    When you set up your guests, you can start by allocating a new logical
    volume from your volume group. That LV will get a device file in
    /dev/mapper. When you set up your guest, you use that LV as the guest's
    disk. The guest will treat that LV as if it were a disk drive. The
    guess will create partitions on it (and possibly LVM of its own) and
    filesystems on top of those partitions or logical volumes just as if it
    were a physical machine with a disk drive.
    Many of the standard search term combinations in Google don't seem to be
    getting me anywhere. From what I have read so far I think that I want to
    have my file server guest using a raw partition rather than an image file,
    but I haven't found anything with examples or best-practices guidance for
    partitioning or volume management with hosts and guest VMs. So I am hoping
    that someone here can give me some pointers, or point me to some clear
    how-to's somewhere. Any help is appreciated. Thanks.
    That's probably true. image file backed guests are a whole lot slower
    than guests that run on partitions or logical volumes. Logical volumes
    are the easiest option to manage, with good performance characteristics.

    Hopefully that made sense. Ask questions if not.
  • Ljubomir Ljubojevic at Jun 15, 2011 at 8:52 pm

    Gordon Messmer wrote:
    That's probably true. image file backed guests are a whole lot slower
    than guests that run on partitions or logical volumes. Logical volumes
    are the easiest option to manage, with good performance characteristics.

    Hopefully that made sense. Ask questions if not.
    Drawback is that such KVM guest is not as easy to move to another host
    if current host can not boot. Copying image and config files will be
    much faster.

    Ljubomir
  • Gordon Messmer at Jun 16, 2011 at 2:56 am

    On 06/15/2011 05:52 PM, Ljubomir Ljubojevic wrote:
    Drawback is that such KVM guest is not as easy to move to another host
    if current host can not boot. Copying image and config files will be
    much faster.
    There is no reason that should be true. Copying 20GB out of an LV
    should take exactly the same amount of time as copying 20GB out of a file.
  • Les Mikesell at Jun 16, 2011 at 8:59 am

    On 6/16/11 1:56 AM, Gordon Messmer wrote:
    On 06/15/2011 05:52 PM, Ljubomir Ljubojevic wrote:
    Drawback is that such KVM guest is not as easy to move to another host
    if current host can not boot. Copying image and config files will be
    much faster.
    There is no reason that should be true. Copying 20GB out of an LV
    should take exactly the same amount of time as copying 20GB out of a file.
    What about the destination? Wouldn't it likely be harder to find a place to put
    the LV copy than space to write a file? Or can you copy back and forth?

    --
    Les Mikesell
    lesmikesell at gmail.com
  • Gordon Messmer at Jun 16, 2011 at 11:49 am

    On 06/16/2011 05:59 AM, Les Mikesell wrote:
    What about the destination? Wouldn't it likely be harder to find a place to put
    the LV copy than space to write a file? Or can you copy back and forth?
    Yes, you can copy the content of a partition to a file and use it that
    way, or the reverse.
  • Kwan Lowe at Jun 20, 2011 at 9:56 am

    On Thu, Jun 16, 2011 at 8:59 AM, Les Mikesell wrote:
    There is no reason that should be true. ?Copying 20GB out of an LV
    should take exactly the same amount of time as copying 20GB out of a file.
    What about the destination? ?Wouldn't it likely be harder to find a place to put
    the LV copy than space to write a file? ?Or can you copy back and forth?

    --
    I just copy the raw filesystem directly to the remote raw filesystem
    with dd over ssh. If needed you can dd the entire partition to a file
    also.

    With LVMs you can also mirror the LV across multiple LUNs, break the
    mirror, then move the other LUN to another system.
  • Ross Walker at Jun 21, 2011 at 9:47 am

    On Jun 20, 2011, at 9:56 AM, Kwan Lowe wrote:
    On Thu, Jun 16, 2011 at 8:59 AM, Les Mikesell wrote:

    There is no reason that should be true. Copying 20GB out of an LV
    should take exactly the same amount of time as copying 20GB out of a file.
    What about the destination? Wouldn't it likely be harder to find a place to put
    the LV copy than space to write a file? Or can you copy back and forth?

    --
    I just copy the raw filesystem directly to the remote raw filesystem
    with dd over ssh. If needed you can dd the entire partition to a file
    also.

    With LVMs you can also mirror the LV across multiple LUNs, break the
    mirror, then move the other LUN to another system.
    You might have better performance using Clonezilla over ssh then dd.

    -Ross

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos @
categoriescentos
postedJun 13, '11 at 5:00p
activeJun 21, '11 at 9:47a
posts9
users7
websitecentos.org
irc#centos

People

Translate

site design / logo © 2022 Grokbase