DevTestLab_Creating Vitual Machine

Category: azure devtest labs

Question

Phaneendra.G on Wed, 17 May 2017 13:29:39


Hi Team,

I am working on Microsoft Azure DevTestLab.

I found one DevTestLab DLL using this DLL I am able to create DevTestLab , Virtual Network but while creating the Virtual Machine

I am getting one error saying that

statusMessage:{"status":"Failed","error":{"code":"ResourceOperationFailure","message":"The resource operation completed with terminal provisioning state 'Failed'.","details":[{"code":"InvalidSubnetUsed","message":"Subnet Test1 either is not enabled or is not part of specified virtual network /subscriptions/xxxxMySubscriptionID/resourcegroups/newrgtest1/providers/microsoft.devtestlab/labs/labTest1/virtualnetworks/Test1vnet."}]}}

Please help me to resolve this issue.


Replies

Leo Vildosola on Wed, 17 May 2017 19:18:44


Hi,

You need to enable the Subnet to be used for VM creation. Take a look at azuredeploy.json in the sample Create Lab with Existing Virtual Network, for a sample of the structure for subnetOverrides. That's what you need to include in your code to enable a Subnet. Specifically, the property useInVmCreationPermission, set it to Allow.


Leo Vildosola [MSFT]
Microsoft Azure DevTest Labs



Phaneendra.G on Thu, 18 May 2017 11:06:34


Hi Leo 

Thank you for your information

i need one more information ,can we create multiple virtual Machines(giving number of instances while creating VM ) by using DLL 


Leo Vildosola on Fri, 19 May 2017 16:17:47


Hi,

We have uploaded a SDK Samples solution using the DTL SDK to our samples Azure DevTest Labs GitHub repo.