3
votes

At the moment I'm trying to deploy a scale set based on a custom windows image created a while ago.

I know this has worked in the past, as our current production infrastructure is running using this exact image, but everytime I go to deploy this image as a vm using either the azure portal or powershell, I get the following error message:

New-AzureRmResourceGroupDeployment : 2:05:05 PM - Resource 
Microsoft.Compute/virtualMachineScaleSets 'test-scaleset' failed with 
message '{
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'.",
"details": [
  {
    "code": "InvalidParameter",
    "message": "Disks or snapshot cannot be resized down."
  }
   ]
  }
}'

I created a new disk using the size A2_V2, and have proceeded to try to create a new VM using that image using the exact same size (A2_V2) all to no avail and with the same error message.

Does anyone have any idea what's happening here? I ensured the vm which was used to create the custom image had sysprep applied, with the generalized parameter set, and am coming at a loss as to why me, and multiple other members of the team are unable to create anything using custom images.

Any help would be greatly appreciated

2
Do you mean you are use image(not disk) to create another new VM then get this error?Jason Ye
Yes, sorry, we provisioned a VM which contains all the software we need, then turned it into a custom image for our future VMs. This custom image is stored on azure, and is used for each of our scale sets. In the past this has worked with no issues, but recently I'm getting the error above when trying to provision a new VM using that image.D Carreras
That image(same image) works for VMSS but not work for your VM?Jason Ye
Yep, we deployed that scale set a few months ago, which is using that exact image. We're planning on upgrading the image, so I was attempting to deploy a few test VM's based on that image, but am now getting errors everytime I try to deploy a VM or VMSS using that image through the portal (Using the "Create VM" option when viewing the image) or powershell. It seems to have been a recent issue, as this hasn't happened before.D Carreras
After that VM created(failed), can you find the new disk via your portal?Jason Ye

2 Answers

2
votes

I had the same issue where I wasn't able to create a VM based on a custom image. I also tried it with PowerShell:

enter image description here

However, I was able to fix it by recreating the image using the existing vhd, just go to the portal, click on "Create a ressource" and choose Image:

enter image description here

Then all you have to do is to select the vhd within your storage account:

enter image description here

Using the new image I was able to provision the VM.

1
votes

Disks or snapshot cannot be resized down.

It is a known issue, please increase the size of that disk in Azure portal.

You can make it work by first de-attaching a Managed Disk, update the size and then attach it back to the VM.

More information about it, please refer to this link.