Troubleshooting VM and Environment Creation Failures

DevTest Labs does its best to guide you to a path of success, including warning you if a machine name is invalid or if you are about to violate a lab policy.  But sometimes it happens—the red x next to your lab virtual machine or environment status that informs you that something went wrongWhat do you do?  Let’s go over a few tricks that you can use to find the underlying issue and, hopefully, avoid the issue in the future. 

Portal Notifications

If you are using the Azure Portal, the first place to look is the notifications panel.  The notifications panel, available on the main command bar by clicking the bell icon, will tell you if the lab virtual machine or environment creation was successful or not.  If not, the error message will be displayed.  The details often give further information to help you resolve the issue.  As you can see in the example below, my virtual machine creation failed because I ran out of cores.  The detailed message tells me how to fix the issue and request a core quota increase.

Activity Logs 

Activity logs are good place to look if you are investigating a failure sometime after attempted creation of your vm or environment.  Let's go over how to find logs for both environments and virtual machines. 

Virtual Machines 

For lab virtual machines, open the details for the virtual machine and click the ‘Activity log’ menu item to see all logs associated with that lab virtual machine.  Select the operation that failedTypically, the failed operation is called ‘Write Virtualmachines.   

The details will be in the JSON view of the log.  Look through the JSON log until you find a ‘statusMessage’ property.  It will list the main error message and further detail information, if applicable.  Below is the json for the core quoted exceeded error seen earlier in this post.

"properties": { 
        "statusCode": "Conflict", 
        "statusMessage": "{\"status\":\"Failed\",\"error\":{\"code\":\"ResourceDeploymentFailure\",\"message\":\"The resource operation completed with terminal provisioning state 'Failed'.\",\"details\":[{\"code\":\"OperationNotAllowed\",\"message\":\"Operation results in exceeding quota limits of Core. Maximum allowed: 100, Current in use: 100, Additional requested: 8. Please read more about quota increase at\"}]}}", 


Because of the way environments are created, the activity logs for environments will be found in the activity logs for the lab itself.  To find the pertinent logs, click ‘Configuration and policies’ for the lab and select ‘Activity log’ menu item.  Look for an operation named ‘CreateEnvironment’ or an operation named ‘Labs’ with a child operation of ‘CreateEnvironment’.  Depending on where in the process the failure occurred, the error message will be in either one of these two operations.  As with the lab virtual machines, look for a ‘statusMessage’ property. 

ARM Template Deployment Logs 

If your environment or virtual machine was created through automation, there is one last place to look error information.  That is the Azure Resource Manager (ARM) template deployment logs.  When a lab resource is created through automation, it is often done through an ARM template deployment.  See for example ARM templates that create DevTest Lab resources. 

To see the lab template deployment logs, open the blade for the resource group in which the lab resides.  Click the ‘Deployments’ menu item and look for deployments with a failed status.  Clicking on the ‘Error details’ link will show a pop out with full error details.  In the example below, the maximum allowed virtual machines per user policy prevented another lab virtual machine from being created. 



When the undesired happens and your lab virtual machine or environment fails to be created, you know what to do.  Look in the notifications panel of the Azure Portal, for activity logs or in the ARM template deployment logs, if applicable.  

If you have any questions about DevTest Labs, please check out the MSDN forum. 


  Elizabeth Maher, Senior Software Engineer 

Elizabeth is part of the Visual Studio and .Net engineering team focused on Visual Studio and Azure customers. She has been at Microsoft for 15 years, working on various developer technologies. 



Comments (0)

Skip to main content