Project

General

Profile

Actions

Bug #14577

closed

ESX offline disk resize prevents growing zpool

Added by Jason King almost 2 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

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.

Actions #1

Updated by Electric Monk almost 2 years ago

  • Gerrit CR set to 2136
Actions #2

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.

Actions #3

Updated by Jason King 11 months ago

This was also tested with an ESP (zpool create -B) equipped pool. The results were the same.

Actions #4

Updated by Electric Monk 11 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 5db3bdb02df15d4dfa997350a76be8d382649289

commit  5db3bdb02df15d4dfa997350a76be8d382649289
Author: Jason King <jason.brian.king@gmail.com>
Date:   2023-04-13T21:36:15.000Z

    14577 ESX offline disk resize prevents growing zpool
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
    Approved by: Dan McDonald <danmcd@mnx.io>

Actions

Also available in: Atom PDF