RedHat, Storage and Operating as a VM
The organization I work for deploys RedHat primarily as virtualized instances. These instances are deployed primarily from standard templates. These templates, obviously, are created with specific sizes of virtual disk for the root drive and specific partition layouts.
Ocasionally, these RedHat-containing VMs are not properly sized for their ultimate use. Tools like VMware make this not too much of a problem: you can add additional virtual disks or up the size of existing virtual disks. Even better, you can do it "on-the-fly" (without having to restart the VM). RedHat handles on-the-fly adding and removing of disks decently well (a little more manual than is ideal, but still workable).
Unfortunately, I've not really found a good way for handling on-the-fly changes to the size of existing virtual disks. I can change the size of a disk all day and RedHat won't notice it. I can force RedHat to notice the geometry change if I use the `blockdev` command. Unfortunately, if there are active filesystems on the disk or active LVMs on the disk, `blockdev` errors out with a "Device Busy" message. If `blockdev` can't function, RedHat won't see the geometry change. If RedHat doesn't see the geometry change, I can't modify the disk's partition table to make the grown disk's storage available.
It would be nice to be able to resize a disk, on-the-fly, and have RedHat be able to see the new geometry. In the case of boot disks, it would save having to reboot the system. In the case of application data disks, it would (potentially) save having to take the application offline.
Am I missing some bit of magic in RHEL that would allow me to do things fully on-the-fly?
Responses
It's recommended to add additional disks and expand the VG and LV inside the guest to resize storage. RHEL6 KVM and RHEL5 Xen supports hot adding disks. So no need to reboot the guest.
Getting the guest recognize the geometry change after resizing the disk without rebooting the guest is tricky and may not work.
I'm just a Linux techie but our company has a network group which sets up RHEL5 on VMware. Recently, I was aksed if an existing RHEL5 server which lived on VMware can be moved via image to HyperV environment. I don't know VMware or HyperV, so I don't know if this move will cause any issues. I was told that apart from the video driver which seems to have re-jiggered itself somehow and now works, everything seems OK. I was a bit concerned about RHN registration and wondered if this may cause YUM to download the wrong patches to a now migrated HyperV environment? The network guy is adamant that the move by image works OK. Personally I'd have installed a clean OS on HyperV and move the apps and data across but was told that that's too slow. If anybody had tried this method of migrating an existing RHEL5 OS, I'd be interested to hear about their experiences of any problems etc. Thanks. Lina
Thomas,
This is a subject I've struggled with myself ever since we started deploying RHEL on VMware a year ago. I've yet to find a workable solution to extending the vmdk and having linux pick it up (without the need to umount, or reboot). For now, the only enterprise solution I have for my clients is to add more and more vmdk's when more storage is needed. I have no problem extending the lv and fs when needed in this way. Its rather embarrasing though because our Windows admins ARE able to extend the vmdk and Windows is able to extend on the fly with no reboots. Any advice here, or improvements on this subject would be great!