On Thu, 17 Nov 2011, Smithies, Russell wrote:
I came across an old post comment yesterday (from http://echenh.blogspot.com/2010/04/how-to-extend-lvm-on-vmware-guest-os.html ) discussing the "hack" of LVM on Linux VM guests and whether it's better not to use it to simplify disk management. I've re-posted the comment below, does it sound reasonable? Is it better to not use LVM on Linux VM guests?
--Russell
At my job, after doing the same kind of procedure graph, we began to ask ourselves, why are using a LVM on a Linux VM guests?
Since we're no longer living in the physical OS world, we didn't need to use the OS hacks(LVM) to overcome physical disk limitations anymore. We decided to Just let the hypervisor and virtual storage do that work for us.
For example, in our production setup (3 tier commerce with VMs for database , webserver, and appserver), we're see a great improvement in managability and performance (>10%) by just dropping LVM, and most partitions.
In your example, the resize process is 7 functional steps:
- Increase size of VMDK
- In VM OS, Create Partition (??)
- REBOOT (!!)
- PVCreate
- VGExtend
- LVExtend
- Resize2fs
Going to a LVM/partition-less setup reduces expansion to 3 steps and we don't need to take the VM OS offline!
- Increase size of VMDK
2- Inside the VM, OS, rescan the scsi drive with:'echo 1 >/sys/class/scsi_device//rescan; dmesg' (dmesg will check that you drive isize has grown) 3- Resize2fs.
Our current disk arrangement has 3 VM HD devices 0 - small device (100M) with a single BOOT partition 1 - entire device is / 2 - entire device is SWAP
Doing this has simplified resizing so much, I now let the junior admins and my manager expand drive space as needed.
It's also let's us really be spartan on space since expansion is so quick. Instead of increasing systems in 30-50GB chunks, we can do 10-15GB and let our rmonitoring system warn us when space gets tight.
One reason I choose to have separate filesystems which do use LVM instead of VMware disks is that I can use different mount options. For example my /tmp filesystems usually get noexec,nodev,nosuid .. with one root filesystem that contains everything, you can't use mount options as effectively. I also bind mount /var/tmp to /tmp for the same reason.
Barry