Steps To Add Existing VM Into High Availability Set

Steps To Add Existing VM Into High Availability Set

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.

REQUIREMENTS

  • Azure Subscription
  • Azure VM

ENVIRONMENT OVERVIEW

  • We have already created a new vm named az-ha-vm-01 and a new availability set named VM-High-Availability-Set.
Steps to add existing VM into High Availability Set
Steps to add existing VM into 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.
Steps to add existing VM into High Availability Set
  • So, we are adding the existing VM to an availability set using PowerShell script.

DOWNLOAD VM HIGH AVAILABILITY SET

Steps to add existing VM into High Availability Set
  • Download the Set-ARmVmAvailabilitySet.ps1 script to your local machine.
Steps to add existing VM into High Availability Set
  • We have downloaded under c:\scripts folder for this demo.
Steps to add existing VM into High Availability Set

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

Steps to add existing VM into High Availability Set
  • It will prompt for azure login credentials.
Steps to add existing VM into High Availability Set
  • Then it will prompt us to select the Azure subscription.
Steps to add existing VM into High Availability Set
  • It will validate the VM and availability set details.
Steps to add existing VM into High Availability Set
  • 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.
Steps to add existing VM into High Availability Set

VERIFICATION

  • Log in to Azure portal and select availability set from the service list.
Steps to add existing VM into High Availability Set
  • Click on the availability set name.
Steps to add existing VM into High Availability Set
  • You can see one virtual machine has been added to this availability set.
Steps to add existing VM into High Availability Set
VIDEO

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.

Loges

Leave a Reply

Your email address will not be published. Required fields are marked *