Search the VMware Knowledge Base (KB)
View by Article ID
Moving or copying virtual disks in a VMware environment (900)
- 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.
Existing VMware products and featuresTo 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 caveatsThere 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
mvfor storage operations. Instead use the
vmkfstoolsutility, 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 filesTo 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.
- 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.
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 -lcommand to list all full paths to the configuration (
.vmx) files of the virtual machines registered to this host.
Note: The full path of the configuration file is identified by
<cfg>for the rest of this article.
- Run the
vmware-cmd <cfg> stopcommand 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.
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>
<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 ESXiUnlike ESX, ESXi does not have a service console. To copy files, use the
vifsutility that comes with the vSphere Command Line Interface. The
vifscommand 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
vifscommand 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 ESXiThe 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.
Copying virtual disk files using a web browser for ESX and ESXiESX 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:
host_IP_addressis the IP or DNS name of the ESX host.
- Enter the appropriate credentials when prompted.
- Click the
- 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.vmdkfile which must be copied or moved as well.
Copying virtual disk files to and from VMware Server or a VMware desktop productVMware 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 platformsMoving 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)
Additional InformationFor 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.
Request a Product Feature
To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.