Restore VM
Use the restore vm command to restore a virtual machine that was previously backed up.
Restore VM for VMware virtual machines
The Restore VM command can be used to restore VMware virtual machines or VMware virtual machine templates.
If you have the backup-archive client installed on a separate system that is configured as a vStorage backup server, you can restore full virtual machine backups to the ESX or ESXi server that they came from, or to a different server. To restore a full virtual machine backup to a different server, use the -host option. The backup-archive client copies the data from the Tivoli® Storage Manager server over either the LAN or SAN. The client then writes the data directly to the ESX server, by using the transport method that is specified in the client options file.
Restoring a full virtual machine backup creates a new virtual machine; the configuration information and content of the new machine is identical to what it was when the backup occurred. All virtual machine disks are restored to the specified point-in-time, as virtual disks in the newly created virtual machine.
When you restore a specific disk, by using the :vmdk= syntax, an existing virtual machine is updated with the specified virtual disk data. Only the specified disks are restored to the existing virtual machine; other disks in the virtual machine are not altered. The existing virtual machine that you are restoring the disk to must be powered off before you initiate the restore operation.
To create a new virtual machine, specify the -vmname parameter and provide a name for the new virtual machine. The -vmname parameter creates a new virtual machine with a configuration that is identical to what it was when the backup occurred. If you also specify the :vmdk= syntax, data is restored to any disks that are included in the :vmdk= parameters; disks that are not included are restored, but only as unformatted disks that do not contain data.
Virtual machines are restored to their original vApp, resource pool, cluster, or folder if the containers exist. During a restore operation, if the destination target (a vCenter or ESXi host) does not have the required containers, the virtual machine is restored to the top-level default location on the target ESXi host. If you use the command-line client to restore a virtual machine, and if the virtual machine cannot be restored to its original inventory location, an informational message (ANS2091I) is displayed. If you use the Java™ GUI to restore a virtual machine, and if the virtual machine cannot be restored to its original inventory location, the informational message is not displayed, but the virtual machine is still restored to the top-level default location.
Full virtual machine backups that were previously created by using VMware Consolidated Backup (VCB) can still be restored by using the original VCB restore steps. To restore full virtual machine backups that were created by VCB, see Restoring full VM backups that were created with VMware Consolidated Backup. If you use VCB to restore a virtual machine, use the VMware converter program on the client to move the restored files to a running state on a VMware server. If the backup-archive client is running in a virtual machine, and if you performed a file-level backup of the virtual machine’s files, you can restore the backed-up files to the virtual machine by using the command-line interface or the Java GUI.
Supported Clients
This command is valid on supported Linux clients that are installed on a vStorage backup server for a VMware virtual machine.
This command is valid on supported Windows clients that are installed on a vStorage backup server for a VMware virtual machine.
Syntax
.-----------------------. V .-:vmdk=all-vmdk----. | >>-REStore VM--sourcevmspec----+-------------------+-+----------> +-:vmdk=cnfg--------+ +-:vmdk=disk label--+ '-:-vmdk=disk label-' >--+------------------------------+--+------------+-------------> +- -- -VMNAme="newVMname"------+ '- --options-' +- --DATACENTER="myDatacenter"-+ +- --HOST="myHost"-------------+ '- --DATASTORE="myDatastore"---' >--+---------------------+------------------------------------->< '-destinationfilespec-'
Parameters
Any parameter that contains spaces must be enclosed in quotation marks (" ").- sourcevmspec
- Specifies the name of the virtual machine (or virtual machine template) that was backed up.
- VMNAme
- This parameter is not valid for restoring VMware virtual machines that were backed up using VCB.
- Specifies the new name for the virtual machine after it is restored (if you do not want to use the name that is specified by sourcevmspec). You cannot use wildcards in the virtual machine name.
- DATACENTER
- This parameter is not valid for restoring VMware virtual machines that were backed up using VCB.
- Specifies the name of the data center to restore the virtual machine to as it is defined in the
vSphere vCenter. If the data center is contained in a folder, you must specify the
-datacenter option when you restore the virtual machine and include the folder
structure of the data center in the data center name. For example, the following syntax is
valid:
-datacenter=folder_name/datacenter_name
When you restore a virtual machine by using the GUI, you must restore the virtual machine to a different location. If you restore to the original location, you cannot specify the folder name of the data center. Without a folder name to help locate the original data center, the restore operation fails.
- HOST
- This parameter is not valid for restoring VMware virtual machines that were backed up using VCB.
- Specifies the domain name of the ESX host server to restore to as it is defined in the vSphere vCenter.
- DATASTORE
- This parameter is not valid for restoring VMware virtual machines that were backed up using VCB.
- Specifies the VMware datastore to restore the virtual machine to. The datastore can be on a SAN, NAS, iSCSI device, or VMware virtual volume (vVol). You can specify only one datastore when you restore a virtual machine. If you do not specify a datastore parameter, the virtual machine's VMDK file is restored to the datastore it was on when the backup was created.
- destinationfilespec
- This parameter is for VMware VCB restores only. It specifies the location where VCB full virtual machine image files are restored. If this option is not specified the vmbackdir option is used.
- :vmdk=all-vmdk
- This parameter is not valid for restoring VMware virtual machines that were backed up using VCB.
- This option specifies that all virtual disks (*.vmdk files) are included when the virtual machine is restored. This is the default.
- :vmdk=cnfg
- This parameter is not valid for restoring VMware virtual machines that were backed up using VCB.
- This option specifies that the virtual machine configuration information is restored. The configuration information is always restored when a new virtual machine is created. However, by default the configuration is not restored when you update an existing virtual machine with selected virtual disks.
- Ordinarily, restoring configuration information to an existing virtual machine fails because the restored configuration information conflicts with the existing virtual machine configuration information. Use this option if the existing configuration file for a virtual machine on the ESX server has been deleted, and you want to use the backed up configuration to re-create it.
- :vmdk=disk label
- This parameter is not valid for restoring VMware virtual machines that were backed up using VCB.
- This option is used to specify the disk label of the virtual disks to include in the restore
operation. You specify this option only if you want to selectively restore data from specific
disks.Note: On the Restore VM command, the label names of the vmdk files that you want to include (:vmdk= parameter) in a Restore VM operation must be specified as the English-language label name, as it is displayed in the output of the Backup VM vmname -preview command. Examples of the English vmdk labels are "Hard Disk 1", "Hard Disk 2", and so on.
- :-vmdk=disk label
- This parameter is not valid for restoring VMware virtual machines that were backed up using VCB.
- This option is used to specify the disk label of one or more virtual disks to exclude from the
restore operation. Note: On the Restore VM command, the label names of the vmdk files that you want to exclude (:-vmdk= parameter) from a Restore VM operation must be specified as the English-language label name, as it is displayed in the output of the Backup VM vmname -preview command. Examples of the English vmdk labels are "Hard Disk 1", "Hard Disk 2", and so on.
Option | Where to use |
---|---|
datacenter | Command line or options file. This parameter is not valid for restoring VMware virtual machines that were backed up using VCB. |
datastore | Command line or options file. This parameter is not valid for restoring VMware virtual machines that were backed up using VCB. |
host | Command line or options file. This parameter is not valid for restoring VMware virtual machines that were backed up using VCB. |
inactive | Command line. |
pick | Command line. This parameter is not valid for restoring VMware virtual machines that were backed up using VCB. |
pitdate | Command line. This parameter is not valid for restoring VMware virtual machines that were backed up using VCB. |
pittime | Command line. This parameter is not valid for restoring VMware virtual machines that were backed up using VCB. |
vmautostartvm
This parameter is only valid when instantaccess is specified as the vmrestoretype value. |
Command line or client options file. |
vmbackdir | Command line or client options file. |
vmbackuptype | Command line or client options file. |
vmdiskprovision
This parameter is only valid when instantrestore is specified for the vmrestoretype value. |
Command line or client options file. |
vmiscsiserveraddress
This parameter is only valid when either instantaccess or instantrestore is specified for the vmrestoretype value. |
Command line or client options file. |
vmrestoretype | Command line. |
vmtempdatastore
This parameter is only valid when instantrestore is specified for the vmrestoretype value. |
Command line or client options file. |
vmvstortransport | Command line or client options file. This parameter is not valid for restoring VMware virtual machines that were backed up using VCB. |
Examples
- Task
- To perform an instant restore or instant access operation from the command line, see Scenarios for running full VM instant access and full VM instant restore from the backup-archive client command line.
- Task
- Restore the most recent backup version of myVM to its original name. Use the VMware management interface to delete
the original virtual machine, before you restore it using this syntax.
dsmc restore vm myvm
- Task
- Restore the most recent backup version of myvm to a new machine that is created with the name "Test Machine", and with the restore target for the data center, ESX host, and
datastore all specified on the command.
dsmc restore vm myvm -vmname="Test Machine" -datacenter="myDatacenter" -host="myHostName" -datastore="myDatastore"
- Task
- Restore the most recent backup version of myvm. Restore to a data center named mydatacenter.
The data center is within the vCenter; the relative path within the
vCenter is dirA/datacenters/.
dsmc restore vm myvm -vmname="Test Machine" -datacenter="dirA/datacenters/myDatacenter" -host="myHostName" -datastore="myDatastore"
- Task
- Restore a virtual machine template back to the same location and
name.
dsmc restore vm vmTemplateName
- Task
- Restore a virtual machine template to a new location.
dsmc restore vm vmTemplateName-vmname=newName -datastore=newDatastore -host=newHost -datacenter=newDatacenter
- Task
- Restore only Hard Disk 2 and Hard Disk 3 to the existing virtual
machine that is named vm1.
dsmc restore vm "vm1:vmdk=Hard Disk 2:vmdk=Hard Disk 3"
- Task
- Restore all disks to the existing virtual machine named vm1, but
do not restore the data from Hard Disk 4.
dsmc restore vm "vm1:-vmdk=Hard Disk 4"
- Task
- Restore only the data from hard Disk 1 to the existing virtual
machine vm1; do not update any configuration information. Note: When you restore an existing virtual machine, the default behavior is to not update the configuration information.
dsmc restore vm "vm1:vmdk=Hard Disk 1:-vmdk=cnfg"
- Task
- Restore all disks to the existing virtual machine named vm1.
dsmc restore vm "vm1:vmdk=all-vmdk"
This command updates all virtual disks on an existing virtual machine, named vm1. Note that this action is different from the action that is performed by dsmc restore vm vm1, which creates a new virtual machine named vm1 (vm1 must not exist in order for dsmc restore vm vm1 to succeed).
Restore VM for Microsoft Hyper-V virtual machines
Use the Restore VM command to restore Hyper-V guests. You can restore Hyper-V guests to a local disk, a SAN-attached disk, to a cluster shared volume, or to a remote file server share. Remote file server shares must be on a Windows Server 2012 (or newer) system.
If the virtual machine that you are restoring exists, the backup-archive client shuts it down and deletes all files that comprise the virtual machine. The client then restores it from the image that is stored on the Tivoli Storage Manager server. If the virtual machine is a member of a Windows Server 2012 cluster, the virtual machine is taken offline from the cluster, which stops the virtual machine, the files are deleted, and then the client restores it from the Tivoli Storage Manager backup.
Even though the client shuts down the virtual machine before it deletes it, manually shutting down the virtual machine before you run the Restore VM command is a good practice to follow, to bring any in-progress application activities to an orderly stop. Then, use the Restore VM command to restore the virtual machine such that its content and configuration is identical to what it was when it was backed up.
Supported Clients
This command is valid on supported Windows clients that are installed on a Hyper-V host system.
Syntax
>>-REStore VM-- --sourcevmspec----------------------------------> >--+------------------------------------------------+-----------> '- -vmname=--new_vm_name-- -- -targetpath=--path-' >--+----------------+------------------------------------------>< '-+------------+-' '- --options-'
Parameters
- sourcevmspec
- Required. Specifies the name of the virtual machine that was backed up. The virtual machine name is case-sensitive. You cannot use wildcards in the virtual machine name.
- -vmname=new_vm_name
- Optional. This parameter is only valid for restoring virtual machines that were backed up by using either mode=iffull or mode=ifincr. Specify a new name for the virtual machine. The name can contain 1-100 characters, and the following characters are not valid: \ / : ; , * ? " ’ < > |
- If this parameter is not specified, the virtual machine is restored and it has the same name it had when it was backed up. If you do specify a new name for a virtual machine, a target path is required.
- -targetpath=path
- This parameter is required if you specify a new virtual machine name (-vmname=). Use this parameter to restore the virtual machine to an alterative location. Specify the disk drive and path that you want to restore the virtual machine to.
Option | Where to use |
---|---|
inactive | Command line |
pick | Command line |
pitdate | Command line |
pittime | Command line |
replace | Command line, client options file, or client preferences editor. |
vmbackdir | Command line, client options file. |
vmbackuptype | Command line or client options file. To restore Hyper-V virtual machines, this must be set to vmbackuptype hypervfull |
Examples
- Task
- Restore the most recent backup version of a virtual machine named
VM1 to the drive and path it was in when it was backed up.
dsmc restore vm VM1
- Task
- Restore the most recent backup version of a virtual machine named
vm1 to the drive and path it was in when it was backed up. Replace
the existing virtual machine without prompting.
dsmc restore vm vm1 -replace=yes
- Task
- Restore the backed up virtual machine named VM1 to a new name
(vm2):
dsmc restore vm VM1 -VmName=vm2
- Task
- Restore the backed up virtual machine named vm1, and assign it
a new name (vm2). Issue a prompt before overwriting vm2, if that
virtual machine already exists.
dsmc restore vm vm1 -VmName=vm2 -replace=prompt
- Task
- Restore the virtual machine named vm1 to a specific drive and
path, without renaming the virtual machine:
dsmc restore vm vm1 -targetpath="E:\New Path"
- Task
- Restore the virtual machine named vm1, but rename it as vm2 and
restore it to a new path:
dsmc restore vm vm1 -VmName=vm2 -targetpath=F:\NewPath
- Task
- Use -pick and -inactive to show
active and inactive backups for a virtual machine that is named vm1.
You choose the backup to restore from a list:
dsmc restore vm vm1 -pick -inactive