This operation restores virtual server data obtained through a backup.
Request
Syntax
POST <webservice>/CreateTask HTTP/1.1 Host: <host name> Accept: application/xml Authtoken: <authentication token> Content-type: application/xml <create_task_template_restore.xml>
where <webservice> is the root path used to route the API requests to the Web Server.
For more information, see Available Web Services for REST API.
Request Header
Name |
Description |
---|---|
Host |
The host name of the Web Server or Web Console used in the API request. |
Accept |
The format of the response. Valid values are: application/xml or application/json. |
Authtoken |
The authentication token received after successfully logging on. For details on receiving an authentication token, see Authentication. |
Content-type |
The media type contained in the request body. |
Request Body
Download the create_task_template_restore.xml file required for this request. The following table displays the parameters for the create_task_template_restore.xml file.
Parameter |
Description |
Element |
Parent Element |
---|---|---|---|
policyType |
Valid value is DATA_PROTECTION. |
task |
taskInfo |
taskType |
The option to schedule the task or to run the task immediately. Valid values are:
Note If the taskType parameter equals SCHEDULE, a schedule pattern must be set. Review the parameters in the <pattern> element. |
task |
taskInfo |
initiatedFrom |
Valid values are:
|
task |
taskInfo |
disabled |
Valid value is True. |
taskFlags |
task |
applicationId |
The ID of the application. Valid values are:
|
associations |
taskInfo |
subclientId |
The system-generated ID assigned to the subclient. |
associations |
taskInfo |
backupsetId |
The system-generated ID assigned to the backup set. |
associations |
taskInfo |
instanceId |
The system-generated ID assigned to the instance. |
associations |
taskInfo |
commCellId |
The CommCell ID of the CommServe. |
associations |
taskInfo |
clientId |
The system-generated ID assigned to the client. |
client |
associations |
clientName |
The name of the client. |
client |
associations |
hostName |
The long name of the client, for example, client.domain.company.com. |
client |
associations |
subTaskName |
The name of the schedule if the taskType parameter equals SCHEDULE. |
subTask |
subTasks |
subTaskType |
The type of subtask. Valid value is 3 to perform a restore. |
subTask |
subTasks |
operationType |
The type of operation. Valid value is RESTORE. |
subTask |
subTasks |
restoreACLsType |
The option to restore files with Access Control Lists (ACLs).
|
restoreOptions |
options |
commCellId |
The CommCell ID of the CommServe. |
browseOption |
restoreOptions |
noImage |
The option to include deleted items in the browse. Valid values are 0/1. |
browseOption |
restoreOptions |
useExactIndex |
The option to use the index associated with a backup job performed at a specific time or the latest index. Valid values are 0/1. |
browseOption |
restoreOptions |
listMedia |
The option to list the media required to perform the restore operation. Valid values are 0/1. |
browseOption |
restoreOptions |
toTime |
The option to browse using time. This parameter can be used with the fromTime parameter or by itself:
|
browseOption |
restoreOptions |
fromTime |
The option to browse using time. This parameter can be used with the toTime parameter or by itself:
|
browseOption |
restoreOptions |
_type_ |
backupset |
browseOption |
|
commCellId |
The CommCell ID of the CommServe. |
backupset |
browseOption |
clientId |
The system-generated ID assigned to the client. |
backupset |
browseOption |
clientName |
The name of the client. |
backupset |
browseOption |
applicationId |
The ID of the application. Valid values are:
|
backupset |
browseOption |
appName |
The name of the application. Valid values are:
|
backupset |
browseOption |
instanceId |
The system-generated ID assigned to the instance. |
backupset |
browseOption |
instanceName |
The name of the instance, for example: VMware. |
backupset |
browseOption |
backupsetId |
The system-generated ID assigned to the backup set. |
backupset |
browseOption |
backupsetName |
The name of the backup set. |
backupset |
browseOption |
subclientId |
The system-generated ID assigned to the subclient. |
backupset |
browseOption |
subclientName |
The name of the subclient. |
backupset |
browseOption |
copyPrecedence |
The option to retrieve data from the storage policy copy. Valid values are 0/1. |
copyPrecedence |
mediaOption |
inPlace |
The option to restore backed up data to the same client from which it was backed up (in-place restore). Valid values are 0/1. |
destination |
restoreOptions |
isLegalHold |
Valid values are 0/1. |
destination |
restoreOptions |
val |
Use for out-of-place restores. The data is restored to this destination path. If the new path does not exist on the client, the restore operation creates it. |
destPath |
destination |
commCellName |
The name of the CommCell. |
destClient |
destination |
clientId |
The system-generated ID assigned to the client. |
destClient |
destination |
clientName |
The name of the client. |
destClient |
destination |
hostName |
The long name of the client, for example, client.domain.company.com. |
destClient |
destination |
volumeLeveRestore |
The option to perform a volume-level restore. Valid values are 0/1. |
volumeRstOption |
restoreOptions |
volumeLevelRestoreType |
Valid values are:
|
volumeRstOption |
restoreOptions |
isFileBrowse |
Indicates that folders and files are to be restored. Valid values are 0/1. |
virtualServerRstOption |
restoreOptions |
isDiskBrowse |
Indicates that a full virtual machine is to be restored or that a disk is to be attached to an existing virtual machine. Valid values are 0/1. |
virtualServerRstOption |
restoreOptions |
viewType |
virtualServerRstOption |
restoreOptions |
|
esxServerName |
The name of the ESX server. |
diskLevelVMRestoreOption |
virtualServerRstOption |
powerOnVmAfterRestore |
The option to start the virtual machine after it is restored. Valid values are 0/1. |
diskLevelVMRestoreOption |
virtualServerRstOption |
passUnconditionalOverride |
The option to overwrite an existing virtual machine of the same name. Valid values are 0/1. |
diskLevelVMRestoreOption |
virtualServerRstOption |
userName |
The user name you want to use for the restore operation. The user must have permission to create files in the specified location on the destination client. |
userPassword |
diskLevelVMRestoreOption |
password |
The password for the user in the userName parameter. |
userPassword |
diskLevelVMRestoreOption |
guid |
advancedRestoreOptions |
diskLevelVMRestoreOption |
|
name |
The name of the virtual machine. |
advancedRestoreOptions |
diskLevelVMRestoreOption |
newName |
The new name of the virtual machine. |
advancedRestoreOptions |
diskLevelVMRestoreOption |
esxHost |
For out-of-place restores: the name of the new ESX server. |
advancedRestoreOptions |
diskLevelVMRestoreOption |
Datastore |
For out-of-place restores: the name of the new datastore. |
advancedRestoreOptions |
diskLevelVMRestoreOption |
resourcePoolPath |
For out-of-place restores: the path to the destination host resource pool. |
advancedRestoreOptions |
diskLevelVMRestoreOption |
name |
disks |
advancedRestoreOptions |
|
Datastore |
disks |
advancedRestoreOptions |
|
userName |
userPassword |
virtualServerRstOption |
|
serverName |
fileLevelVMRestoreOption |
virtualServerRstOption |
|
vmGuid |
fileLevelVMRestoreOption |
virtualServerRstOption |
|
userName |
userPassword |
fileLevelVMRestoreOption |
|
password |
userPassword |
fileLevelVMRestoreOption |
|
userName |
guestUserPassword |
fileLevelVMRestoreOption |
|
password |
guestUserPassword |
fileLevelVMRestoreOption |
|
val |
sourceItem |
fileOption |
|
overwriteFiles |
The option to overwrite files during the restore operation. |
commonOptions |
restoreOptions |
detectRegularExpression |
The option to use regular expressions in defining source paths. Valid values are 0/1. |
commonOptions |
restoreOptions |
unconditionalOverwrite |
The option to overwrite data with the version of the data on the media even if the data on the media is older, as old, or newer than the corresponding data on the destination machine. Valid values are 0/1. |
commonOptions |
restoreOptions |
stripLevelType |
The option to strip or preserve source path levels. Valid values are:
|
commonOptions |
restoreOptions |
preserveLevel |
The number of levels from the end of the source path to preserve. |
commonOptions |
restoreOptions |
stripLevel |
The number of levels from the beginning of the source path to remove. |
commonOptions |
restoreOptions |
restoreACLs |
The option to restore the backed up Access Control Lists (ACLs). |
commonOptions |
restoreOptions |
isFromBrowseBackup |
Valid values are 0/1. |
commonOptions |
restoreOptions |
clusterDBBackedup |
The option to indicate that the backup is for a clustered environment. Valid values are 0/1. |
commonOptions |
restoreOptions |
invokeLevel |
updateOption |
adminOpts |
|
active_end_date |
The end date of the schedule. |
pattern |
subTasks |
active_end_occurence |
The number of times you want to repeat the schedule. |
pattern |
subTasks |
active_end_time |
The end time of the schedule. |
pattern |
subTasks |
active_start_date |
The start date of the schedule. |
pattern |
subTasks |
active_start_time |
The start time of the schedule. |
pattern |
subTasks |
description |
The description of the schedule pattern, for example, Every year on day 10 of January at 12:00 AM starting December 16, 2013 and repeats every 0 hr(s) 0 min(s) until 12:00 AM. |
pattern |
subTasks |
flags |
pattern |
subTasks |
|
freq_interval |
The meaning of this parameter changes based on the value of the freq_type parameter:
|
pattern |
subTasks |
freq_recurrence_factor |
The meaning of this parameter changes based on the value of the freq_type parameter:
|
pattern |
subTasks |
freq_relative_interval |
The meaning of this parameter changes based on the value of the freq_type parameter:
|
pattern |
subTasks |
freq_restart_interval |
pattern |
subTasks |
|
freq_subday_interval |
The time interval to repeat the schedule. |
pattern |
subTasks |
freq_type |
Indicates how often the schedule is run. Valid values are:
|
pattern |
subTasks |
name |
pattern |
subTasks |
|
patternId |
The system-generated ID assigned to the schedule pattern. |
pattern |
subTasks |
calendarId |
The code for the calendar. |
calendar |
pattern |
calendarName |
The name of the calendar, for example, Standard. |
calendar |
pattern |
Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday |
The days of the week defined for a weekly schedule. Valid values are True/False. |
daysToRun |
pattern |
day |
The day of the week defined for a monthly schedule. Use this parameter with the week parameter. Valid values are:
|
daysToRun |
pattern |
week |
The week defined for a monthly schedule. Use this parameter with the day parameter. Valid values are:
|
daysToRun |
pattern |
onDayNumber |
The specific day of the month defined for a monthly schedule. Valid values are 1 through 31. |
daysToRun |
pattern |
exception |
The option to set an exception for a repeating schedule. Multiple exceptions can be added for the repeating schedule:
Use the occurrence and the onDay or the onDayNumber parameters to define the exception. Valid values are True/False. |
repeatPattern |
pattern |
occurrence |
The ordinal numbers indicating when the exception to a repeating schedule occurs. Use this parameter with the onDay parameter or the onDayNumber parameter. Valid values are:
|
repeatPattern |
pattern |
onDay |
The day of the week indicating when the exception to a repeating schedule occurs. Use this parameter with the occurrence parameter. Valid values are:
|
repeatPattern |
pattern |
onDayNumber |
The days of the month indicating when the exception to a repeating schedule occurs. Use this parameter with the occurrence parameter. Valid values are the sum of the bit form values assigned to the days of the month. The bit form values are calculated as follows:
|
repeatPattern |
pattern |
TimeZoneName |
If the taskType parameter equals SCHEDULE, a schedule pattern must be set. The name of the time zone. For a list of valid values, see Time Zone IDs and Names. Sample values:
|
TimeZone |
pattern |
TimeZoneId |
The ID of the time zone to associate with the schedule. For a list of valid values, see Time Zone IDs and Names. |
TimeZone |
pattern |
skipInvalidMimeClassification |
Out of place restore for infected files based on file type anomaly classification:
|
||
allowInfectedFilesRestore |
Out of place restore for infected files based on threat analysis anomaly classification:
|
Response
Response Parameters
Parameter |
Description |
Element |
---|---|---|
taskId |
The system-generated ID assigned to the task. |
TMMsg_CreateTaskResp |
val |
The system-generated ID assigned to the job. |
jobIds |
Examples
Sample Request
This request restores virtual machine guest files and folders.
POST <webservice>/CreateTask HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc6
0f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f
8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f
40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef7
68fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f323
3d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8
Content-type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<TMMsg_CreateTaskReq>
<taskInfo>
<task policyType="0" taskType="IMMEDIATE" initiatedFrom="COMMANDLINE">
<taskFlags disabled="0"/>
</task>
<associations applicationId="106" subclientId="1234" backupsetId="539" instanceId="152" commCellId="0">
<client clientId="4787" clientName="DOCTESTLAB.testlab.commvault.com" hostName="DOCTESTLAB.testlab.commvault.com"/>
</associations>
<subTasks>
<subTask subTaskName="" subTaskType="3" operationType="RESTORE"/>
<options>
<restoreOptions restoreACLsType="ACL_DATA">
<browseOption commCellId="2" noImage="1" useExactIndex="0" listMedia="0" toTime="0" fromTime="0">
<backupset _type_="7" commCellId="0" clientId="4787" clientName="DOCTESTLAB.testlab.commvault.com" applicationId="106" appName="Virtual Server" instanceId="152" instanceName="VMware" backupsetId="539" backupsetName="defaultBackupSet" subclientId="1234" subclientName="subclient_001"/>
<mediaOption>
<copyPrecedence copyPrecedence="0"/>
</mediaOption>
</browseOption>
<destination inPlace="0" isLegalHold="0">
<destPath val="E:\test1"/>
<destClient commCellName="TEST4" clientId="2" clientName="client005" hostName="client005"/>
</destination>
<volumeRstOption volumeLeveRestore="0"/>
<virtualServerRstOption isFileBrowse="1" viewType="0">
<diskLevelVMRestoreOption/>
<userPassword userName="root"/>
<fileLevelVMRestoreOption serverName="DOCTESTLAB.testlab.commvault.com" vmGuid="5039744f-6bc9-f5b5-6f48-16testdf4d1e">
<userPassword userName="root" password=""/>
<guestUserPassword userName="test\administrator" password="test_pass_1"/>
</fileLevelVMRestoreOption>
</virtualServerRstOption>
<fileOption>
<sourceItem val="\5039fb6c-9190-1642-f42b-bctest21f01b\C\Program Files\Internet Explorer"/>
</fileOption>
<commonOptions overwriteFiles="1" detectRegularExpression="1" unconditionalOverwrite="1" stripLevelType="PRESERVE_LEVEL" preserveLevel="1" stripLevel="0" restoreACLs="1" isFromBrowseBackup="1" clusterDBBackedup="0"/>
</restoreOptions>
<adminOpts>
<updateOption invokeLevel="0"/>
</adminOpts>
</options>
</subTasks>
</taskInfo>
</TMMsg_CreateTaskReq>
This request restores a full virtual machine.
POST <webservice>/CreateTask HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc6
0f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f
8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f
40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef7
68fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f323
3d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8
Content-type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<TMMsg_CreateTaskReq>
<taskInfo>
<task policyType="0" taskType="IMMEDIATE" initiatedFrom="COMMANDLINE">
<taskFlags disabled="0"/>
</task>
<associations applicationId="106" subclientId="1234" backupsetId="539" instanceId="152" commCellId="0">
<client clientId="4787" clientName="DOCTESTLAB.testlab.commvault.com" hostName="DOCTESTLAB.testlab.commvault.com"/>
</associations>
<subTasks>
<subTask subTaskName="" subTaskType="3" operationType="RESTORE"/>
<options>
<restoreOptions restoreACLsType="ACL_DATA">
<browseOption commCellId="2" noImage="1" useExactIndex="0" listMedia="0" toTime="0" fromTime="0">
<backupset _type_="7" commCellId="0" clientId="4787" clientName="DOCTESTLAB.testlab.commvault.com" applicationId="106" appName="Virtual Server" instanceId="152" instanceName="VMware" backupsetId="539" backupsetName="defaultBackupSet" subclientId="1234" subclientName="subclient_001"/>
<mediaOption>
<copyPrecedence copyPrecedence="0"/>
</mediaOption>
</browseOption>
<destination inPlace="0" isLegalHold="0">
<destClient commCellName="TEST4" clientId="2" clientName="client_004" hostName="client_004"/>
</destination>
<volumeRstOption volumeLeveRestore="0" volumeLevelRestoreType="VIRTUAL_MACHINE"/>
<virtualServerRstOption isDiskBrowse="1" viewType="0">
<diskLevelVMRestoreOption esxServerName="" powerOnVmAfterRestore="1" passUnconditionalOverride="1">
<advancedRestoreOptions guid="50397c40-d581-4d6c-da8b-e2testf74e28" name="localds5vm3" newName="localds5vm3FullVM" esxHost="111.11.111.11" Datastore="localds5" resourcePoolPath="/">
<disks name="scsi0-0-localds5vm3_2.vmdk" Datastore="localds5"/>
<disks name="scsi0-1-localds5vm3_1.vmdk" Datastore="localds5"/>
</advancedRestoreOptions>
</diskLevelVMRestoreOption>
<userPassword userName="root"/>
</virtualServerRstOption>
<fileOption>
<sourceItem val="\50397c40-d581-4d6c-da8b-e2testf74e28"/>
</fileOption>
<commonOptions overwriteFiles="1" detectRegularExpression="1" unconditionalOverwrite="1" stripLevelType="PRESERVE_LEVEL" preserveLevel="1" stripLevel="0" restoreACLs="1" isFromBrowseBackup="1" clusterDBBackedup="0"/>
</restoreOptions>
<adminOpts>
<updateOption invokeLevel="0"/>
</adminOpts>
</options>
</subTasks>
</taskInfo>
</TMMsg_CreateTaskReq>
This request attaches a disk to an existing virtual machine.
POST <webservice>/CreateTask HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc6
0f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f
8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f
40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef7
68fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f323
3d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8
Content-type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<TMMsg_CreateTaskReq>
<taskInfo>
<task policyType="0" taskType="IMMEDIATE" initiatedFrom="COMMANDLINE">
<taskFlags disabled="0"/>
</task>
<associations applicationId="106" subclientId="1234" backupsetId="539" instanceId="152" commCellId="0">
<client clientId="4787" clientName="DOCTESTLAB.testlab.commvault.com" hostName="DOCTESTLAB.testlab.commvault.com"/>
</associations>
<subTasks>
<subTask subTaskName="" subTaskType="3" operationType="RESTORE"/>
<options>
<restoreOptions restoreACLsType="ACL_DATA">
<browseOption commCellId="2" noImage="1" useExactIndex="0" listMedia="0" toTime="0" fromTime="0">
<backupset _type_="7" commCellId="0" clientId="4787" clientName="DOCTESTLAB.testlab.commvault.com" applicationId="106" appName="Virtual Server" instanceId="152" instanceName="VMware" backupsetId="539" backupsetName="defaultBackupSet" subclientId="1234" subclientName="subclient_001"/>
<mediaOption>
<copyPrecedence copyPrecedence="0"/>
</mediaOption>
</browseOption>
<destination inPlace="0" isLegalHold="0">
<destClient commCellName="client_4" clientId="2" clientName="client_4" hostName="client_4"/>
</destination>
<volumeRstOption volumeLeveRestore="0" volumeLevelRestoreType="DISK_ATTACH"/>
<virtualServerRstOption isDiskBrowse="1" viewType="0">
<diskLevelVMRestoreOption esxServerName="DOCTESTLAB.testlab.commvault.com" passUnconditionalOverride="1">
<userPassword userName="root" password=""/>
<advancedRestoreOptions guid="5039fb6c-9190-1642-f42b-bctest21f01b" newName="localds5vm2" esxHost="111.11.111.10" Datastore="localds5">
<disks name="scsi0-0-localds5vm1.vmdk" Datastore="localds5"/>
</advancedRestoreOptions>
</diskLevelVMRestoreOption>
<userPassword userName="root"/>
</virtualServerRstOption>
<fileOption>
<sourceItem val="\5039fb6c-9190-1642-f42b-bctest21f01b\scsi0-0-localds5vm1.vmdk"/>
</fileOption>
<commonOptions overwriteFiles="1" detectRegularExpression="1" unconditionalOverwrite="1" stripLevelType="PRESERVE_LEVEL" preserveLevel="1" stripLevel="0" restoreACLs="1" isFromBrowseBackup="1" clusterDBBackedup="0"/>
</restoreOptions>
<adminOpts>
<updateOption invokeLevel="0"/>
</adminOpts>
<vmBrowsePathNodes browsePath="\5039fb6c-9190-1642-f42b-bctest21f01b\scsi0-0-localds5vm1.vmdk" vmGUID="5039fb6c-9190-1642-f42b-bctest21f01b" datastore="localds5" vmDataStore="localds5"/>
</options>
</subTasks>
</taskInfo>
</TMMsg_CreateTaskReq>
Sample Response
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<TMMsg_CreateTaskResp taskId="6441">
<jobIds val="40983" />
</TMMsg_CreateTaskResp>