Azure PowerShell :: Error Creating New Virtual Machine

Today, I was trying to create a new Standard_DS1 size virtual machine from the Azure PowerShell module, version 0.8.13. The typical process for building a virtual machine in Azure, using PowerShell, looks like the following:

  1. Create a new Azure virtual machine configuration using New-AzureVMConfig
  2. Add provisioning details (username, password for the VM) using Add-AzureProvisioningConfig
  3. (optional) Add additional data disks to the virtual machine using Add-AzureDisk
  4. (optional) Add virtual machine extensions (Custom Script, DSC, VMAccess, etc.)
  5. Create the virtual machine using New-AzureVM

The “DS” size virtual machines were specially designed to work with Azure Premium Storage. Azure Premium Storage is still in preview, as of this writing.

In some cases, you might receive an error message from the Microsoft Azure PowerShell module, with the following text:

New-AzureVM : Compute.CannotUpgradeDeploymentToNewRoleSize : Unable to upgrade the deployment. The requested VM size ‘Standard_DS1’ may not be available in the resources supporting
the existing deployment. Please try again later, try with a different VM size or smaller number of role instances, or create a deployment under an empty hosted service with a new
affinity group or no affinity group binding.

Basically what this means is that the virtual machine size that you’re trying to deploy, isn’t compatible with the existing deployment in your Cloud Service.

Azure Cloud Service Architecture
Azure Cloud Service Architecture

To provide a little background, Azure virtual machines must belong to an entity called a “cloud service” that exposes services running on those VMs via a publicly routable IPv4 address called a Virtual IP (VIP) Address. When you create the first virtual machine in an empty cloud service, a “deployment” named “production” is created inside the cloud service, that holds the virtual machines.

The “deployment” concept is a remnant you’ll notice from the original Platform-as-a-Service (PaaS) model, when you try to build Infrastructure-as-a-Service (IaaS) virtual machines. For the most part, you don’t need to concern yourself with it, however it’s important to note that the deployment is the entity associated with an Azure Virtual Network (VNet), if you’ve deployed a virtual machine into a subnet. Deploying a “deployment” into an Azure VNet is entirely optional, but if you want virtual machines across multiple cloud services to communicate with each other, this is typically the best way of achieving that objective.

In order to resolve this error, you’ll want to make sure that you deploy the new virtual machine into a new cloud service / deployment. Because “A” size virtual machines aren’t compatible with “DS” size virtual machines, they will each need to be deployed into their own cloud services. The same applies to the specialized A8 and A9 size virtual machines.

If this article was helpful, please retweet it!