Share via


Repair a VM Role [SPFSDK][VMROLE]

 

Applies To: Windows Azure Pack

At times a VM role may at times fail to provision or update. This will require that you fix the problem and then start the Repair operation on the VM role. For more information about investigating VM role errors see Inspect a VM Role for Provisioning Errors [SPFSDK][VMROLE].

Repair a VM role

The repair operation is available at the VM role instance URI: http://server-name:server-port/subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/Repair?api-version=2013-03. The HTTP body of the request should be a JSON object with a single property named Skip. The value of this property should be true or false. When true, this will allow the provisioning to skip the existing virtual machine instance that caused the error while being provisioned and continue on to the next, if any, virtual machine to be created. If it is false, the last virtual machine provisioned (which caused the error) will try again.

Submit an HTTP POST request to the server URI referenced above.

Tip

For more information about the placeholders used in the URL, see URL Cheat Sheet for VM Roles [SPFSDK][VMROLE].

Important

Anytime you access a resource within cloud services, you must append the api-version=2013-03 query string. The query string always starts with the ? character after the URL.

Repair a VM role with HTTP

  1. Use a GET HTTP operation.

  2. Set the URI of the HTTP operation to the format previously described.

  3. Set the x-ms-principal-id header to the email of the tenant associated with the current subscription.

  4. If you want to use json as the response type add the Accept header and set the value to application/json

  5. Set any other standard HTTP headers, such as those related to authentication tokens, and add any authentication certificates that may be required.

  6. Create the HTTP request body, which should be a JSON object.

  7. Create a property on the JSON object named Skip and set the value to either true or false.

  8. Submit the request.

HTTP GET request

POST https://smapi-server:30005/f86b0bc2-6825-4e5b-961b-10d5901f7572/CloudServices/cloudservice1/Resources/MicrosoftCompute/VMRoles/vmrole1/Repair?api-version=2013-03 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6InhUOE1XSFJ0aDVGVmNNSS1CTWlqWTc1Q1dhOCJ9.eyJpc3MiOiJodHRwOi8vYXp1cmVzZXJ2aWNlcy9BdXRoU2l0ZSIsImF1ZCI6Imh0dHA6Ly9henVyZXNlcnZpY2VzL1RlbmFudFNpdGUiLCJuYmYiOjEzODUwNzYyODUsImV4cCI6MTM4NTEwNTA4NSwidXBuIjoiZnJlZEBmcmVkLmNvbSIsImF1dGhfdGltZSI6IjIwMTMtMTEtMjFUMjM6MjQ6NDUuMDU1WiIsImF1dGhtZXRob2QiOiJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvYXV0aGVudGljYXRpb25tZXRob2QvcGFzc3dvcmQifQ.waytWrMR-pdqPCzqw9mKKSO-vGgucTbcWzf6ZcmDRAsNGsIt_yyrd1fhD3J8PDex5wbBP0GGZgvfLZ04Jc8jPCn2rZXgSm25Zl9JOn1pihaGkL7zUUHo1pLPWHes9opBmqJfGHL_4vMdinu0GJ2zWlEEZ_iff1Ro2se9XJA8l8MxAB0DnDx8mJqPJZMvZtczwXpdoiH8lzESeKHmyaACMX4kNZwUGPNQPY5-7cCfmltbdhkYv5_vu0XkwKYJwR_TyUWgq-KzBv3FfcAeNEtt-S3RtGqKaplXEinVpPwY8A-V1cU93dcDewusGP-PidoEXvGVq6GIN-epdwg83p14og
x-ms-principal-id: user@contoso.com
Accept: application/json
Content-Type: application/json
Host: smapi-server:30005
Content-Length: 17
Expect: 100-continue

{ "Skip": false }

HTTP GET response

HTTP/1.1 204 No Content
Cache-Control: no-cache
Content-Length: 0
Server: Microsoft-IIS/8.5
x-ms-request-id: 40f2fe03-c9a8-42bb-8b19-2878c7a51819
X-Content-Type-Options: nosniff
request-id: 33c9dafc-df0d-0001-385d-ca330ddfce01
DataServiceVersion: 1.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Thu, 21 Nov 2013 23:24:50 GMT

See Also

VM Role Instances [SPFSDK][VMROLE]
Get a VM Role Instance [SPFSDK][VMROLE]
Get all of the Virtual Machines [SPFSDK][VMROLE]
Get a Single Virtual Machine [SPFSDK][VMROLE]
Scale a VM Role [SPFSDK][VMROLE]