How to add Azure Virtual machine to an existing availability set?

0 votes

Hey guys

I want to create two virtual machines in Azure which should not be connected to each other. I created first virtual machine and also created an availability set as part of its creation process.

Now when I create the second virtual machine then I don't get the availability set created as part of first virtual machine in the drop down list of availability sets.

However if I try to connect the second virtual machine as part of first one then I am able to see the availability set created as part of first virtual machine.

Is it mandatory for virtual machines to be connected to each other so that I can add them to the same availability set? Is this a limitation only from azure portal and there is a workaround using powershell?

UPDATE:

If we connect two virtual machines then we can get the benefit of availability set. However, at the same time both virtual machine becomes part of same cloud service and hence are load balanced by azure which does not support sticky session.

My scenerio is that I have identical front-ends which needs to support sticky session. Therefore I don't want to connect them to each other. However, I want to get the benefits of availability sets as mentioned in the article on Availability sets.

So can I set availability set for two identical virtual machines not connected to each other?

TIA

Aug 9, 2018 in Azure by cloudie_crank
• 1,610 points
689 views

1 answer to this question.

0 votes

You cannot associate an Availability Set to an existing Virtual Machine, as it can be done only while creating a new VM.

There is a workaround for this, where you can recreate a new VM from existing one and to make it really easy, there is a powershell script to do this for you here - https://gallery.technet.microsoft.com/Set-Azure-Resource-Manager-f7509ec4

Run the script and provide the requested parameters -

Set-ArmVmAvailabilitySet.ps1 –VmName 'MyNewVmName' –ResourceGroup 'MyResource Group' –AvailabilitySetName 'AsName'
Key in your subscription details when prompted for it.
answered Aug 9, 2018 by null_void
• 3,220 points

Related Questions In Azure

0 votes
1 answer

How to add an App Settings to existing Azure Web Application using Azure Power Shell?

The example is for slot-specific settings, if ...READ MORE

answered Jun 13, 2018 in Azure by club_seesharp
• 3,450 points
193 views
0 votes
1 answer

How can I replicate an Azure Virtual Machine?

To create a managed image of a ...READ MORE

answered May 23, 2018 in Azure by club_seesharp
• 3,450 points
55 views
0 votes
2 answers

How can I download a .vhd image to my local machine from azure and upload the same to a different azure account?

From the Windows Azure Portal you can ...READ MORE

answered Aug 20, 2018 in Azure by Priyaj
• 56,900 points
2,672 views
0 votes
2 answers

How can I add database connection string to Azure Functions?

The best way to do this is ...READ MORE

answered Aug 17, 2018 in Azure by Priyaj
• 56,900 points
3,346 views
0 votes
1 answer

Any simple way to add a Reserved IP address to an existing VM?

At Build 2015 they announced this is ...READ MORE

answered Jul 3, 2018 in Azure by null_void
• 3,220 points
32 views
0 votes
1 answer

How can we connect Azure Web App to an Azure SQL Database?

Its easy now! Go to your Azure SQL ...READ MORE

answered Aug 8, 2018 in Azure by club_seesharp
• 3,450 points
221 views
0 votes
1 answer

How to set default Web page for a website on Microsoft Windows Azure?

This blog post should resolve your issue: http://blogs.msdn.com/b/cesardelatorre/archive/2010/07/22/how-to-set-a-default-page-to-a-windows-azure-web-role-app-silverlight-asp-net-etc.aspx Look ...READ MORE

answered Mar 27 in Azure by Prerna
• 1,940 points
49 views
0 votes
1 answer
+1 vote
2 answers

How do I establish an connection to Azure IoT Hub? Say a connection like MQTT/AMQP using Python.

Azure IoT Hub comes with 3 SDK's: Service SDK Device ...READ MORE

answered Apr 13, 2018 in Azure by null_void
• 3,220 points
586 views
0 votes
1 answer

How to determine the number of messages in an Azure Services Bus Queue?

You will get error when you try ...READ MORE

answered Jun 12, 2018 in Azure by null_void
• 3,220 points
251 views