Backing up and moving VMs

If the VM is running you need to pull a snapshot and backup, otherwise the .vmdk may not be consistent.

Spaces in VM names for some backup tools, it is preferable to not have spaces in VM names (and hence the directories they are held in).

Basic backup (copy) of halted VM

If a VM is halted, the simply copy the folder containing the .vmx .nvram .vmxf .vmsd and .vmdk files some where. On ESXi with local data stores, you don't have direct access the datastores, but this copy can be done using the "browse datastore" menu item in VIC. You will need to find the .vmx file if you didn't keep it with the VM and likewise if there are .vmdk files on other data stores.

Doing a folder copy in the datastore browser (select folder and right click select "Copy", then find new datastore and do a right click "Paste") does faster than using right click "Move" on a .vmx file. About 10x faster...

If the VM is kept on an NFS datastore, this gets real easy --- just copy the directory around using the NFS server.

Once a VM client's directory has been moved, right click on its .vmx file and use "Add to Inventory...". This operation doesn't seem to result in any alteration to the client's config files --- which do not have things like full paths to to the clients files embedded, but do have things like MAC addresses and other network settings. So the copied client should be able to run, but will create a conflict if run along with the original version. Note that there is also a swap location for the VM specified in the .vmx. This might not be in the VM clients directory, and is specified by a full path. Hum swap file only exists while client is running (or paused?), maybe it magically gets created in the new directory when needed? UID At first startup in the GUI, VMware will ask if you want to keep or change the client's UID.

Export a virtual appliance

In VIC, select File -> Virtual Appliance -> Export. This saves the VM in a file on the VIC system. Note that this will not be allowed if an ISO is connected to the system (so that you don't make a copy of an ISO).

Backup ESXi Host Config

Backup the configuration of an ESXi host --- it's network, storage, settings etc. For this you need to use the RCLI. The tool is vicfg-cfgbackup.

ESXi Backup Scripts

ghettoVCB.sh http://communities.vmware.com/docs/DOC-8760

-- TomRockwell - 22 Jun 2009
Topic revision: r2 - 24 Jun 2009, TomRockwell
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback