Space Reclamation (UNMAP) shows as Disabled on virtual disk within Guest OS.
search cancel

Space Reclamation (UNMAP) shows as Disabled on virtual disk within Guest OS.

book

Article ID: 440810

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • A virtual machine experiences an issue where space reclamation (UNMAP) functions correctly on some virtual disks but appears as Disabled on a specific virtual disk within the Guest OS(Linux) as below:

[root@:~]# cat /sys/block/sdc/device/scsi_disk/*/provisioning_mode
disabled

  • All virtual disks are thin-provisioned, reside on the same VMFS datastore, and are attached to the same VMware Paravirtual SCSI (PVSCSI) controller.

  • VMFS space reclamation (UNMAP) is enabled at the vCenter Server level.

  • Running space reclamation commands (such as fstrim) inside the Guest OS(Linux) succeeds for some disks 

root@:/~# fstrim -av
/var/crash: 10 GiB (10726711296 bytes) trimmed on /dev/mapper/vg01-var -- crash
/tmp: 10 GiB (10724999168 bytes) trimmed on /dev/mapper/vg01-tmp
/var/log: 16.9 GiB (18119372800 bytes) trimmed on /dev/mapper/vg01-var -- log
/home: 27.8 GiB (29832904704 bytes) trimmed on /dev/mapper/vg01-home
/opt: 44.1 GiB (47335874560 bytes) trimmed on /dev/mapper/vg01-opt
/var: 27.7 GiB (29735895040 bytes) trimmed on /dev/mapper/vg01-var
/dynstorage: 98.9 GiB (106184331264 bytes) trimmed on /dev/mapper/vg01-########
/: 38 GiB (40757727232 bytes) trimmed

  • But fails for some disks with Error in guest OS: 

fstrim: /export: the discard operation is not supported
fstrim: /boot: the discard operation is not supported
fstrim: /####: the discard operation is not supported
fstrim: /########repo: the discard operation is not supported

Environment

VMware vSphere ESXi 8.0

Cause

The Guest OS kernel failed to dynamically refresh its block-layer properties after a runtime configuration change (such as a hot-extend or storage migration). As a result, it cached the disk as unsupported and missed the thin-provisioning and UNMAP capabilities being advertised by the ESXi hypervisor.

Resolution

To remediate the issue perform the rescan in guest OS and re-run the fstrim again.

If that does not work then follow: 

  1. Log in to the Guest OS and safely shut down the operating system.

  2. From the vCenter Server UI, verify that the VM state is completely Powered Off.

  3. Power On the Virtual machine.

    Note: A full power cycle forces the ESXi hypervisor to re-initialize the VM, presenting the correct thin-provisioning flags to the Guest OS upon boot.

  4. Log into the Guest OS and verify that the provisioning/reclamation mode for the affected disk is recognized as enabled.

  5. Execute the space reclamation command to confirm functionality.

Impact:
Downtime: This procedure requires a temporary outage for the affected virtual machine while it undergoes a power cycle.