While creating a VMFS datastore on a newly presented LUN, creation task fails with the following error on the vCenter GUI:
"Failed to create VMFS datastore <datastore_name>- Failed to update disk partitions for /vmfs/devices/disks/naa.###"
VMware vSphere ESXi 7.#
VMware vSphere ESXi 8.#
This error occurs if the newly presented LUN already has a partition on it.
To obtain a list of partitions defined on a block disk device use the command:
partedUtil getptbl "/vmfs/devices/disks/DeviceName"
partedUtil getptbl /vmfs/devices/disks/naa.<ID>
You see output similar to:gpt
32635 255 63 524288000
1 2048 524287966 AA############################B8 vmfs 0
Confirm if the LUN is supposed to be a raw LUN with no data on it.
To resolve this issue we need to erase the existing partition on the LUN. There are three options:
Erase the partition on the LUN from vCenter GUI. Reference KB: Clear a Device Partition Table in the VMware Host Client
Delete the existing partition using partedUtil command:
To obtain a list of partitions on the LUN:
partedUtil getptbl "/vmfs/devices/disks/DeviceName"
To delete the partition, run this command:
partedUtil delete "/vmfs/devices/disks/DeviceName" PartitionNumber
Reference KB: Using partedUtil command line disk partitioning utility on ESXi
Erase the partition from the storage end:
Un-present the LUN from the esxi host.
Format the LUN from the storage end to clear the existing partition.
Validate there is no partition on the LUN using command:
partedUtil getptbl "/vmfs/devices/disks/DeviceName"
partedUtil getptbl /vmfs/devices/disks/naa.<ID>
You see output similar to:unknown
13054 255 63 209715200
You should now be able to create the VMFS datastore without issues.