Rename vmdk file


The vSphere Client (including vSphere latest client as of today) does not allow renaming of VMDK’s using the GUI.

using the GUI.

1. Veeam FastSCP or Veeam Backup

2. Storage vMotion

3. Cold Storage vMotion

I find copy and renaming vmdk file and creating new vm (attached renamed vmdk) from vClient is hassle free and clean. Ofcourse, you no need to do this manually if your organization can afford to buy VMware additional/commercial tools that come with additional costs (eg. vCeneter, vMotion)

Now here are the steps to copy and rename vmdk file using VMware native tools: vmkfstools.

1. shutdown the target (source) VM

2. copy VMDK file


3. Rename VMDK file using vmkfstools
Enable SSH from ESX console screen or from vClient

From Console:
Press <F2>, Troubleshooting -> Mode option ->Enable SSH

From vClent:
Go to Security profile -> Services -> Properties..

Use SSH client (eg. Putty) to login. (eg. Usernam:. root / Password: yourESXhostPassword)

Navigate to your target datastore (location of copied .vmdk file as step 2)


Run following command to rename copied vmdk file:

# vmkfstools -E orignial.vmdk new.vmdk

4. Create a new VM and add the renamed .VMDK file

Note: we also can copy (cp) the .vmx (virtual machine configuration file) and edit (vi) to make it work. But I prefer to create a new one as it is cleaner.

5. When done; power on the VM.

Notes:

  1. If you prefer; you can copy vmdk file using vmkfstools as well. To clone a virtual disk to a new virtual disk, run this command:# vmkfstools -i “originalname.vmdk” “newname.vmdk”

    This leaves the original virtual disk untouched. You need enough space available to clone the virtual disk in the destination directory.

  2. You need not rename the originalname-flat.vmdk file after running the vmkfstools command. The vmkfstools command renames both VMDK files and updates the reference within the descriptor.
  3. Do not use the cp or mv commands to rename virtual disk files. Instead, use VMware utilities such as vmkfstools.
Advertisements

About Robiul

Robiul has 15 years of continuous successful career experience in ICT with extensive background in System Engineering, IT infrastructure design, operations and service delivery, managing IT projects / MIS functions for local and multi-national companies with in-depth knowledge of multiple operating systems as well as construct / manage small to medium size Data Center. Proven ability to design and implement medium to semi-large scale LAN/WAN/WLAN and system infrastructures. Academic qualification: Master of Science in Information Systems. Professional certifications are: MCSE, CCNA, ITIL and FoundStone Security Professional, VCP, NetAPP, CISSP etc.
This entry was posted in VMWare and tagged . Bookmark the permalink.