Local vmfs datastore automatically created on the ESXi boot lun cannot be removed/deleted.
Deletion fails from both vSphere Client and Host Client, as well as from the ESXi command line.
#partedUtil getptbl /vmfs/devices/disks/naa.xxxxx123
Device: /vmfs/devices/disks/naa.xxxxx123
Partition table:
gpt
7287 255 63 936640512
1 64 204863 C12A7328F81F11D2BA4B00A0C93EC93B systemPartition 128
5 208896 8595455 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
6 8597504 16984063 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
7 16986112 268435455 4EB2EA3978554790A79EFAE495E21F8D vmfsl 0
8 268437504 936640471 AA31E02A400F11DB9590000C2911D1B8 vmfs 0
Usable sectors:
48 936640471
#partedUtil delete /vmfs/devices/disks/naa.xxxxx123 8
Error: Read-only file system during write on /dev/disks/naa.xxxxx123
Unable to delete partition 8 from device /vmfs/devices/disks/naa.xxxxx123
vmkernel log:
vmkwarning: cpu73:2100332)WARNING: Partition: 2124: naa.xxxxx123: in-use partition 7 modification is not supported
hostd.log:
Hostd[2099014]: [Originator@6876 sub=Partitionsvc opID=esxhost1 sid=xxxx user=root] Unable to setptbl on /vmfs/devices/disks/naa.xxxxx123
Hostd[2098996]: --> Status: 255
Hostd[2098996]: --> Output: gpt
Hostd[2098996]: --> 0 0 0 0
Hostd[2098996]: --> 1 64 204863 C12A7328F81F11D2BA4B00A0C93EC93B 128
Hostd[2098996]: --> 5 208896 8595455 EBD0A0A2B9E5443387C068B6B72699C7 0
Hostd[2098996]: --> 6 8597504 16984063 EBD0A0A2B9E5443387C068B6B72699C7 0
Hostd[2098996]: --> 7 16986112 268435455 4EB2EA3978554790A79EFAE495E21F8D 0
Hostd[2098996]: -->
Hostd[2098996]: --> Error: Error: Read-only file system during write on /dev/disks/naa.xxxxx123
Hostd[2098996]: --> SetPtableGpt: Unable to commit to disk
Hostd[2098996]: -->
Hostd[2099031]: [Originator@6876 sub=Hostsvc opID=esxhost1 sid=xxxx user=root] DeletePartition: Failed to update partition information : Fault cause: vim.fault.HostConfigFault
Hostd[2099031]: [Originator@6876 sub=Hostsvc.DatastoreSystem opID=esxhost1 sid=xxxx user=root] DestroyVmfsDatastore: can't delete partition 8 on lun naa.xxxxx123
Hostd[2099031]: [Originator@6876 sub=Hostsvc.DatastoreSystem opID=esxhost1 sid=xxxx user=root] RemoveDatastore: Failed to remove backend for datastore localdatastore1.
Hostd[2099031]: [Originator@6876 sub=Hostsvc.DatastoreSystem opID=esxhost1 sid=xxxx user=root] File descriptors in use:
ESXI 7.x
ESXi 8.x
Issue seen when using 4K HDD Device of format 4Kn SWE for boot lun.
Will be fixed in upcoming release of ESXi 8.0U3
For the case of removing the local datastore during a new install, the --novmfsondisk option can be passed to prevent the local VMFS partition from being created on the disk during a scripted install. Reference:
https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.esxi.install.doc/GUID-61A14EBB-5CF3-43EE-87EF-DB8EC6D83698.html
Device format type can be seen in
localcli_storage-core-device-capacity-list.txt
Device Physical Blocksize Logical Blocksize Logical Block Count Size Format Type
------------------------- ----------- ------------------ ----------------- --------------- ----------
naa.xxxxx123 4096 512 936640512 457344 MiB 4Kn SWE