This article is part of the Service Provider Foundation Programmers Guide (SPF).

Virtual Machine Checkpoints provide a way to capture the state of a Virtual Machine. The Checkpoint can then be used to restore the Virtual Machine back to the way it was when the Checkpoint was created.

To restore a checkpoint state to a Virtual Machine, you update an existing Checkpoint object. Set the VMCheckPointAction property to Restore and submit the changed entity back to the server. This is done with a MERGE or PUT HTTP operation.

To restore a checkpoint to a VM with .NET

  1. Connect to the Service Provider Foundation VMM service.

  2. Obtain reference to the specific SpfVMM.VMCheckPoint you want to restore an associated virtual machine to.

  3. Set the VMCheckPointAction property to Restore.

  4. Call the UpdateObject method on the VMM service object reference and pass in the checkpoint reference.

  5. Call the SaveChanges method on the VMM service object reference.

To restore a checkpoint to a VM with HTTP

  1. Create a new HTTP PUT or MERGE operation.

    If you supply only the key and changed properties, use a MERGE operation. PUT is used when you want to replace all properties on the entity with new or default values. The MERGE operation updates the existing entity with the properties supplied. PUT will update the existing entity with the properties supplied, but will reset all missing properties back to their default values.
  2. Set the URL to the URI of a specific checkpoint: https://server:30005/subscription-id/services/systemcenter/vmm/VMCheckPoints(ID=guid'checkpoint-id',StampId=guid'stamp-id')

  3. Add the HTTP headers.

    Specifically, add the x-ms-principal-id header, which can be set to any value.

  4. Create the HTTP payload containing the checkpoint entity with the VMCheckPointAction property set to Restore.

  5. Submit the HTTP request.


The following example shows how to get a specific checkpoint and restore it using .NET. For more information, see Programming in Visual Studio with Service Provider Foundation Services.

var checkpoint = vmmService.VMCheckPoints.Where(cp => cp.ID == new Guid("a11cc636-5521-4f88-92b2-cad392911fe0")).FirstOrDefault();
if (checkpoint != null)
    checkpoint.VMCheckPointAction = "Restore";

The following is an example HTTP request sent to the server:

MERGE https://wapserver:30005/BA4146FA-FB41-41B6-A7C0-2B4FF4C3F7E3/services/systemcenter/vmm/VMCheckPoints(ID=guid'a11cc636-5521-4f88-92b2-cad392911fe0',StampId=guid'ba4146fa-fb41-4f59-a193-ad00c52a138c') HTTP/1.1
DataServiceVersion: 3.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Accept: application/json;odata=minimalmetadata
Accept-Charset: UTF-8
DataServiceUrlConventions: KeyAsSegment
User-Agent: Microsoft ADO.NET Data Services
Content-Type: application/json;odata=minimalmetadata
Host: wapserver:30005
Content-Length: 80
Expect: 100-continue

    "VMCheckPointAction": "Restore",
    "odata.type": "VMM.VMCheckPoint"

The following is an example HTTP response from the server:

HTTP/1.1 204 No Content
Cache-Control: no-cache
Server: Microsoft-IIS/8.5
x-ms-request-id: 6e0d9045-9d24-4ac1-93fc-a172e09af870
X-Content-Type-Options: nosniff
request-id: eda9bde6-834a-0000-2eda-aced4a83ce01
DataServiceVersion: 1.0;
X-AspNet-Version: 4.0.30319
Persistent-Auth: true
X-Powered-By: ASP.NET
Date: Mon, 19 Aug 2013 22:13:09 GMT