How to rename a VMDK file in ESX and ESXi
Ok, here’s another real world scenario worthy of a mention. Not really because it’s rocket science but more to get it into the search engines as a recent customer visit revealed they couldn’t find a step by step guide whilst trawling the web.
Here’s mine.
ESX 3.x and 4.x
- Ensure the virtual machine has been shut down gracefully and is powered off.
- Remove the hard disk from the virtual machine within the VMware Infrastructure client but DON’T delete the disk, just remove the entry.
- Using PuTTy, an iLO, RSA or something else with remote control access login to an ESX host that has access to to the data store where the virtual machine is located.
- Navigate to the virtual machine <DIR>.
- Use the ‘mv‘ command and rename the two VMDK files for example:
- mv win2k3-prn1.vmdk win2k3-print1.vmdk
- mv win2k3-prn1-flat.vmdk win2k3-print1-flat.vmdk
- Using VI (or a similar editor) open the win2k3-print1.vmdk file.
- You’ll notice a reference to the win2k3-prn1-flat.vmdk, this will need amending to reflect the new name.
- Save and close the file.
- Logout of the ESX host and return to your VMware Infrastructure Client.
- Add a hard disk to the virtual machine by browsing to the newly renamed file.
Well done, that was it.
Hey, what about ESXi?
The hidden service console will have to be used. WARNING, VMware will not support any activities undertaken using this console unless you have been directed to do so by them.
Review VMware’s KB Article for full and further information about this feature: KB 1003677.
- At the ESXi console press ALT + F1
- Type in the word ‘unsupported‘ and press ENTER, no text will be echoed when typing so don’t get it wrong.
- Provide the ‘root‘ password when prompted.
- Complete the tasks as directed above.
- Once complete, type in ‘clear‘ and press ENTER to hide all recent text display.
- Type in ‘exit‘ and press ENTER to logout.
- Press ALT + F2 to return the familiar ESXi console.
That’s all for now.