Loading

×Sorry to interrupt
This page has an error. You might just need to refresh it.
[NoErrorObjectAvailable] Uncaught ReferenceError: addCTracking is not defined
Failing descriptor: {markup://c:KM_ArticleThemeLayout}

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

My Subscriptions

Loading

Knowledge Base

Moving or copying virtual disks in a VMware environment (900)

Last Updated: 3/14/2019Categories: How toTotal Views: 309590Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

50 like this article

Subscribe to get an email
newsletter with new updates

50 people found this helpful Please provide article feedback:

Details

In certain circumstances you may want to relocate specific virtual machine disk files from one location to another location. These circumstances may include, but are not limited to:

Moving a virtual machine disk from a platform using one VMware product to a different platform using another VMware product.

Troubleshooting issues involving high disk space usage.

Balancing disk space usage.

Cloning a virtual machine.

Backing up a virtual machine.

This article explores and describes different methods of relocating virtual machine files within your VMware Environment.

Solution

Existing VMware products and features

To support certain internal operations, ESX installations include a subset of standard Linux configuration commands, for example, network and storage configuration commands. Using these commands to perform configuration tasks can result in serious configuration conflicts and render some ESX functions unusable. Always work through the vSphere Client when configuring ESX unless otherwise instructed in vSphere documentation or by VMware Technical Support.

Prior to manually moving or copying virtual machine disk files, consider using existing VMware features which can accomplish similar desired results. These VMware features include:

Converting virtual machines with VMware Converter. For more information, see the VMware Converter Standalone Documentation.

Converting virtual machines with VMware vCenter Converter. For more information, see the VMware vCenter Converter Administration Guide under the applicable VMware product version.

Live Migrate, Cold Migrate, Clone, or Storage vMotion with VMware vCenter or VMware VirtualCenter. For more information, see the Migrating Virtual Machines section for the applicable VMware product version.

Backing up virtual machines with VMware Consolidated Backup. For more information, see the Virtual Machine Backup Guide for the applicable VMware product version.

Considerations and caveats

There are several caveats specific to moving or relocating virtual machine disk files:

Different versions of VMware products may have different implementations of a virtual disk file. For more information, see the Virtual Machine Disk Format (VMDK) page.

When using snapshots, a virtual machine's virtual disks can be comprised of multiple VMDK files which are part of an interdependent chain. For more information, see the Disk Chaining and Redo Logs section in the VDDK API documentation.

To prevent performance and data management related issues on ESX, avoid the use of scp, cp, or mv for storage operations. Instead use the vmkfstools utility, the Virtual Machine Importer tool from VMware. For more information on the usage of tools in the service console, see the Third-Party Software in the Service Console document.

Prior to copying virtual machine files

To avoid any potential issues involving snapshots and inconsistent disk chains, you must ensure that the virtual machine does not have any snapshots. Moving virtual machines with snapshots is outside of the scope of this article, and VMware strongly recommends using one of the alternate methods described above. Also, you must know exactly where the virtual disk file we want to move is located as well as ensure that the virtual machine is powered off.

These steps outline what to do prior to performing an operation with virtual disks from the vSphere/VI Client connected to either vCenter Server or ESX:

Connect to the ESX host using the vSphere/VI Client with administrator credentials.

Ensure that the virtual machine that uses the virtual disk file does not have any snapshots by right-clicking the virtual machine and clicking Snapshot > Snapshot Manager.

Make note of the datastore and location of the virtual disk files that you want to copy by right-clicking the virtual machine and clicking Edit Settings. Click on the virtual disk and refer to the Disk File portion of the Virtual Machine Properties.

Power off the virtual machine.

Note: If there is no virtual machines to receive the virtual disk files, you may want to create the virtual machine in advance to establish the destination of the move or copy operation.

These steps outline what should be done prior to performing an operation with virtual disks from VMware Workstation:

Open VMware Workstation, and click on the virtual machine which has the virtual disk you wish to conduct an operation on.

Click VM > Snapshot > Snapshot Manager, and remove any preexisting snapshots.

Click VM > Settings > Options Tab and make note of the Working Directory section on the bottom left of the Virtual Machine Settings window.

Click VM > Power > Shut Down Guest to power off the virtual machine.

Note: If there is no virtual machine to receive the virtual disk files, you may want to create the virtual machine in advance to establish the destination of the move or copy operation.

If you want to commit snapshots via the ESX service console, see Committing snapshots from within the Service Console (1006847).

Copying virtual disk files using the ESX service console

Log into the ESX host as root using either a remote console or SSH. For information on how to enable SSH, see Enabling root SSH login on an ESX host (8375637).

In the event that the virtual machine which is using the virtual disk is using snapshots, you must consolidate those snapshots prior to performing any storage operations.

Run the vmware-cmd -l command to list all full paths to the configuration (.vmx) files of the virtual machines registered to this host.

Example output:

/vmfs/volumes/478e0d5b-3535f6a8-0ee2-0017a446ae31/VMtest/VMtest.vmx

Note: The full path of the configuration file is identified by <cfg> for the rest of this article.

Run the vmware-cmd <cfg> stop command to shut down the desired virtual machine.

Run the grep -i vmdk <cfg> command to list all virtual disk files associated with the virtual machine.

Example output:

scsi0:0.fileName = "VMtest.vmdk"
scsi0:0.fileName = "/vmfs/volumes/478e0d5b-3535f6a8-0ee2-0017a446ae31/VMtest_1.vmdk"

Note: These entries may not include the full path to the directory. If a full path is not listed, refer to the full path of the <cfg> value. The full path of the source virtual disk will be identified by <src> for the rest of the article.

Warning: If the file name ends with -#######.vmdk, your virtual machine is still running off of a snapshot. If you find that these files are present, but you do not have any snapshots in the snapshot manager, see Committing snapshots when there are no snapshot entries in the snapshot manager (1002310).

Run the command:

vmkfstools -i <src> <dst>
Where <dst> is the destination where you would like the file to be copied.

For more information, see Cloning and converting virtual machine disks with vmkfstools (1028042)

Note: The syntax for older versions of ESX may vary. For ESX 2.5.x, see Examples of Using vmkfstools from the ESX 2.5.X documentation.

Copying virtual disk files using the vSphere Command Line Interface for ESX and ESXi

Unlike ESX, ESXi does not have a service console. To copy files, use the vifs utility that comes with the vSphere Command Line Interface. The vifs command performs common operations such as copy, remove, get (download), and put (upload) files. The command is supported against ESXi/ESX hosts but not against vCenter Server systems. Use the vifs command to perform the file operation on the virtual machine files. For information on syntax and usage examples, see the vSphere Command-Line Interface Installation and Reference Guide.

Copying virtual disk files using the vSphere/VI Client datastore browser for ESX and ESXi

The datastore browser allows you to manage the contents of datastores in the vSphere/VI Client inventory. You can use the datastore browser to do these tasks:

View or search the contents of a datastore.

Add a virtual machine or template stored on a datastore to the vSphere/VI Client inventory.

Copy or move files from one location to another, including to another datastore.

Upload a file from the client computer to a datastore.

Download a file from a datastore to the client computer.

Delete or rename files on a datastore.

The datastore browser operates in a manner similar to file system applications like Windows Explorer. It supports many common file system operations, including copying, cutting, and pasting files. The datastore browser does not support drag-and-drop operations. For detailed instructions on using the datastore browser, see the vSphere/VI Client online help.

Copying virtual disk files using a web browser for ESX and ESXi

ESX and ESXi servers have a built-in web service which allows you to access files via a web browser. Although this method of copying files is only one-way and does not allow you to upload files, it may be a good alternative in certain situations. To access these files:

Open a web browser.

Access this URL:

http://host_IP_address/folder

Where host_IP_address is the IP or DNS name of the ESX host.

Enter the appropriate credentials when prompted.

Click the ha-datacenter link.

Browse to and download the desired virtual disk file.

Note: When using the browser to move and copy virtual disk files in ESX, you must copy both the flat file and the descriptor file. For example, if a virtual machine disk is named disk.vmdk, it would have a corresponding disk-flat.vmdk file which must be copied or moved as well.

Copying virtual disk files to and from VMware Server or a VMware desktop product

VMware desktop products such as VMware Workstation and VMware ACE include the VMware Virtual Disk Manager utility. These are some usage examples of the VMware Virtual Disk Manager utility:

vmware-vdiskmanager -n mydisk.vmdk "..\another_path\myNewDisk.vmdk"

vmware-vdiskmanager -n mydisk.vmdk "..\another_path\mydisk.vmdk"

For more information on the Virtual Disk Manager utility, see the Virtual Disk Manager User's Guide.

Copying virtual disk files across the network to and from different platforms

Moving virtual disk files across a network can be accomplished in many ways and on many platforms. These options exist to transport files to different platforms:

FTP file transfer

SCP file transfer

NFS shares

Windows File Sharing (CIFS shares)

Steps on how to enable, configure, and transfer files using these specific methods are outside of the scope of this article. When transferring virtual disk files across the network, VMware recommends validating the information before and after the file transfer. This can be done by using MD5 checksums. For more information on the use of MD5 checksums, see Using MD5 Checksums.

Additional Information

For translated versions of this article, see:

Español: Mover o copiar discos virtuales en un entorno VMware (2016239)

Português: Movendo ou copiando discos virtuais em um ambiente VMware (2015855)

日本語: VMware 環境での仮想ディスクの移動またはコピー (2080689)

简体中文: 在VMware虚拟环境下移动或拷贝虚拟磁盘 (2020929)

Note: The links in this article were correct as of May 17, 2013. If you find a link is broken, provide feedback and a VMware employee will update the link.

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)

Result 1 of 1

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware Workstation

VMware Server

VMware Player

VMware GSX Server

VMware ESX Server

VMware ACE

Related Versions:

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