SALES: 1-800-867-1380

Capture VM Image

Updated: May 29, 2014

The Capture VM Image operation creates a copy of the operating system virtual hard disk (VHD) and all of the data VHDs that are associated with the Virtual Machine, saves the VHD copies in the same storage location as the original VHDs, and registers the copies as a VM Image in the image repository that is associated with the specified subscription.

The Capture VM Image request may be specified as follows. Replace <subscription-id> with the subscription ID, <cloudservice-name> with the name of the cloud service, <deployment-name> with the name of the deployment, and <role-name> with the name of the Virtual Machine.


Method Request URI


You must make sure that the request that is made to the management service is secure. For additional details, see Authenticating Service Management Requests.

The following table describes the request headers.


Request Header Description


Required. Specifies the version of the operation to use for this request. This header should be set to 2014-02-01 or higher. For more information about versioning headers, see Service Management Versioning.

The following example shows the format of the request body:

<CaptureRoleAsVMImageOperation xmlns="" xmlns:i="">

The following table describes the elements of the request body.


Element name Description


Required. Must be set to CaptureRoleAsVMImageOperation.


Required. Specifies the state of the operating system in the image.

Possible values are:

  • Generalized

  • Specialized

A Virtual Machine that is fully configured and running contains a Specialized operating system. A Virtual Machine on which the Sysprep command has been run with the generalize option contains a Generalized operating system. If you capture an image from a generalized Virtual Machine, the machine is deleted after the image is captured. It is recommended that all Virtual Machines are shut down before capturing an image. For more information about the Sysprep command, see How to Use Sysprep: AN Introduction.


Required. Specifies the name of the VM Image.


Required. Specifies the label of the VM Image.


Optional. Specifies the description of the VM Image.

The Description element is only available using version 2014-05-01 or higher.


Optional. Specifies the language of the VM Image.

The Language element is only available using version 2014-05-01 or higher.


Optional. Specifies a value that can be used to group VM Images.

The ImageFamily element is only available using version 2014-05-01 or higher.


Optional. Specifies the size to use for the Virtual Machine that is created from the VM Image.

The RecommendedVMSize element is only available using version 2014-05-01 or higher.

The response includes an HTTP status code, a set of response headers, and a response body.

A successful operation returns status code 201 (Created). For information about status codes, see Service Management Status and Error Codes.

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.


Response Header Description


A value that uniquely identifies a request made against the management service.

To get a list of VM Images that you have captured, you can use List VM Images.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft