azure-xplat-cli
azure-xplat-cli copied to clipboard
Can't add vm to an existing availability set through command line.
The azure vm command does not provide any interface to add vm to an existing availability set.
these param should help: --availabilty-set argument (in asm) or --avail-set in argument (in arm)
I am using arm mode. I checked azure vm -h, couldn't find any option to add an existing vm to an existing availability set. The availset command which is available in arm mode, is just for managing availability sets.
@greenmang0 , i mean --avail-set argument in vm create command. This should help to add the vm you are creating to an existing availability set.

@anuchandy, Yes, I get that. When I create a new vm I can add it to the existing availability set using above option, but can I add running vm to the existing availability set? I tried it with vm create, but it complains that vm already exists.
@greenmang0 . right now we have only command to associate vm with an availability set during creation time. We don't have command to set it on already created vm. We will investigate and enable command for this, let us keep this issue open.
Okay
This thread is a little old, but it appears that there is no way currently to add a vm to an existing availabilityset. I have tried doing this in PowerShell with no success, the error returned from the server was changing property 'availabilityset.id' is not allowed Basically what I did was grab the availabilitysetreference from a vm that was in the proper set, and then setting the vm.availabilitysetreference equal to that value. PowerShell get-member said that property is get/set able. then I ran update-azurevm and that's what returned the error. If anyone else has had any success it would greatly be appreciated.
le sigh..
Jeff Patton@C02PX3KSG8WL | 16:51:44 | 10-05-2015 | F:\Projects\Lowes\ops\Azure\PowerShell $ [master ≡]
$VM.AvailabilitySetReference |gm
TypeName: Microsoft.Azure.Management.Compute.Models.AvailabilitySetReference
Name MemberType Definition
Equals Method bool Equals(System.Object obj) GetHashCode Method int GetHashCode() GetType Method type GetType() ToString Method string ToString() ReferenceUri Property string ReferenceUri {get;set;}
Jeff Patton@C02PX3KSG8WL | 16:51:47 | 10-05-2015 | F:\Projects\Lowes\ops\Azure\PowerShell $ [master ≡]
$VM.AvailabilitySetReference.ReferenceUri = $AVset.Id
Jeff Patton@C02PX3KSG8WL | 16:52:04 | 10-05-2015 | F:\Projects\Lowes\ops\Azure\PowerShell $ [master ≡]
Update-AzureVM -VM $VM -ResourceGroupName $VM.ResourceGroupName Update-AzureVM : PropertyChangeNotAllowed: Changing property 'availabilitySet.id' is not allowed. OperationID : ### At line:1 char:1
- Update-AzureVM -VM $VM -ResourceGroupName $VM.ResourceGroupName
-
- CategoryInfo : CloseError: (:) [Update-AzureVM], ComputeCloudException - FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.UpdateAzureVMCommand
Is this available yet? How can I add an existing VM to an availability set via the CLI in ARM mode? Annoying
I too am stuck with an existing VM needing to be moved into an existing Availability Set via ARM PowerShell. Currently using 0.9.8 PowerShell in ARM mode. Any update on this?
bump. Any traction on this? Or even with PS?
@sauryadas , @huangpf , please comment
This feature is TBD on the service side, and I believe there is an item for it in the latest planning.
@sauryadas Could you please help check it with Mahesh, and share the timeline, if feasible? Thanks.
Thanks @huangpf a timeline on when this may become available would be amazing.
@sauryadas @huangpf Without being able to re-assign an existing VM to an Availability Set, nor via the Azure Portal nor the CLI, how are we supposed to achieve the Azure SLA? Recreating the VMs?
Mahesh @mahthi will provide an update when he is back
So basically there is no way for me to add a VM to a load balancer without shutting down and completely re-creating the VM?
This is a single click operation in AWS.
@chrisharrison,
You are comparing apples and oranges :)
@greenmang0 You mean azure is not comparable to AWS? Would you mind to elaborate that a little more? I think I can't follow you. :)
+1 @greenmang0 :)
FFS
Pinging on this issue... it looks like I will have to recreate the VMs from scratch?
Ouch... ouch ouch ouch
@huangpf - do we have commands that support this?
Thanks, Amar Zavery
On Feb 16, 2016, at 5:58 AM, "RobHudson72" <[email protected]mailto:[email protected]> wrote:
Pinging on this issue... it looks like I will have to recreate the VMs from scratch?
Ouch... ouch ouch ouch
Reply to this email directly or view it on GitHubhttps://github.com/Azure/azure-xplat-cli/issues/1937#issuecomment-184692695.
I just migrated a 'classic vm' (database) which is now in production to the new ARM model.
Created the availability set but can't add 'db1' and 'db2' to the availability set. Hmm. If my memory is correct, this worked fine in 'classic vm mode'.
@mahthi @sauryadas Please help confirm, but I think it's an IAAS-TBD feature on both the service and client sides.
bump, having the same issue.
I can't even add a NEW vm to an existing availability set using the CLI - is this working for anyone?
To clarify - I see the following output, but the VM is still not a member of the availset once provisioned:
info: Executing command vm create
verbose: Looking up the VM "stg-etcd-1"
info: Verifying the public key SSH file: myCert.pem
info: Using the VM Size "Standard_A0"
info: The [OS, Data] Disk or image configuration requires storage account
verbose: Looking up the storage account psstgstorage
verbose: Looking up the availability set "stg-etcd"
info: Found an Availability set "stg-etcd"
verbose: Looking up the NIC "stg-etcd-1"
info: Found an existing NIC "stg-etcd-1"
info: Found an IP configuration with virtual network subnet id "/subscriptions/d81fd384-a96c-4197-121-bf0006119534/resourceGroups/stg/providers/Microsoft.Network/virtualNetworks/stg-net/subnets/stg-private" in the NIC "stg-etcd-1"
info: This is an NIC without publicIP configured
info: The storage URI 'https://psstgstorage.blob.core.windows.net/' will be used for boot diagnostics settings, and it can be overwritten by the parameter input of '--boot-diagnostics-storage-uri'.
verbose: Creating VM "stg-etcd-1"
info: vm create command OK
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 fault 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 : https://buildwindows.wordpress.com/2016/02/25/add-or-change-an-arm-virtual-machines-availability-set/
sigh...
I'm having the same problem as @gdhagger. Using the CLI in arm-mode I can't seem to add a VM (upon creation) to an existing availset. I'm using the --availset-name flag for vm create, but when I view the availset in the portal there are no VMs listed there. This has a huge impact as when I try to add another VM to the same load balancer I get the following error: "Virtual Machine /subscriptions/.../resourceGroups/.../providers/Microsoft.Compute/virtualMachines/[second created vm] is using different Availability Set than other Virtual Machines connected to the Load Balancer(s) [lb name]."
Anyone else having this issue?