- November 27, 2017
- Posted by: Loges
- Category: Blog, Cloud Computing
Steps to add existing VM into High Availability Set
In this blog, we will show you the Steps to add existing VM into High Availability set using Microsoft Azure Portal.
- Azure Subscription
- Azure VM
- We have already created a new vm named az-ha-vm-01 and a new availability set named VM-High-Availability-Set.
- You can able to configure the high availability set only during VM creation.
- To confirm that, access the VM properties of a VM in the Azure portal and click on availability set. You will see the below information.
- So, we are adding the existing VM to an availability set using PowerShell script.
DOWNLOAD VM HIGH AVAILABILITY SET
- Login into Microsoft and access the URL https://gallery.technet.microsoft.com/Set-Azure-Resource-Manager-f7509ec4
- Download the Set-ARmVmAvailabilitySet.ps1 script to your local machine.
- We have downloaded under c:\scripts folder for this demo.
RUNNING THE POWERSHELL SCRIPT
- Open the PowerShell window and execute the below command.
Syntax: Set-ArmVmAvailabilitySet.ps1 -VmName <Name of the VM> -ResourceGroup <Resourcegroup name> -AvailabilitySetName <Provide the high availability name>
Example: Set-ArmVmAvailabilitySet.ps1 -VmName az-ha-vm-01 -ResourceGroup az-resourcegroup -AvailabilitySetName VM-High-Availability-Set
- It will prompt for azure login credentials.
- Then it will prompt us to select the Azure subscription.
- It will validate the VM and availability set details.
- This script will destroy the existing VM and create an identical one with same name and its settings. This is the workaround for this limitation as of now.
- Log in to Azure portal and select availability set from the service list.
- Click on the availability set name.
- You can see one virtual machine has been added to this availability set.
Thanks for reading this blog. We hope it was useful for you to learn the workaround steps to add the existing VM into an availability set.