Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies To: System Center 2016 - Service Provider Foundation, System Center Technical Preview
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. You can use a MERGE or PUT HTTP operation for this process.
To restore a checkpoint to a virtual machine by using the .NET Framework
- Connect to the Service Provider Foundation - VMMservice.
- Obtain reference to the specific - SpfVMM.VMCheckPointto which you want to restore an associated virtual machine.
- Set the - VMCheckPointActionproperty to- Restore.
- Call the - UpdateObjectmethod on the- VMMservice object reference and pass in the checkpoint reference.
- Call the - SaveChangesmethod on the- VMMservice object reference.
To restore a checkpoint to a virtual machine by using HTTP
- Create a new HTTP - PUTor- MERGEoperation.- Important - If you supply only the key and changed properties, use a - MERGEoperation. The- PUToperation is used when you want to replace all properties on the entity with new or default values. The- MERGEoperation updates the existing entity with the supplied properties. The- PUToperation updates the existing entity with the supplied properties, but resets all missing properties back to their default values.
- Set the URL to the URI of a specific checkpoint: https://server:30006/subscription-id/services/systemcenter/vmm/VMCheckPoints(ID=guid'checkpoint-id',StampId=guid'stamp-id') 
- Add the HTTP headers. - Specifically, add the - x-ms-principal-idheader, which can be set to any value.
- Create the HTTP payload that contains the checkpoint entity with the - VMCheckPointActionproperty set to- Restore.
- Submit the HTTP request. 
Example
The following code example shows how to get a specific checkpoint and how to restore it. For more information, seeProgramming 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";  
    vmmService.UpdateObject(checkpoint);  
    vmmService.SaveChanges();  
}  
  
Example
The following code example is an HTTP request that is sent to the server.
MERGE https://wapserver:30006/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  
x-ms-principal-id: user@contoso.com  
Content-Type: application/json;odata=minimalmetadata  
Host: wapserver:30006  
Content-Length: 80  
Expect: 100-continue  
  
{  
    "VMCheckPointAction": "Restore",  
    "odata.type": "VMM.VMCheckPoint"  
}  
  
Example
The following code example shows the 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  
  
See Also
Checkpoints
How to Create a Virtual Machine Checkpoint
How to Delete a Virtual Machine Checkpoint