Skip to content

sukodava/Virtual-Machine-Restore-Points

 
 

Repository files navigation

What is a VM Restore Point?

A VM Restore Point stores the VM configuration and point-in-time crash (if the VM is shutdown) or application consistent snapshot for all managed disks attached to a Virtual Machine. VMRestorePointCollection is the ARM resource which contains the restore points specific to a VM and each Restore Point contains disk restore points for each included disk. The resource hierarchy hence looks like this-

VM Restore Points Collection

       VM Restore Points (application or crash consistent across disks at a point in time)

             Disk Restore Points (one for each disk included in the VM restore point)

You can create a VM using the VM Restore Point or create individual disks from the Disk Restore Point object. VM Restore Points are incremental where the first Restore Point stores a full copy of all the disk attached to the VM. For each successive restore point for a VM, only the incremental changes to your disks are backed up. To further reduce your costs, you can optionally exclude any disk when creating a restore point for your VM.

Cross Region VM Restore Points

As an extension to VM Restore Points we are providing additional functionality within Azure platform to enable our partners to build BCDR solutions for Azure VMs. Additional functionalities include: 1. Ability to copy VM Restore Points from one region to another other region Scenarios where this API can be helpful:

  • Extend multiple copies of backup to different regions
  • Extend local backup solutions to support disaster recovery from region failures

For copying VM Restore Points across regions please refer to the Cross Region Copy of VM Restore Points documentation.

2. Ability to create VM Restore Points directly in the target region by referencing a VM in the source region Scenario where this API can be helpful:

  • Implement a disaster recovery solution to protect VMs from region failure.

For creating VM Restore Points across regions please refer to the Cross Region Creation of VM Restore Points documentation.

Note

The VM Restore Point feature is currently in private preview and is not meant for production workloads. The feature is currently supported via ARM templates and REST APIs only. Other client tool support such as portal, CLI, SDKs, etc. will be coming later.

Restrictions

  1. Only works with Managed disks.
  2. Ultra disks, Ephemeral OS Disks and Shared Disks are not supported.
  3. Requires API version >= 2021-03-01
  4. Required AFECs: "Microsoft.Compute/RestorePointExcludeDisks", "Microsoft.Compute/IncrementalRestorePoints"

Creating a VM Restore Point

  1. First Step is to create a RestorePointCollection. You can refer to the following API documentation on how to create a RestorePointCollection.
  2. Next, you can create a restore point using the RestorePointCollection. You can refer to the following API documentation on how to create a RestorePoint.
  • You can also create a restore point and exclude one or more attached disks.

RestorePointCollection Resource

Use the following URI for GET and DELETE operation on the Restore Point Collection resource. The URI has all the required parameters and there is no need for an additional request body.

https://management.azure.com/subscriptions/{SubscriptionID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{RestorePointCollectionName}?$expand=restorePoints&api-version=2021-03-01

You can use PATCH/PUT request to update tags on a Restore Point Collection. No other properties (e.g. location, source VM) can be updated.

RestorePoint Resource

Use the following URI for GET and DELETE operation on the Restore Point resource. The URI has all the required parameters and there is no need for an additional request body.

https://management.azure.com/subscriptions/{SubscriptionID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{RestorePointCollectionName}/RestorePoints/{RestorePointName}?api-version=2021-03-01

For update of an existing Restore Point Collection resource, only update of tags is permitted.

Create Disk

  1. Get the Disk Restore ID by either using GET call on Restore Point Collection and expanding Restore Points or by doing a call on Restore Point(s).
  2. You can use the below Rest API call to create a disk using diskRestorePoint. API documentation.

PUT https://management.azure.com/subscriptions/49151e6d-fa6e-4985-ae85-00548ec78853/resourceGroups/dfgdf_group/providers/Microsoft.Compute/disks/restore_disk1?api-version=2020-12-01

Request Body: { "location": "East US", "properties": { "creationData": { "createOption": "Restore", "sourceResourceId": "/subscriptions/{SubscriptionID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{RestorePointCollectionName}/restorePoints/{RestorePointName}/diskRestorePoints/{DiskRestorePointName}" } } }

SAS using Disk Restore Points

We are providing a BeginGetAccess API through which the user can directly pass the ID of the diskRestorePoint to create a SAS to the underlying disk.

  • If there is no active SAS on the incremental snapshot of the restore point, then a new SAS will be created and Url returned to the user.
  • If there is already an active SAS, the SAS will be extended and original SASUrl will be returned.

POST 

https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/restorepointcollections/{restorePointCollection}/restorepoints/{vmRestorePoint}/diskRestorePoints/{diskRestorePointName}/BeginGetAccess

POST request body 

{ 

    "access" : "Read" 

    "durationInSeconds": "3600" 

 }

Response codes 

202 Accepted. This operation is performed asynchronously. After receiving a 202 HTTP response, the client is expected to poll for the status of the asynchronous part of the operation using the URL returned in the Azure-AsyncOperation header. Azure will show operation status as complete (‘succeeded’) only after the operation is complete. 

There is also a EndGetAccess API in which the user can directly pass the ID of the diskRestorePoint to revoke SAS.

POST 

https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/restorepointcollections/{restorePointCollection}/restorepoints/{vmRestorePoint}/diskRestorePoints/{diskRestorePointName}/EndGetAccess 

Response codes 

202 Accepted. This operation is performed asynchronously. After receiving a 202 HTTP response, the client is expected to poll for the status of the asynchronous part of the operation using the URL returned in the Azure-AsyncOperation header. Azure will show operation status as complete (‘succeeded’) only after the operation is complete. 

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published