Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

Skip to main content

Products and Accounts

Support

Knowledge

Communities

Success

Learning

My Subscriptions

Loading

Knowledge Base

Renaming a virtual machine disk (VMDK) via the vSphere Management Assistant (vMA) or vSphere CLI (vCLI) (1002491)

Last Updated: 3/11/2015Categories: How toTotal Views: 280034Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

14 like this article

Subscribe to get an email
newsletter with new updates

14 people found this helpful Please provide article feedback:

Details

This articles provides steps for renaming an ESX/ESXi virtual disk using the vSphere Command Line Interface (vCLI) or the console interface on an ESX/ESXi host.

Note: The vCLI is available pre-installed within the vSphere Management Assistant. For more information, see the vSphere Management Assistant Documentation. and vSphere Command-Line Interface Documentation.

For more information on renaming a virtual machine and its files, see Renaming a virtual machine and its files in VMware ESXi and ESX (1029513).

Solution

A virtual disk above consists of two files:

Virtual disk descriptor. In the following example: examplevm.vmdk

Virtual disk extent. In the following example: examplevm-flat.vmdk

A virtual machine's files can be listed and manipulated using the vSphere Command-Line Interface or the console interface on an ESX/ESXi host. For example, the descriptor and extent files can be seen using the vCLI vifs command:

Prerequisites

Prior to renaming a virtual disk, you must meet these prerequisites:

The virtual disk must not be in use. Power down the virtual machine(s) utilizing the virtual disk.

The virtual disk must not currently be snapshotted. Remove the snapshots before proceeding. For more information, see Determining if a virtual machine is using snapshots (1004343).

Note: Always ensure you have a backup of all virtual machines. For additional information, see Backing up ESX Server virtual machines with ESX 2.x (1355).

Renaming a virtual disk using the vSphere Command-Line Interface

For documentation on using the vCLI or vMA, see the vSphere Command-Line Interface or vSphere Management Assistant documentation.

To rename the disk and its files using the vmkfstools command in the vMA or vCLI:

Verify the virtual machine referring to the virtual machine disk is powered off and does not have outstanding snapshots.

Remove the virtual disk from the virtual machine's configuration:

Locate the virtual machine in the inventory using the vSphere Client.

Right-click the virtual machine select Edit Settings.

Select the virtual disk in question and take note of virtual device node (eg, SCSI 0:1) and the name of the datastore and directory in the Disk File field at the top-right.

Click the Remove button to disconnect the virtual disk from the virtual machine.

Open a console session to the location the vCLI is installed. If using the vCLI from within the VMware Management Appliance, log in to the vMA.

Obtain a listing of the files within a directory using the vCLI command:

vifs.pl --server -D "[Datastore Name] VM_Directory Name"

Rename a virtual disk using a command similar to:

vmkfstools.pl --server -E "[Datastore Name] VM_Directory Name/examplevm.vmdk" "[Datastore Name] Directory Name/examplevm-renamed.vmdk"

Note: Specify the descriptor file; the associated extent file is renamed in the process.

Validate the files were renamed by listing the files within the directory using a command similar to:

vifs.pl --server -D "[Datastore Name] Directory Name"

Re-add the virtual machine disk to the virtual machine's configuration.

Using the vSphere Client, select the virtual machine and click Edit Settings.

Click the Add... button above the virtual hardware list.

Select Hard Disk and Use an existing virtual disk.

Select the datastore and disk that was renamed.

Confirm that the same SCSI controller type and Device Node noted in step 2c.

Click the OK button to complete the configuration change.

Renaming a virtual disk using the ESX/ESXi host console interface

To rename the disk and its files using the vmkfstools command in ESX/ESXi host's console interface:

Verify the virtual machine referring to the virtual machine disk is powered off and does not have outstanding snapshots.

Remove the virtual disk from the virtual machine's configuration:

Locate the virtual machine in the inventory using the vSphere Client.

Right-click the virtual machine select Edit Settings.

Select the virtual disk in question and take note of virtual device node (eg, SCSI 0:1) and the name of the datastore and directory in the Disk File field at the top-right.

Click the Remove button to disconnect the virtual disk from the virtual machine.

Open a console to the ESX or ESXi host. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807) or Using Tech Support Mode in ESXi 4.1 (1017910).

Navigate to the virtual machine's directory using a command similar to:

cd "/vmfs/volumes/Datastore Name/Directory Name/"

Obtain a listing of the files within a directory using the command:

ls -l

For example:

total 320
-rw------- 1 root root 8684 Aug 30 10:53 examplevm.nvram
-rw------- 1 root root 21474836480 Aug 30 10:26 examplevm-flat.vmdk
-rw------- 1 root root 482 Aug 30 11:26 examplevm.vmdk
-rw------- 1 root root 0 Aug 30 10:33 examplevm.vmsd
-rwxr-xr-x 1 root root 2724 Aug 30 12:20 examplevm.vmx
-rw------- 1 root root 264 Aug 30 12:20 examplevm.vmxf
-rw-r--r-- 1 root root 39168 Aug 30 10:53 vmware.log

Rename a virtual disk using a command similar to:

vmkfstools -E OldName.vmdk NewName.vmdk

For example:

vmkfstools -E examplevm.vmdk examplevm-renamed.vmdk

Note: Specify the descriptor file; the associated extent file is renamed in the process.

Validate the files were renamed by listing the files within the directory using the command:

ls -l

For example:

total 320
-rw------- 1 root root 8684 Aug 30 10:53 examplevm.nvram
-rw------- 1 root root 21474836480 Aug 30 10:26 examplevm-renamed-flat.vmdk
-rw------- 1 root root 482 Aug 30 11:26 examplevm-renamed.vmdk
-rw------- 1 root root 0 Aug 30 10:33 examplevm.vmsd
-rwxr-xr-x 1 root root 2724 Aug 30 12:20 examplevm.vmx
-rw------- 1 root root 264 Aug 30 12:20 examplevm.vmxf
-rw-r--r-- 1 root root 39168 Aug 30 10:53 vmware.log

Re-add the virtual machine disk to the virtual machine's configuration.

Using the vSphere Client, select the virtual machine and click Edit Settings.

Click the Add... button above the virtual hardware list.

Select Hard Disk and use an existing virtual disk.

Select the datastore and disk that was renamed.

Confirm that the same SCSI controller type and Device Node noted in step 2c.

Click OK to complete the configuration change.

Additional Information:

For translated versions of this article, see:

Portuguese Renomeando um disco de máquina virtual (VMDK) com o vSphere Management Assistant (vMA) ou vSphere CLI (vCLI) (2015946)

Spanish Cambiar le nombre a un disco de máquina virtual (VMDK) a través de vSphere Management Assistant (vMA) o vSphere CLI (vCLI) (2016361)

日本語: vSphere Management Assistant (vMA) または vSphere CLI (vCLI) での仮想マシン ディスクの名前変更 (2078471)

简体中文: 通过 vSphere Management Assistant (vMA) 或 vSphere CLI (vCLI) 重命名虚拟机磁盘 (VMDK) (2094957)

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

KB
•
Download and Install VMware Fusion (2014097)

Results 1-2 of 2

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware vSphere ESXi

VMware ESX Server

Related Versions:

VMware vSphere ESXi 7.0.0

VMware vSphere ESXi 6.7

VMware vSphere ESXi 6.5

VMware vSphere ESXi 6.0

VMware vSphere ESXi 5.5

VMware vSphere ESXi 5.1

VMware vSphere ESXi 5.0

VMware ESXi 4.1.x Installable

VMware ESXi 4.1.x Embedded

VMware ESXi 4.0.x Installable

VMware ESXi 4.0.x Embedded

VMware ESXi 3.5.x Installable

VMware ESXi 3.5.x Embedded

VMware ESX Server 3.5.x

VMware ESX Server 3.0.x

VMware ESX 4.1.x

VMware ESX 4.0.x

view all

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant