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:
There are several caveats specific to moving or relocating virtual machine disk files:
scp
, cp
, or mv
for storage operations. Instead use the vmkfstools
utility, the Virtual Machine Importer tool from VMware.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:
These steps outline what should be done prior to performing an operation with virtual disks from VMware Workstation:
If you want to commit snapshots via the ESX service console, see Committing snapshots from within the Service Console (1006847).
vmware-cmd -l
command to list all full paths to the configuration (.vmx
) files of the virtual machines registered to this host./vmfs/volumes/********-********-****-**********
/VMtest/VMtest.vmx
<cfg>
for the rest of this article.vmware-cmd <cfg> stop
command to shut down the desired virtual machine.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/********-********-****-**********/VMtest_1.vmdk"
<cfg>
value. The full path of the source virtual disk will be identified by <src>
for the rest of the article.-#######.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).vmkfstools -i <src> <dst>
<dst>
is the destination where you would like the file to be copied.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.
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:
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.
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:
http://host_IP_address/folder
host_IP_address
is the IP or DNS name of the ESX host.ha-datacenter
link.disk.vmdk
, it would have a corresponding disk-flat.vmdk
file which must be copied or moved as well.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"
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:
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.