Fix VMware ESXi Cannot Expand VMFS Datastore – Step-by-Step Troubleshooting Guide
In a user's VMware production environment, ESXi storage inevitably encounters situations where expansion is needed. At this point, the RAID needs to be expanded at the storage underlying layer, and then the datastore needs to be expanded in the ESXi Host Client. Some users may encounter errors during expansion, as shown below:
The RAID has been expanded at the storage underlying layer, and the ESXi device list also shows that the storage capacity has increased. Still, it has not yet been allocated to the datastore for virtual machine use. At this time, an error occurs when expanding the datastore in the web interface: “Cannot expand VMFS datastore XXX - Cannot update disk partition for /vmfs/devices/disks/naa.xxxxxx ”As shown in the figure below:
Understanding the “Cannot Expand VMFS Datastore” Error
In VMware ESXi, a VMFS datastore stores virtual machine files. Sometimes, when you try to expand the datastore after adding new storage capacity, you may encounter the error:
“Cannot expand VMFS volume: capacity available for expansion is not enough.”
Common causes include:
-
Disk partitions are not updated after adding new LUNs.
-
Unrecognized free space due to partition alignment issues.
-
Storage device firmware incompatibility.
Solutions to fix VMFS datastore that can not expand
I. This error may be caused by a bug in the ESXi Host Client (ESXi's web portal). You can prioritize trying to expand in vCenter Server; the operation method is the same as in the ESXi Host Client.
II. Use the command line for the expansion operation
First, it is recommended to back up virtual machines in the datastore or migrate them to other hosts before the operation to avoid data loss!!!
The operation method is as follows:
1. Enable SSH service in ESXi (disabled by default, and it is recommended to keep it disabled normally)
2. Use an SSH tool such as MobaXterm, Putty, etc., connect and log in to ESXi with the root account.
3. Use the following command to view disk partitions. The naa number of the disk can be viewed by logging into the web interface and checking the device path (replace the naa number with the actual naa number in your environment)
partedUtil getptbl "/vmfs/devices/disks/naa.6c81f660ce9d9e0027582d5d2b3b3340"
The output is roughly as shown below (there may be errors in the output, just ignore them)
4. Use the following command to view the end sector of the VMFS datastore (replace the naa number with the actual naa number in your environment)
partedUtil getUsableSectors "/vmfs/devices/disks/naa.6c81f660ce9d9e0027582d5d2b3b3340"
From the command output, the end sector is 140582583985. Then use the following command to expand the capacity
partedUtil resize "/vmfs/devices/disks/naa.6c81f660ce9d9e0027582d5d2b3b3340" 1 2048 14058258398
“1 2048 14058258398” in the above command refers to “partition number, starting sector, ending sector” respectively. Please modify it according to the actual environment.
6. There may be an error after expansion, and continue to run the following command
vmkfstools --growfs "/vmfs/devices/disks/naa.6c81f660ce9d9e0027582d5d2b3b3340:1" "/vmfs/devices/disks/naa.6c81f660ce9d9e0027582d5d2b3b3340:1"
The “:1” refers to the partition number of the partition to be expanded, which can be viewed in the web or in the command output of the third step. For example, if my partition number is 1, it is “:1”, as shown in the figure below.
7. After completing the above operations, you can use the "df -h" command to check whether the storage expansion is complete, or return to the web page to view the storage capacity.
Best Practices to Prevent Expansion Errors
-
Always take a datastore backup before expansion.
-
Keep ESXi host firmware and storage array firmware updated.
-
Use the same block size across LUNs to avoid format conflicts.
Final note:
If you find that the storage still cannot be expanded after following these steps, here's another possible solution (I haven't encountered this myself, but other users online have reported it). This error might also occur if the newly added storage wasn't properly formatted or if there are residual data partitions that weren't cleaned up. In such cases, you may need to reset the partition table or reformat the data storage. Since this involves storage operations, it's strongly recommended to back up your virtual machine and data before performing any operations!!!
No comments:
Post a Comment
Thank you for your comments.