Inspect a VM Role for Provisioning Errors [SPFSDK][VMROLE]
Applies To: Windows Azure Pack
Whenever operations are performed on the VM role, the VM role ProvisioningState property will be set to either Provisioned, Provisioning, or Failed depending on the result of the operation. Some of the types of operations that would affect the ProvisioningState property include creating a VM role, updating the VM role from a different gallery item version, and scaling/repairing the VM role.
How to detect errors
If the previous operation resulted in a Provisioned or Provisioning value for the ProvisioningState property, you do not need to do anything. However, if the result of the operation results in Failed, you will need to investigate further to determine the cause of the problem. The Substate property also exists on the VM role instance. This property describes the error that may have occurred when working with a VM role. This property has a child property named VMRoleMessages which is an array of messages that describe the error.
Below is an example that shows an HTTP response body that contains a single VM role instance. This instance had three issues during the provisioning of the VM role. Note the ProvisioningState property is set to Failed and the Substate property contains the VMRoleMessages property that is an array of error details.
{
"InstanceView": {
"InstanceCount": "1",
"ResolvedResourceDefinition": { "... removed for brevity ... ": "" },
"VIPs": []
},
"Label": "testquickvm",
"Name": "testquickvm",
"ProvisioningState": "Failed",
"ResourceConfiguration": { "... removed for brevity ... ": "" },
"ResourceDefinition": { "... removed for brevity ... ": "" },
"Substate": {
"VMRoleMessages": [{
"Message": "Virtual Machine Manager cannot detect a heartbeat from the specified virtual machine. Either the virtual machine is not running or Virtual Machine Additions is not installed.",
"MessageQualifier": "Error",
"VMId": null
},
{
"Message": "One or more virtual machines have failed during customization during the deployment of the service.",
"MessageQualifier": "Warning",
"VMId": null
},
{
"Message": "Virtual Machine Manager cannot detect a heartbeat from the specified virtual machine. Either the virtual machine is not running or Virtual Machine Additions is not installed.",
"MessageQualifier": "Error",
"VMId": "9f7ac179-68f2-4703-9d58-d64b45fadc92"
}]
},
"odata.metadata": "https://spf-server:8090/SC2012R2/VMM/Microsoft.Management.Odata.svc/$metadata#VMRole/@Element"
}
What to do about errors
If an error occurred while provisioning a VM role, it may be related to its configuration. If that is true, update the ResourceConfiguration property and initiate a Repair operation. If the error is related to deployment (finding resources to place the virtual machine or something like this) you may also try to initiate a Repair operation to force it to redeploy. Otherwise, there may be an issue with Virtual Machine Manager and an administrator would have to investigate further. For more information about the Repair operation, see Repair a VM Role [SPFSDK][VMROLE].
See Also
Create a Cloud Service to Host VM Roles [SPFSDK][VMROLE]
Create a New VM Role Instance from the Gallery [SPFSDK][VMROLE]