Wednesday, 28 September 2011

An Easy Way to Rename a VMDK Using a GUI

*The vSphere Client (including vSphere 5 Client) does not allow renaming of VMDK's using the GUI

Using vSphere Client:
1) Edit Settings of the Virtual Machine to be affected, and remove the Hard Disk to be renamed, taking note of the SCSI (X:X) ID

Using the free to download Veeam FastSCP or a pre-existing installation of Veeam Backup:
2) Connect to a host with access to the datastore containing the VMDK
3) Browse to the folder containing the VMDK
4) Right-click the ...-flat.vmdk file and rename as desired, leaving the -flat.vmdk at the end


5) Right-click the disk descriptor ...vmdk file and rename as desired


6) Right-click the renamed disk descriptor ...vmdk file and edit, changing the entry beneath '# Extent description' to point to the renamed ...-flat.vmdk file, and close saving changes

# Extent description
RW 73400320 VMFS "Windows 2008 R2 Enterprise-flat.vmdk"

Using vSphere Client:
7) Re-add the VMDK back to the virtual machine as an existing disk

Note: Veeam FastSCP 3.0 is not officially supported on 64-bit systems, and if trying the above with Veeam FastSCP 3.0 on a 64-bit system, the following error will be thrown "Retrieving the COM class factory for component with CLSID ... failed due to the following error: 800700c1." Solution is to either use Veeam Backup or install Veeam FastSCP on a 32-bit system.

Other ways to rename VMDK

1) Shutdown the VM and migrate to a different datastore
*Update: many thanks to gb for the following comment - "Under vSphere 5 migrating to a new datastore no longer renames the vmdk or any other files for that matter. However, It does rename the target directory."

2) Using vSphere CLI:
vmkfstools --server -E '[Datastore Name] Directory Name/examplevm.vmdk' '[Datastore Name] Directory Name/examplevm-renamed.vmdk'

3) Using the ESX/ESXi host console interface:

vmkfstools -E examplevm.vmdk examplevm-renamed.vmdk

Comment

This may be one of my most pointless posts ever, seeing as it is relatively straightforward to rename a vmdk from command line. Posting along the lines of it always being useful to be aware of different ways to do certain tasks.

2 comments:

  1. Just to let you know: Under vSphere 5 migrating to a new datastore no longer renames the vmdk or any other files for that matter. However, It does rename the target directory.

    ReplyDelete
  2. gb, thank you for the comment - I will update my post. Cheers!

    ReplyDelete