lvm on whole disk for online resizing supported ?
Hello all,
We use Redhat 6.5 VMs on Vmare Vsphere.
I put all my lvm on a whole disk ( pvcreate /dev/sdb for example)
With this kind of setup, i can resize my VMDK and the PV => VG => LV online, no need to add partition or reboot.
Is this setup supported by Redhat ? (LVM whole disk configuration)
Is a KB that prove that ?
Thank you
Responses
Hi Romain,
Supported features question of this kind are not only related to Red Hat, but also VMware. VMware stated in the past that only well aligned disk partitions were supported due to possible performance issues.
So you have to ask this question both via a Red Hat support case, and via VMware support. As community members we can say what we know, but support may have changed her policies due to know performance issues.
Kind regards,
Jan Gerrit Kootstra
Aside from the general ickiness of placing your LVM on an uninitilized/unpartitioned disk (clearly, you've never had someone come along and say, "oh, look: an unpartitioned disk. It must be available for use!" and clobber it), the general recommendations for LVM on VMware (in particular) is that you use aligned disks. You'd be better served doing something like:
parted -s /dev/sdb mklabel gpt mkpart primary ext4 2048s 100% set 1 lvm on
vgcreate VolumeGroupName /dev/sdb1
lvcreate -l 100%PVS -n VolumeName VolumeGroupName /dev/sdb1
mkfs -t FSTYPE /dev/VolumeGroupName/VolumeName
Depending on how many VMs you've got running and how hard you're pushing your storage, failure to properly align your VM-level storage-objects to the underlying storage-layers can prematurely degrade the performance of your storage subsystems.
And with respect to online resizing, whether you do it direct to the whole-dev or on a partition, you can do a no-reboot resize for any volume hosting unmountable filesystems.
For whatever reason, our security folks have deemed that the sg3_utils package is not to be installed on production hosts. Doesn't really matter, since all you really need to do is echo "- - -" > /sys/class/scsi_host/hostN/scan to get the same effects.
Unfortunately, we've found that simply rescanning the bus and/or trying to use fdisk hasn't been 100% reliable in getting the kernel to reload updated LUN size or disk-geometry information (likely more an issue in EL5 than EL6). We've generally found that blockdev is the more reliable method for forcing the kernel to update its disk-geometry information. Being a lower-level utility, blockdev requires the device-node to be offline so it can issue its ioctls (if your device node isn't offline, blockdev is nice enough to tell you that it can't update the device geometry - some tools simply fail silently).
fdisk also doesn't handle GPTs terribly well - which means it's frequently not usable against our larger chunks of storage, any way. Given the multi-vendor nature of our environment's storage (inclusive of host-level storage-management), the mix of physical and virtual hosting, mix of older and newer systems (read: we still have RHEL 5 floating around, thus, for the sake of consistency, a non-trivial number of our procedures are being held-over till the last EL5 system leaves our datacenters) and the realities of distributed teams of SAs of radically-varying skill-levels, we do things to help "safe" the environment (that means choosing "least common denominator" management options and blindingly-obvious labeling where possible).
Our environment is also highly-automated: we use lots of automated CM and tools like KickStart to build systems. fdisk doesn't lend itself as easily to automated provisioning and/or CM. If you're using KickStart, any where, getting used to parted means you're already well-prepared to author and maintain KickStart profiles that do dynamic storage layout well.
Not that partprobe was previously part of this thread, but since it was mentioned in that quote, it has deficiencies as well. We've found that partprobe is proven less reliable than tools like kpartx (and both are less reliable absent use of tools like blockdev). kpartx has generally proven to be more useful to us in our remaining physical hosts that leverage multipathing.
At any rate, we've generally deprecated fdisk in favor of parted. for reasons listed above,. Once you're already standardized on running parted, doing a parted -s /dev/sdX mklabel gpt mkpart primary ext4 2048s 100% set 1 lvm on on a properly-reread device ensures that the disk-structures are both properly-aligned (which, given how hard our virtualization environments push our storage, is kinda critical) and saves the hassles associated with trying to use fdisk to change your disk's partitioning-scheme. pvresize has not generally seemed to care whether it's reading an expanded /dev/sdb or an expanded /dev/sdb1.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
