[mdlug] Linux VMs - virtual disk best practices

Michael ORourke mrorourke at earthlink.net
Wed Mar 20 23:54:32 EDT 2013


I'm curious what other admins do when provisioning VM's with Centos/Redhat 
or similar.
For instance, if you do a default Centos server install, it will typically 
create a volume group and logical volumes then format some filesystems on 
top of that.  Which would be configured on top of the VM's virtual disk.  I 
can see why that is a desireable practice with physical hardware, but when 
you get into the virtual world, the reasons start to break down.  For 
instance, you can resize the virtual disks through the hypervisor with 
minimal effort.  Sure, that doesn't automatically increase the filesystem 
size, especially when that disk is under LVM, but it can be done.  I did 
some Googling, and some admins say that using LVM is great because you can 
add space on-the-fly without rebooting the VM, while others say that you can 
increase the virtual disk size, then extend the disk partition table, then 
expand the filesystem.  Others say that a reboot is mandatory, while others 
say it is unnecessary, etc...  Yet another admin recommended using 3 virtual 
disks per Linux VM, 1 for boot, root, and swap.  So you could expand the 
virtual disks independent of one another.  But I guess if you are going to 
do that, why not just create a swap file on root, because it is all virtual 
anyways.  For example, the 3rd virtual disk is typically carved out of the 
same datastore as the other 2 (assuming a typical ESXi server install). 
Part of the problem is "right-sizing" the VM's in the first place.  If you 
provision too much disk initially, then that space may not be available for 
other VM's.  Or if you provision too little, then your VM can run out of 
disk space.  Which might be why I am asking this question in the first 
place.  ;-)
So I'm curious to hear from some other admins out there and what you have 
tried and what seems to work best.

-Mike



More information about the mdlug mailing list