How to get a list of compatible vm sizes for deploy in the same cloud service? - azure

I have a single cloud service in Azure that contains one VM. I would like to deploy another virtual machine.
What is the api to get a list of compatible vm sizes for deploy in the same cloud service?
I don't want to have the following exception:
Hyak.Common.CloudException: Compute.CannotUpgradeDeploymentToNewRoleSize : Unable to upgrade the deployment. The requested VM size 'Standard_D4' may not be available in the resources supporting the existing deployment. ..

#ivan_petrushenko, I think the API you want to get a list of compatible vm sizes for deploy in the same cloud service is the one of the list below.
List available VM sizes in an availability set
List available VM sizes in a region
List all available virtual machine sizes for resizing
And according to the troubleshooting for resizing an existing VM, you can try to stop the VM first, then to start to resize the VM.
As references, there is a similar thread from ServerFault that the answerer has a blog introduced the VM size change considerations. Meanwhile, a blog from a MS partner shows the tables about all the resizing configuration paths.
Update:
The section Allocation scenario: Resize a VM or add VMs or role instances to an existing cloud service explained your issue.

Related

Patching and Updating Virtual Machine ScaleSets

As I understand, Virtual Machine Scale Sets are a collection of Virtual Machines. Each one can be destroyed and reconstituted at the whim of the configuration. The VM's are recreated from a certain image. Is this understanding is correct ?
If this is correct, how do you patch a scaleset ?
Consider a scaleset created using a Windows 2016. 50 patches are made available via the update service since the base image was created. During a heavy load, 3 new VMs are created by the scaleset. The new VMs should load 50 patches before even going on-line. That could take hours. The patches might not work at all.
What is the best practice to handle this issue ?
I would like to suggest to create the VMSS from a custom image. You could first deploy a windows 2016 and install the 50 patches, then make this as a custom VM image. This custom VM image includes any required application installs or configurations. Any VM instances created in the scale set use the custom VM image and are ready to serve your application traffic. In this tutorial you learn how to:
Create and customize a VM
Deprovision and generalize the VM
Create a custom VM image
Deploy a scale set that uses the custom VM image
You could make it with multiple methods.
Tutorial: Create and use a custom image for virtual machine scale sets with Azure PowerShell
Tutorial: Create and use a custom image for virtual machine scale sets with the Azure CLI
Add a custom image to an Azure scale set template
The Windows Server images in the marketplace are continually updated (at roughly a monthly cadence) with all of the latest patches. Installing the latest version is a good starting point to keep your instances up-to-date.
In order to stay up-to-date on existing instances when new images are released, you can enable automatic OS image upgrades, which will safely update instances in a rolling fashion when a new version of the image is available.

Azure VM complete replication

I have a azure vm setup that contains custom software, files, folders blah blah. At any point I will need to create multiple identical instances of the existing vm (maybe up to 30). I used the sysprep in the vm, in the azure portal I used the capture image for the vm and tried to create a new VM from the image. The new vm created from the image did not contain any of the files from the previous vm.
What would be the best approach in preserving a complete image of the vm and be able to mass deploy from it at any given time?
I'm not sure what you do makes the file disappear, but on my side, it works well. Sysprep just removes all your personal account and security information and then prepares the machine to be used as an image. You can see the feathers of it from Sysprep overview.
To create a custom VM image, see Create a managed image of a generalized VM in Azure. I suggest that creating an image directly from the VM ensures that the image includes all of the disks associated with the VM, including the OS disk and any data disks.
For the creation of multiple identical instances, you can use the Azure VM Scale Sets. The VMs are identical, load balanced in a group, so if you want to specialize one of them, you need to specialize all of them through a custom image.
Also, you can use the Azure Template to create multiple individual VMs, they are 他the independent VMs, you can specialize any one of them, not all of them, but uniform management is a little difficult.
You can get more details about the difference between them, see Differences between virtual machines and scale sets.

Azure VM downgrade from A8

Is it possible to downgrade an Azure VM A8 (high compute) to a lower version like an A3? I keep getting the following error message when I try. I don't have an availability set setup. Thanks!
"Unable to upgrade the deployment. The requested VM size 'Large' 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. The long running operation tracking ID was: b2024fe9e93f6764bec3aa008756f0b7."
I recently discovered (via MS support tickets) that there are different "clusters" within Azure data centers, with different VM size compatibilities. In my case I had some cloud services in older clusters which didn't allow the newer "D-Series" VM sizes I wanted. The only solution was to create brand new cloud service instances from scratch and use Azure traffic manager to achieve a transition from the old servers to new ones.

Upgrading from A-series to D-series Azure virtual machine

We have SQL Sever setup on A-series virtual machines. We are wanting to upgrade to the D-series virtual machine. Is it as simple as just upgrading the VM in Azure and clicking save or are there any other things I need to watch out for? I have heard of people having issues upgrading due to the level not being available in the cluster that their Virtual Machines sit in.
The hardware infrastructure used for A series VM is not suitable for D series VM. It might be possible that the cluster where the VM is hosted, has the hardware configuration required for creating A series VM alone.
However if you would still want to change from A series to D series VM, you will have to export disks and create a new VM using the previously saved disks.
Going forward as a workaround: when you create your very first VM in your Cloud Service, be sure to specify one of the D-SERIES size even if you do not need it immediately. Doing this, your Cloud Service will be “tied” to a cluster that will support both A-SERIES (except A8/A9) and D-SERIES, then for all the future VMs contained in the same Cloud Service. Now, you can create additional A-SERIES VMs and mix together in the same Cloud Service. If you do not need the first D-SERIES VM, you can now safely delete it.
If the D-series machines are not available due to the cluster, you can always delete the vm (preserve the disks) and create a new VM of the D-series and attach the existing disks to that system.
When you create the new VM, choose the option to 'create from template' and the select your OS disk from the 'My Disks' section. Then attach all the data disks to the VM once it's provisioned.

Window Azure Deploying Cloud Services with A6 vmsize

In my cloud service I have one web role and worker role. I changed my web role VM size from medium to A6.
When I tried to deploy to Windows Azure, I get the following error message:s seem prompt me error
The VM size (or combination of VM sizes) required by this deployment cannot be provisioned due to deployment request constraints. If possible, try relaxing constraints such as virtual network bindings, deploying to a hosted service with no other deployment in it and to a different affinity group or with no affinity group, or try deploying to a different region.
What does that mean?
Basically, you've asked it for one of the new "Uber" A6 Instances (with additional memory/process resources) and it was unable to provision your request (i.e. provide you with the required amount of cloud computing power for an A6 Instance).
You could try deploying to a different geographic location or affinity group or just wait and try again.

Resources