Availability set in azure
An availability set helps keep your virtual machines available during downtime, such as during maintenance. Placing two or more similarly configured virtual machines in an availability set creates the redundancy needed to maintain availability of the applications or services that your virtual machine runs.
•Planned maintenance events are periodic updates made by Microsoft to the underlying Azure platform to improve overall reliability, performance, and security of the platform infrastructure that your virtual machines run on. Most of these updates are performed without any impact upon your virtual machines or cloud services. However, there are instances where these updates require a reboot of your virtual machine to apply the required updates to the platform infrastructure.
•Unplanned maintenance events occur when the hardware or physical infrastructure underlying your virtual machine has faulted in some way. This may include local network failures, local disk failures, or other rack level failures. When such a failure is detected, the Azure platform automatically migrates your virtual machine from the unhealthy physical machine hosting your virtual machine to a healthy physical machine. Such events are rare, but may also cause your virtual machine to reboot.
When adding VMs to an Availability Set, Azure automatically assigns each VM an Update Domain and a Fault Domain. By default Availability Sets have two Fault Domains, each sharing a common power source and network switch, and VMs are automatically separated across the Fault Domains.
1- Download the script and save it to local location
2- Run it and provide the requested parameters
2- ./Set-ArmVmAvailabilitySet.ps1 –VmName ‘The VM Name’ –ResourceGroup ‘Resource Group’ –AvailabilitySetName ‘As Name’ –SubscriptionName ‘The Subscription name’
•can’t change the VM’s Availability Set once the VM is created
•can’t add an Azure VM to an Availability Set once the VM is created
•can’t remove a VM from an Availability Set
To remove a VM from an AvailabilitySet:
./Set-ArmVmAvailabilitySet.ps1 –VmName ‘The VM Name’ –ResourceGroup ‘Resource Group’ –AvailabilitySetName 0 –SubscriptionName ‘The Subscription name’
Download Link: https://gallery.technet.microsoft.com/Set-Azure-Resource-Manager-f7509ec4
6.Choose the VM size and then click Select to continue.
7.Choose Optional Configuration > Availability set, and select the availability set you wish to add the virtual machine to.