0

I am able to create a new virtual machine that's of a larger size than my current one, but I am not able to upgrade or resize an old VM to that larger size even though it's of a pretty similar type. So I'm thinking, since I can't resize the VM in place, can I create a new VM of the larger size and simply restore onto its OS disk the contents of the old, smaller VM's OS disk? I mean, the two VMs seem to be practically the same except the larger type features Premium Disk support.

I've resized other Azure VMs in place before easily, but this particular new scenario is a situation where the old VM I am trying to resize, E32a_v4, supports Standard SSD and the new one, E32as_v4, supports Premium SSD--which is the very reason I'm trying to upgrade! I mean, the two VM types are only off by one letter (s)! However, the resize operation is unfortunately not as straightforward. Azure will not allow the resize to be performed in place, saying, "Failed to resize virtual machine". Here are the details:

"Failed to resize virtual machine 'MyVirtualMachineName' to size 'Standard E32as_v4'. Error: Operation could not be completed as it results in exceeding approved standardEASv4Family Cores quota. Additional details - Deployment Model: Resource Manager, Location: eastus, Current Limit: 32, Current Usage: 32, Additional Required: 32, (Minimum) New Limit Required: 64. Submit a request for Quota increase at https://aka.ms/ProdportalCRP/?#create/Microsoft.Support/Parameters/bla-bla-bla by specifying parameters listed in the ‘Details’ section for deployment to succeed. Please read more about quota limits at https://docs.microsoft.com/en-us/azure/azure-supportability/per-vm-quota-requests."

But according to the Azure support technicians I'm interfacing with,

". . . If the customer is trying to resize a VM that operates on standard disk to a VM that operates on Premium disk, they will be unable to as there are significant hardware differences. However, the customer should be able to create a brand new VM as E32asv4 and migrate the data if they would like."

This is unacceptable, as creating a brand new VM for me wouldn't mean that I could simply "migrate the data"--there are a very many software packages configured and far too many other Windows policies and other settings I would have to recreate. It would be a very laborious task and the chances I will miss many important preferences and configurations is too high.

Thus I am thinking, can't I simply take a backup of the old E32a_v4 VM's OS disk and restore it onto the newly created E32as_v4 VM as its new OS disk (wiping out or replacing whatever it already had)?

  • PS: I am dealing with the Azure techies to further reconcile their answer against the error message I'm seeing in Azure--because it seems as though my resize operation ought to be possible if they'd only increase my quota! However, regardless of that outcome, my question still stands. I want to confirm whether an Azure VM's OS disk can be replaced with another's--and how. – ShieldOfSalvation Feb 1 at 19:19
0

looking at this link

This example shows how to convert all of a VM's disks from Standard to Premium storage or from Premium to Standard storage. To use Premium managed disks, your VM must use a VM size that supports Premium storage. This example also switches to a size that supports Premium storage.

#resource group that contains the virtual machine
rgName='yourResourceGroup'

#Name of the virtual machine
vmName='yourVM'

#Premium capable size 
#Required only if converting from Standard to Premium
size='Standard_DS2_v2'

#Choose between Standard_LRS and Premium_LRS based on your scenario
sku='Premium_LRS'

#Deallocate the VM before changing the size of the VM
az vm deallocate --name $vmName --resource-group $rgName

#Change the VM size to a size that supports Premium storage 
#Skip this step if converting storage from Premium to Standard
az vm resize --resource-group $rgName --name $vmName --size $size

#Update the SKU of all the data disks 
az vm show -n $vmName -g $rgName --query storageProfile.dataDisks[*].managedDisk -o tsv \
| awk -v sku=$sku '{system("az disk update --sku "sku" --ids "$1)}'

#Update the SKU of the OS disk
az vm show -n $vmName -g $rgName --query storageProfile.osDisk.managedDisk -o tsv \
| awk -v sku=$sku '{system("az disk update --sku "sku" --ids "$1)}'

az vm start --name $vmName --resource-group $rgName

Regarding your other error:

"Failed to resize virtual machine 'MyVirtualMachineName' to size 'Standard E32as_v4'. Error: Operation could not be completed as it results in exceeding approved standardEASv4Family Cores quota

You have hit a soft quota, number of vcores deployed in the VM size/sku E32as_v4. You got two options to resolve it:

  1. Delete VM’s in the same VM size/sku which will free up vcores
  2. Submit a ticket to Microsoft specifying that you want to raise the quota. This is an automatic process on Microsoft’s end and only take a few minutes
| improve this answer | |
  • PS C:\WINDOWS\system32> az vm resize --resource-group $rgName --name $vmName --size $size az : ERROR: The requested VM size Standard E32as_v4 is not available in the current region. The sizes available in the current region are: Standard_B1ls,Standard_B1ms, etc.... At line:3 char:1 + az vm resize --resource-group $rgName --name $vmName --size $size + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (ERROR: The requ...dard_ND40rs_v2.:String) [], Remote Exception + FullyQualifiedErrorId : NativeCommandError – ShieldOfSalvation Feb 3 at 7:18
  • So the specified VM size/SKU that doesn’t seems to be available in your region, try one of the sizes that the error message print out – Jarnstrom Feb 3 at 7:33
  • Well, I was able to create a new VM of the type I want so it must be available....! – ShieldOfSalvation Feb 3 at 7:34
  • Ah, that’s weird. Maybe you can try one of the sizes in the error message as a troubleshooting step – Jarnstrom Feb 3 at 7:35
  • 1
    @ShieldOfSalvation done, edited my answer so check it out – Jarnstrom Feb 6 at 20:40
1

Couple of things;

  • As you said error is strictly quota issue, so raising you quota increase will resolve that issue.
  • Assuming we are talking about managed disks. If you are have premium disk you cannot resize to a VM size that doesn't support premium disk, but if it is a standard disk you can resize to any VM size.
  • Yes there is an OS Swap option but you shouldn't need it because you can convert the disk then resize.
| improve this answer | |
  • Saw the hassle on previous answer, you know you can switch this from the portal? i.imgur.com/P6ksSB7.png – Hannel Feb 3 at 17:46
  • I knew that, but because the Azure techies were saying I had to create a new VM and migrate the data, I was frantically looking for a way to do so with minimal difficulty by just migrating the OS disk entirely if possible...which led up to the PowerShell answer above which in fact is unnecessary because I could have simply removed the extra new VM and resized the old one right via the web and that alone would have overcome the Azure quota error message I was getting. – ShieldOfSalvation Feb 3 at 19:58
  • We only arrived at that conclusion with @Jamstrom via the ensuing comments. I submitted an edit to his answer to refine it and summarize it. – ShieldOfSalvation Feb 3 at 20:04

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.