简体   繁体   中英

Azure Resource Manager: move VM to availability group

Can't seem to figure out how to change the availability set of an existing Azure VM in the Resource Manager stack. There's no interface for it. Set-AzureAvailabilitySet does not exist in the Azure Powershell tools when in ResourceManager mode. It does exist in service stack mode. But that doesn't help me.

AFAIK, this feature may be addressed by the end of this year. It's a big challenge for the MS team to allow such operation. Changing the availability Set requires a review of the VM mobility architecture on Azure. Fore example, adding a VM in an Availability Set already containing a VM means putting it to different default domain. Becasue VM mobilty is a matter on Azure (No Live Migration), it's not an easy operation.

I have written a Powershell script which let you change the AS of an ARM VM by recreating it.
Give it a try and enjoy:

How to use it ?

1- Download the script and save it to local location

2- Run it and provide the requested parameters

or

2- ./Set-ArmVmAvailabilitySet.ps1 –VmName 'The VM Name' –ResourceGroup 'Resource Group' –AvailabilitySetName 'As Name' –SubscriptionName 'The Subscription name'

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

Version 1.01 : https://gallery.technet.microsoft.com/Set-Azure-Resource-Manager-f7509ec4

Source

该功能尚未在ARM堆栈中实现,这就是您没有看到cmdlet的原因......

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM