Rename VM and VMDK files on vSAN with single datastore constraint
search cancel

Rename VM and VMDK files on vSAN with single datastore constraint

book

Article ID: 444053

calendar_today

Updated On:

Products

VMware vSAN

Issue/Introduction

This article provides a procedure to rename a virtual machine (VM) and its associated files (.vmdk, .vmx, and folder) when the VM resides on a vSAN datastore and no secondary datastore is available to perform a standard Storage vMotion.

Environment

  • VMware vSAN 8.x

  • vSAN Cluster where hosts only have a single datastore (vSAN)

Resolution

Pre-requisites:

  • Before implementing this fix, ensure a valid file-level backup of the vCenter Server is available.

  • This method temporarily removes capacity devices from a vSAN host to create a local VMFS datastore. The data residing on these re-purposed devices would be rebuilt on the other available vSAN disks when resync is triggered, so ensure there is sufficient capacity before starting this procedure.

 

Procedure to rename VM and files:

  1. Select a host in the vSAN cluster where the VM resides.

  2. Place the host into Maintenance Mode using the Ensure Accessibility option. Run pre-check to validate that the host can be placed into maintenance mode.

  3. Navigate to vSAN Cluster > Configure > vSAN > Disk Management.

  4. Select the host and click View Disks.

  5. Harvest a capacity device to create a temporary VMFS datastore:

    • If Deduplication is DISABLED: Select a capacity device and click Remove Disk.

    • If Deduplication is ENABLED: The entire disk group must be deleted and recreated while omitting one capacity device.

  6. Create a temporary VMFS datastore:

    • Right-click the host and select Storage > New Datastore.

    • Select VMFS 6 and use the harvested device as the backing storage.

  7. Exit the host from Maintenance Mode.

  8. Trigger a vSAN resync to ensure data availability: vSAN Cluster > Monitor > vSAN > Resyncing Objects > Sync Now.

  9. Rename the VM in the vCenter inventory.

  10. Perform a Storage vMotion of the VM from the vSAN datastore to the temporary VMFS datastore.

    • This process renames the underlying files.

  11. Perform a Storage vMotion of the VM back to the vSAN datastore.

  12. Delete the temporary VMFS datastore.

  13. Add the capacity device back to the vSAN disk group via vSAN Disk Management.

 

Notes:

  • Before migrating the virtual machine back, clear out any existing folders with the same name from the vSAN datastore. If a duplicate directory is detected, the system will automatically append _1 to the new VM's folder name.