ESX offline disk resize prevents growing zpool
In at least some versions of VMware ESX, when growing a virtual disk, ESX helpfully copies the alternate EFI label to the end of the newly grown disk. Unfortunately, the current check in
efi_use_whole_disk then thinks because the alternate label is at the end of the disk, it has already been resized, and nothing else needs to be done.
This leads to the annoying condition where
zpool list will correctly determine that more space on the disk is available, but is unable to be used because
zpool online -e (or the zpool
autogrow setting) fails to work (as they call
efi_use_whole_disk() to adjust the partitioning on the disk).
A better approach in
efi_use_whole_disk() would be:
1. Verify the reserved partition is the last defined partition on the disk (largest ending LBA). If not, we give up.
1. If the reserved partition is not at the end of the disk, move it to the end of the disk. It only contains cached devids that get rewritten by the system, so it is not necessary to copy the contents.
2. If there is a gap of unused space between the last non-reserved partition and the reserved partition, expand the size of the last partition to span the gap.
Updated by Jason King 12 months ago
For testing, a disk in VMware was grown while the VM was offline.
Without this fix,
zpool online -e pool failed as noted in the ticket.
Booted into a BE with this fix,
zpool online -e pool worked as expected.
Additionally, the disk labels were examined for general sanity before/after.
Updated by Electric Monk 11 months ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 5db3bdb02df15d4dfa997350a76be8d382649289 Author: Jason King <firstname.lastname@example.org> Date: 2023-04-13T21:36:15.000Z 14577 ESX offline disk resize prevents growing zpool Reviewed by: Toomas Soome <email@example.com> Reviewed by: C Fraire <firstname.lastname@example.org> Reviewed by: Gergő Mihály Doma <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>