This is an archive version of the document. To get the most up-to-date information, see the
current version.
Performing Full VM Restore
Using Veeam Backup Enterprise Manager RESTful API, you can perform the full VM restore operation.
Prerequisites
- Make sure you are logged on to Veeam Backup Enterprise Manager under the user account to which the Portal Administrator, Portal User or Restore Operator role is assigned.
- If you are logged on using the account to which the Portal User or Restore Operator role is assigned, make sure that your restore scope permits you to restore the necessary VM.
Procedure
- After you access Veeam Backup Enterprise Manager RESTful API and create a new logon session, examine the representation of the logon session that the server has returned:
Request: POST http://localhost:9399/api/sessionMngr/ Request Header: Authorization: Basic QWRtaW5pc3RyYXRvcjpUcmVzc3Bhc3Mx Response: 201 Created Response Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj Response Body: <LogonSessions xmlns="http://www.veeam.com/ent/v1.0"> <LogonSession Type="LogonSession" Href="http://localhost:9399/api/logonSessions/3a9858d8-a453-48c0-bbf1-7256bc6801e6"> <Links> <Link Rel="Up" Type="EnterpriseManager" Href="http://localhost:9399/api/" /> <Link Rel="Down" Type="BackupServerReferenceList" Href="http://localhost:9399/api/backupServers" /> <Link Rel="Down" Type="JobReferenceList" Href="http://localhost:9399/api/jobs" /> <Link Rel="Down" Type="HierarchyRootReferenceList" Href="http://localhost:9399/api/hierarchyRoots" /> <Link Rel="Down" Type="RepositoryReferenceList" Href="http://localhost:9399/api/repositories" /> <Link Rel="Down" Type="BackupReferenceList" Href="http://localhost:9399/api/backups" /> <Link Rel="Down" Type="RestorePointReferenceList" Href="http://localhost:9399/api/restorePoints" /> <Link Rel="Down" Type="VmRestorePointReferenceList" Href="http://localhost:9399/api/vmRestorePoints" /> ... </Links> <UserName>BACKUPSERVER\Administrator</UserName> <SessionId>3a9858d8-a453-48c0-bbf1-7256bc6801e6</SessionId> </LogonSession> </LogonSessions> |
- Find the link for the /vmRestorePoints resource collection:
<Link Rel="Down" Type="VmRestorePointReferenceList" Href="http://localhost:9399/api/vmRestorePoints" /> |
- From the link, retrieve the URL for the /vmRestorePoints collection. The URL is specified in the Href element. Send the GET HTTP request to the retrieved URL. The server will return a representation of all VM restore points that have been created by Veeam backup servers connected to Veeam Backup Enterprise Manager.
Request: GET http://localhost:9399/api/vmRestorePoints Request Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj Response: 200 Success Response Body: <EntityReferences xmlns="http://www.veeam.com/ent/v1.0"> <Ref Type="VmRestorePointReference" Href="http://localhost:9399/api/vmRestorePoints/7e26714d-4d44-4bf1-af0e-158e9f7f5f66" Name="sql01-hv@2013-08-21 10:46:42" UID="urn:veeam:VmRestorePoint:7e26714d-4d44-4bf1-af0e-158e9f7f5f66"> <Links> <Link Rel="Up" Type="localhostReference" Href="http://localhost:9399/api/localhosts/15942270-fb56-4dcc-96e9-5f80e4725a15" Name="localhost" /> <Link Rel="Up" Type="RestorePointReference" Href="http://localhost:9399/api/restorePoints/fcf92506-ee3e-4612-bfb5-68ab2d472532" Name="Aug 21 2013 10:46AM" /> <Link Rel="Alternate" Type="VmRestorePoint" Href="http://localhost:9399/api/vmRestorePoints/7e26714d-4d44-4bf1-af0e-158e9f7f5f66?format=Entity" Name="sql01-hv@2013-08-21 10:46:42" /> </Links> </Ref> <Ref Type="VmRestorePointReference" Href="http://localhost:9399/api/vmRestorePoints/a712861b-0dd3-405b-8b75-2fbee55fb415" Name="sql01-hv@2013-08-21 10:44:36" UID="urn:veeam:VmRestorePoint:a712861b-0dd3-405b-8b75-2fbee55fb415"> <Links> <Link Rel="Up" Type="localhostReference" Href="http://localhost:9399/api/localhosts/15942270-fb56-4dcc-96e9-5f80e4725a15" Name="localhost" /> <Link Rel="Up" Type="RestorePointReference" Href="http://localhost:9399/api/restorePoints/6f30b893-7103-4925-bef0-48ca943ae6b6" Name="Aug 21 2013 10:44AM" /> <Link Rel="Alternate" Type="VmRestorePoint" Href="http://localhost:9399/api/vmRestorePoints/a712861b-0dd3-405b-8b75-2fbee55fb415?format=Entity" Name="sql01-hv@2013-08-21 10:44:36" /> </Links> </Ref> <Ref Type="VmRestorePointReference" Href="http://localhost:9399/api/vmRestorePoints/5c0d5a40-714c-457c-a005-3ccca1730468" Name="hp_vm1@2013-08-21 13:32:48" UID="urn:veeam:VmRestorePoint:5c0d5a40-714c-457c-a005-3ccca1730468"> <Links> <Link Rel="Up" Type="localhostReference" Href="http://localhost:9399/api/localhosts/15942270-fb56-4dcc-96e9-5f80e4725a15" Name="localhost" /> <Link Rel="Up" Type="RestorePointReference" Href="http://localhost:9399/api/restorePoints/93731898-da96-4830-b74c-d632a8590746" Name="Aug 21 2013 1:32PM" /> <Link Rel="Alternate" Type="VmRestorePoint" Href="http://localhost:9399/api/vmRestorePoints/5c0d5a40-714c-457c-a005-3ccca1730468?format=Entity" Name="hp_vm1@2013-08-21 13:32:48" /> </Links> </Ref> ... </EntityReferences> |
- Examine the received resource representation and find a link to the entity of the necessary restore point. The Rel attribute in the link will be set to Alternate:
<Link Rel="Alternate" Type="VmRestorePoint" Href="http://localhost:9399/api/vmRestorePoints/a712861b-0dd3-405b-8b75-2fbee55fb415?format=Entity" Name="sql01-hv@2013-08-21 10:44:36" /> </Links> |
- Retrieve the URL for the VM restore point and send the GET HTTP request to the retrieved URL. The server will return a resource representation of the VM restore point:
Request: GET http://localhost:9399/api/vmRestorePoints/a712861b-0dd3-405b-8b75-2fbee55fb415?format=Entity Request Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj Response: 200 Success Response Body: <VmRestorePoint xmlns="http://www.veeam.com/ent/v1.0" Type="VmRestorePoint" Href="http://localhost:9399/api/vmRestorePoints/a712861b-0dd3-405b-8b75-2fbee55fb415?format=Entity" Name="sql01-hv@2013-08-21 10:44:36" UID="urn:veeam:VmRestorePoint:a712861b-0dd3-405b-8b75-2fbee55fb415" VmDisplayName="sql01-hv"> <Links> <Link Rel="Restore" Href="http://localhost:9399/api/vmRestorePoints/a712861b-0dd3-405b-8b75-2fbee55fb415?action=restore" /> <Link Rel="Up" Type="BackupServerReference" Href="http://localhost:9399/api/backupServers/15942270-fb56-4dcc-96e9-5f80e4725a15" Name="localhost" /> <Link Rel="Up" Type="RestorePointReference" Href="http://localhost:9399/api/restorePoints/6f30b893-7103-4925-bef0-48ca943ae6b6" Name="Aug 21 2013 10:44AM" /> <Link Rel="Alternate" Type="VmRestorePointReference" Href="http://localhost:9399/api/vmRestorePoints/a712861b-0dd3-405b-8b75-2fbee55fb415" Name="sql01-hv@2013-08-21 10:44:36" /> <Link Rel="Down" Type="VmRestorePointMountList" Href="http://localhost:9399/api/vmRestorePoints/a712861b-0dd3-405b-8b75-2fbee55fb415/mounts" /> <Link Rel="Create" Type="VmRestorePointMount" Href="http://localhost:9399/api/vmRestorePoints/a712861b-0dd3-405b-8b75-2fbee55fb415/mounts" /> </Links> <CreationTimeUTC>2013-08-21T10:44:36Z</CreationTimeUTC> <Algorithm>Full</Algorithm> <PointType>Full</PointType> </VmRestorePoint> |
- Find a link to the full VM restore action and send the POST HTTP request to the URL in the link. The VM restore process is started asynchronously: Veeam Backup Enterprise Manager creates a new task for the VM restore and returns the HTTP/1.1 202 ACCEPTED status to the client. In the response body, Veeam Backup Enterprise Manager returns a resource representation of the task.
Request: POST http://localhost:9399/api/vmRestorePoints/a712861b-0dd3-405b-8b75-2fbee55fb415?action=restore Request Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj Response: 202 Created Response Body: <Task xmlns="http://www.veeam.com/ent/v1.0" Type="Task" Href="http://localhost:9399/api/tasks/task-1"> <Links> <Link Rel="Delete" Type="Task" Href="http://localhost:9399/api/tasks/task-1" /> </Links> <TaskId>task-1</TaskId> <State>Running</State> <Operation>StartVMRestore</Operation> </Task> |
- Every task has its own ID. In the given example, the task ID is task-1. To trace the task performance and check the task result, send the GET HTTP request to the task resource. The server will return a resource representation of the task describing the task status and result:
Request: GET http://localhost:9399/api/tasks/task-1 Request Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj Response: 200 Success Response Body: <Task xmlns="http://www.veeam.com/ent/v1.0" Type="Task" Href="http://localhost:9399/api/tasks/task-1"> <Links> <Link Rel="Delete" Type="Task" Href="http://localhost:9399/api/tasks/task-1" /> <Link Rel="Related" Type="RestoreSession" Href="http://localhost:9399/api/restoreSessions/b67a3603-81f4-46af-be68-9f2c2307465c?format=Entity" /> </Links> <TaskId>task-1</TaskId> <State>Finished</State> <Operation>StartVMRestore</Operation> <Result Success="true"> <Message>Ok</Message> </Result> </Task> |
- In the resource representation of the task, the server also returns a link to the restore session resource created once the restore process is started. You can check the restore session details by sending the GET HTTP request to the restore session resource:
Request: GET http://localhost:9399/api/restoreSessions/b67a3603-81f4-46af-be68-9f2c2307465c?format=Entity Request Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj Response: 200 Success Response Body: <RestoreSession xmlns="http://www.veeam.com/ent/v1.0" Type="RestoreSession" Href="http://localhost:9399/api/restoreSessions/b67a3603-81f4-46af-be68-9f2c2307465c?format=Entity" Name="sql01-hv@2013-08-26 08:31:22" UID="urn:veeam:RestoreSession:b67a3603-81f4-46af-be68-9f2c2307465c" VmDisplayName="sql01-hv"> <Links> <Link Rel="Up" Type="BackupServerReference" Href="http://localhost:9399/api/backupServers/15942270-fb56-4dcc-96e9-5f80e4725a15" Name="localhost" /> <Link Rel="Alternate" Type="RestoreSessionReference" Href="http://localhost:9399/api/restoreSessions/b67a3603-81f4-46af-be68-9f2c2307465c" Name="sql01-hv@2013-08-26 08:31:22" /> </Links> <JobType>RestoreVm</JobType> <CreationTimeUTC>2013-08-26T08:31:22Z</CreationTimeUTC> <EndTimeUTC>2013-08-26T08:31:34Z</EndTimeUTC> <State>Stopped</State> <Result>Success</Result> </RestoreSession> |
Result
The VM is restored from the backup to its initial location.