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 10, 2018 in Azure by cloudie_crank
• 1,610 points
7,880 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 an existing one and to make it really easy.

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.


Hope this helps!!

If you need to know more about Azure, then you should join Microsoft Azure certification course today.

Thank you!!

answered Aug 10, 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
1,430 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
732 views
+1 vote
1 answer

In Azure ,can we add the existing VM into Availability Set or Availability Zone

Hi @Dhishyanth. You can delete the vm and ...READ MORE

answered Dec 18, 2019 in Azure by Kalgi
• 52,350 points
2,549 views
0 votes
1 answer

How to create a windows virtual machine on Azure?

Azure virtual machines (VMs) can be created ...READ MORE

answered Jan 10, 2020 in Azure by Sirajul
• 59,230 points
1,580 views
0 votes
1 answer

How to add co-admin to an azure subscription?

To assign a user as an administrator Sign ...READ MORE

answered Jan 23, 2020 in Azure by Sirajul
• 59,230 points
2,298 views
0 votes
1 answer

How to create an image from an existing disk in Azure?

Hi@akhtar, Sometimes we need to create a custom ...READ MORE

answered Nov 13, 2020 in Azure by MD
• 95,460 points
877 views
0 votes
1 answer

How to create a snapshot by copying an existing disk in Azure?

Hi@akhtar, Azure Managed Disk snapshots are used to create a point ...READ MORE

answered Nov 16, 2020 in Azure by MD
• 95,460 points
646 views
0 votes
1 answer

How to update an existing Kubernetes cluster with new service principal in Azure?

Hi@akhtar, Sometimes it is required to update the ...READ MORE

answered Nov 17, 2020 in Azure by MD
• 95,460 points

edited Oct 7, 2021 by Sarfaraz 1,133 views
+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
2,209 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
4,605 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP