0

I'm trying to create VMSS with windows custom image that i captured.

I created custom ARM template to use the but its not working when i'm trying to deploy.

Its the right approach if i want to use custom image with VMSS?

Should i use VHD and not captured image?

That's what i'm trying to do:

a. Create a windows machine with managed disk

b. Create a text file on the desktop

c. Make an image out of that windows machine

d. Deploy a new environment with the new image, have that environment automatically horizontal scale whenever CPU reaches 80% for more than 10 minutes, outcome would be auto deploy another machine

Please advise.

Thanks

  • 1
    Not working for what ? Could you show some error massages or details about your failed deployment of that template? – Wayne Yang - MSFT Jan 26 '18 at 7:07
  • Hi Wayne, Thanks for your replay. I created a Win VMSS and took the automation script from azure portal. then i tried to edit the JSON with this "imageReference": { "id": "[resourceId('Microsoft.Compute/images', parameters('images_CSADemoSrv01_image_20180124195454_id'))]" But i'm getting syntax JSON errors like "The domain name label DemoScaleSetdemoscalesetDemoScaleSet is invalid" Its possible use captured image with VMSS or i need VHD? – user3529149 Jan 26 '18 at 7:23
  • ode": "InvalidTemplate", "message": "Unable to process template language expressions for resource '/subscriptions/8bbc50ef-9704-4950-ae0d-914c1ce9e169/resourceGroups/TestEnv02/providers/Microsoft.Compute/virtualMachineScaleSets/demoscaleset' at line '1' and column '3772'. 'Unable to evaluate template language function 'resourceId': function requires exactly one multi-segmented argument which must be resource type including resource provider namespace. Current function arguments 'Microsoft.Compute/images,/subs...- now i change all capital letters and getting this – user3529149 Jan 26 '18 at 7:33
  • TYPEMicrosoft.Compute/images RESOURCE ID/subscriptions/8bbc50ef-9704-4950-ae0d-914c1ce9e169/resourceGroups/TestEnv02/providers/Microsoft.Compute/images/CSADemoSrv01-image-20180124195454 STATUSMESSAGE{ "error": { "code": "PropertyChangeNotAllowed", "target": "sourceVirtualMachine", "message": "Changing property 'sourceVirtualMachine' is not allowed." } } RESOURCECSADemoSrv01-image-20180124195454 - this one too – user3529149 Jan 26 '18 at 7:34
  • Welcome to Serverfault. Please edit your question with this details. Also, generally, One issue, one question. Please specify what exactly your question is. Those comments has much information and please make them logical in your question. I will try to find the reason.Thank you. – Wayne Yang - MSFT Jan 26 '18 at 7:42
0

I understand what you want to achieve. Accroding to your error massage, there may be many errors in your template . It's hard to specify what is the cause of each error. But I can give you some references to Create Azure VMSS with a captured Image:

  1. Ensure that your image has been generalized.

  2. Refer to this template to build your template.

  3. The above template uses VHD for the image. But the managed image has no URL for it. So, you can use those scripts in your template to use managed image:

    "imageReference": { "id": "[variables('managedImageId')]" }

Hope this helps!

  • That's worked after i added resource of the image and related params. Now i need to figure out how to get access to the VM via RDP and check this autoscale.. the LB that created don't have inbound nat and cant change it via azure portal, So i'll need to edit the template and do it there while creating the VMSS. Another point is the text file i created in B step. since i generalized the image, i guess its deleted. right? Thanks for your help! – user3529149 Jan 27 '18 at 8:07
  • Hi,@user3529149. I'm glad to hear your template is worked. 1. You can go to Azure Portal and find the Public IP for the VMSS. You can use this IP address to RDP it. Also you can check the count of instances in the pool. 2. Generalize may clear some personal settings data. I don't think it will delete one independent text file . – Wayne Yang - MSFT Jan 27 '18 at 8:32
  • Also, One question ,One answer is a rule in this forum. So, if you have any other issues, you can post a new question in Serverfault and It will be better. Additional, If this answer is helpful to you , you can accept it as answer so that we can help more communities. Thanks! – Wayne Yang - MSFT Jan 27 '18 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.