Linux operating systemsWindows operating systems

Restore VM

Use the restore vm command to restore a virtual machine that was previously backed up.

Windows operating systems
The Restore VM command can be used to restore both Microsoft Hyper-V virtual machines and VMware virtual machines. The information for each type of restore is presented in its own heading. If you are restoring a virtual machine that is part of a Microsoft Hyper-V setup, you do not need to read the Restore VM for VMware virtual machines text. If you are restoring a VMware virtual machine, you do not need to read the Restore VM for Microsoft Hyper-V virtual machines text.
Linux operating systemsWindows operating systems

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 virtual machine 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.

Windows operating systemsFull virtual machine backups that were previously created by using 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

Linux operating systemsThis command is valid on supported Linux clients that are installed on a vStorage backup server for a VMware virtual machine.

Windows operating systemsThis command is valid on supported Windows clients that are installed on a vStorage backup server for a VMware virtual machine.

Syntax

Read syntax diagramSkip visual syntax diagram
                             .-----------------------.   
                             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

Note: 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 data store to restore the virtual machine to. The data store can be on a SAN, NAS, or iSCSI device. You can specify only one data store when you restore a virtual machine. If you do not specify a datastore parameter, the virtual machine's vmdk file is restored to the data store it was on when the backup was created.
Windows operating systemsdestinationfilespec
Windows operating systemsThis parameter is only for VMware VCB restore operations. 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 only specify this option 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.
Table 1. Restore VM command: Related options when restoring VMware virtual machines
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.
Windows operating systemsvmautostartvm

This parameter is only valid when instantaccess is specified as the vmrestoretype value.

Windows operating systemsCommand line or client options file.
vmbackdir Command line or client options file.
vmbackuptype Command line or client options file.
Windows operating systemsvmdiskprovision

This parameter is only valid when instantrestore is specified for the vmrestoretype value.

Windows operating systemsCommand line or client options file.
Windows operating systemsvmiscsiserveraddress

This parameter is only valid when either instantaccess or instantrestore is specified for the vmrestoretype value.

Windows operating systemsCommand line or client options file.
Windows operating systemsvmrestoretype Windows operating systemsCommand line.
Windows operating systemsvmtempdatastore

This parameter is valid only when instantrestore is specified for the vmrestoretype value.

Windows operating systemsCommand 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

Windows operating systemsTask
Windows operating systemsTo 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).

Windows operating systems

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 off 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 off the virtual machine before it deletes it, manually shutting off 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

Read syntax diagramSkip visual syntax diagram
>>-REStore VM-- --sourcevmspec---------------------------------->

>--+------------------------------------------------+----------->
   '- -vmname=--new_vm_name-- -- -targetpath=--path-'   

>--+----------------+------------------------------------------><
   '-+------------+-'   
     '- --options-'     

Parameters

Note: Any parameter that contains spaces must be enclosed in quotation (" ") marks.
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 valid only 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 with the same name that it had when it was backed up. If you 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.
Table 2. Restore VM command: Related options when restoring Hyper-V virtual machines
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