There might come a time that you might need to rename a vmdk. How would you go about doing this via the service console?
Scenario: You have vm01 located at /vmfs/volumes/VMFS01/vm01 and need to rename it to web01 and move it to /vmfs/volumes/VMFS01/web01
Steps
1. Power off vm01
2. Right-click vm01 in VIC and remove it from inventory
Note: you could also run
vmware-cmd -s unregister /vmfs/volumes/VMFS01/vm01/vm01.vmx
from the service console
3. SSH to your host, logging in with a non-root account
4. SU to root using, su -
5. Enter
mv /vmfs/volumes/VMFS01/vm01 /vmfs/volumes/VMFS01/web01
This will move your vmdk, vmx, vmsd, vmxf, and nvram files to the new directory
6. cd to /vmfs/volumes/VMFS01/web01
7. Enter
vmkfstools -E vm01.vmdk web01.vmdk
-E correctly renames the virutal disk, -renamevirtualdisk could also be used
This command renames the .vmdk, flat.vmdk, and updates the .vmdk pointer
8. Using vi, modify the .vmx and .vmxf, files to show the new VM name
9. Register the new virtual machine using the following command:
vmware-cmd -s register /vmfs/volumes/VMFS01/web01/web01.vmx
You should see register(/vmfs/volumes/VMFS01/web01/web01.vmx) = 1 if the command was correctly entered.
If you logon to VIC, you will now see the updated VM in your inventory.