[fedora-virt] Virtual Disk Setup
Daniel P. Berrange
berrange at redhat.com
Wed Jul 15 14:21:15 UTC 2009
On Wed, Jul 15, 2009 at 10:12:16AM -0400, Rich Mahn wrote:
> I am setting up several VMs using an F11 host. Most of the VMs will
> be F11 as well.
> >From earlier discussions on this list I recognize that the best
> performance for virtual disks is with the backing storage on the host
> being a parititon or LV. Since I want some flexibility I will use
> LVs, with virtio disks on most of the VMs.
> Here's my questions:
> 1. Each f11 VM needs three file systems--/boot, root, and swap
> (assuming you can call swap a file system). Is it better to create
> three LVs (each) on the hosts, and treat it as three separate disks
> on the VMs? Or is it better to just create one LV on the host and
> then divide up that virtual disk on the VM?
There's no point separating /boot & root onto separate virtual
disks. You could argue there's a possible advatnage in having
swap separate if you expect to use swap in the guest, and you
have separate disk spindles in the host you could dedicate to
the guest' swap disk. To be honest though this is niche benefit
THe only separation I'd do is for the OS system disks, vs application
data disks (or /home if you intended to store lots of data there).
this makes it easier to upgrade OS - eg provision a new OS with the
latest disto, and then just move your data disk to the new guest ,
and throw away the old guest.
> 2. Do I get better performance/stability by NOT using lvm on the VMs?
> In other words, just partition the virtio disk and create
> filesystems directly on the partitions? Or do the wonders of LVM
> and virtio already build in any advantage that might give?
LVM makes is easier to resize guest FS. eg add a second disk
to the guest, format it as a LVM PV and add it to your VG.
That's pretty much only wayto add more capacity on a running
> 3. Do I get the best performance/stability by creating an LV for each
> disk I need, and then NOT partitioning it on the VM, but using the
> whole disk for a file system. In other words, use vda, not vda1,
> vda2, etc for the filesystem. This would give the side effect
> being able to easily mount the filesystem on the host machine when
> the VM wasn't being run.
Anaconda will refuse to install onto a raw disk, it mandates
partitioning. Second point is that not using a partition table
can cause unexpected problems - eg vgscan in the host may
accidentally see & activate stuff from your guests' disks
with predictable goodbye-data results if your guest is active.
> 4. Lastly (for now) are these issues too miniscule in their effects
> that I probably shouldn't even be worrying about them?
That's certainly my opinion. Sure you get some performance
but you loose the great administrative flexibility of LVM.
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the Fedora-virt