Using vcbMounter from the command line (1002978)
This article provides commands that can be used to backup and restore a virtual machine from the command line in VMware Infrastructure 3.
Note: For more information on usage and syntax for any of these commands, you can run the command from a prompt with no options passed to it. There are currently no manual pages available for these commands.
- Provides details of each virtual machine that is running on the ESX host (or VirtualCenter server, depending on which parameter you provide for the -h option).
- You need to use one of these parameters for the -a option in the vcbMounter command line.
- Takes a snapshot of the virtual machine specified, and by default, creates a folder with a catalog file and all of the virtual machine files (within the directory specified, must not exist already). Also by default it splits the virtual machines flat files into 2GB chunks.
Note: It is a good idea to check the snapshot manager and confirm that the snapshot was removed after vcbMounter is done. If a VCB_BACKUP or Consolidated Helper snapshot is left behind, you can delete it.
- Restores the virtual machine to either the ESX host or the VirtualCenter from which it was running.
You must use the information from the VirtualCenter server to restore using the vcbMounter command if the host is registered to a VirtualCenter server. For example, if the host is connected to a VirtualCenter server, even though you want to restore it to a specific host you will still need to provide the -h/-p for the VirtualCenter server. To determine if a host is connected to a VirtualCenter server, type service vmware-vpxa status. If this service is running then the ESX host has been added to a VirtualCenter server.
- VirtualCenter IP Address: 10.0.0.2
- Username for VirtualCenter: Administrator
- Password for VirtualCenter server: passw0rd
- Path to backup the virtual machine to: /vmfs/volumes/LUN-1/testVCB/testVCB
vcbVmName -h 10.0.0.2 -u Administrator -p passw0rd -s any:
- This command gives you the information needed to backup the virtual machine. You can pull more from it or the ipaddr if VMware Tools has been installed in the guest.
- Use grep to pull the virtual machine name from the list.
- This command provides the information for the VirtualCenter servers' username and password, uses the moref from the vcbVmName command used above, tells it to backup the fullvm, tells it which path to backup to, and logs the output information at the highest level possible.
- If you want to backup a virtual machine and use the network transport to connect directly to ESX host.
- If you want to backup a virtual machine from VCB proxy and use network transport and connect directly to ESX host
This command uses the information passed to it from the catalog file for the virtual machine from the vcbMounter directory that was created during the restore.
You can modify the catalog file to reflect an alternate location to restore the virtual machine (for example, if you created the virtual machine backup on an ESX host, but that host is now part of a VirtualCenter cluster, you can restore it to the cluster by modifying the catalog file).
You can use a plain text editor to modify the catalog file.
If you are restoring to a host that is part of a VirtualCenter cluster, you must restore to the VirtualCenter server by using the VirtualCenter server for the -h/-p options.
If you need to modify the catalog file prior to restoring the virtual machine, you can pass the VirtualCenter -h/-p to this and obtain the information that you will need to use to modify the catalog file.
You do not need to purchase additional licences for VCB to use this function.
You do not need to run these commands from a VCB Proxy Server.
You do not need a Windows host or alternate physical host to run these commands.
You do not need to install any additional software in the COS to use these commands.
You do not need to have backup software installed to use these functions.
You do need to run these commands from the console or from an SSH session on the ESX host.
If you have a VirtualCenter Server, use the VirtualCenter Server for the vcbMounter and vcbRestore -h/-p options, not the ESX host that the virtual machine is running on.