azure-xplat-cli icon indicating copy to clipboard operation
azure-xplat-cli copied to clipboard

Can't add vm to an existing availability set through command line.

Open greenmang0 opened this issue 10 years ago • 61 comments

The azure vm command does not provide any interface to add vm to an existing availability set.

greenmang0 avatar Jul 20 '15 12:07 greenmang0

these param should help: --availabilty-set argument (in asm) or --avail-set in argument (in arm)

anuchandy avatar Jul 20 '15 19:07 anuchandy

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 avatar Jul 21 '15 12:07 greenmang0

@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.

image

anuchandy avatar Jul 21 '15 17:07 anuchandy

@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 avatar Jul 22 '15 05:07 greenmang0

@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.

anuchandy avatar Jul 22 '15 05:07 anuchandy

Okay

greenmang0 avatar Jul 22 '15 06:07 greenmang0

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.

jeffpatton1971 avatar Sep 22 '15 21:09 jeffpatton1971

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
    

jeffpatton1971 avatar Oct 05 '15 21:10 jeffpatton1971

Is this available yet? How can I add an existing VM to an availability set via the CLI in ARM mode? Annoying

bitsofinfo avatar Nov 04 '15 15:11 bitsofinfo

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?

damienmci avatar Nov 06 '15 02:11 damienmci

bump. Any traction on this? Or even with PS?

sepiroth887 avatar Dec 23 '15 00:12 sepiroth887

@sauryadas , @huangpf , please comment

yugangw-msft avatar Dec 27 '15 03:12 yugangw-msft

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.

huangpf avatar Dec 27 '15 04:12 huangpf

Thanks @huangpf a timeline on when this may become available would be amazing.

jeffpatton1971 avatar Dec 28 '15 15:12 jeffpatton1971

@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?

FdezRomero avatar Jan 11 '16 23:01 FdezRomero

Mahesh @mahthi will provide an update when he is back

sauryadas avatar Jan 13 '16 01:01 sauryadas

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 avatar Jan 22 '16 04:01 chrisharrison

@chrisharrison,

You are comparing apples and oranges :)

greenmang0 avatar Jan 23 '16 04:01 greenmang0

@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. :)

despairblue avatar Jan 23 '16 14:01 despairblue

+1 @greenmang0 :)

bitsofinfo avatar Jan 27 '16 20:01 bitsofinfo

FFS

sijday avatar Feb 01 '16 13:02 sijday

Pinging on this issue... it looks like I will have to recreate the VMs from scratch?

Ouch... ouch ouch ouch

RobHudson72 avatar Feb 16 '16 13:02 RobHudson72

@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.

amarzavery avatar Feb 16 '16 16:02 amarzavery

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'.

jbondc avatar Feb 16 '16 16:02 jbondc

@mahthi @sauryadas Please help confirm, but I think it's an IAAS-TBD feature on both the service and client sides.

huangpf avatar Feb 16 '16 17:02 huangpf

bump, having the same issue.

PSDhao avatar Feb 22 '16 22:02 PSDhao

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

gdhagger avatar Feb 24 '16 20:02 gdhagger

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/

SamirFarhat avatar Feb 29 '16 14:02 SamirFarhat

sigh...

bitsofinfo avatar Feb 29 '16 14:02 bitsofinfo

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?

jotunskij avatar Mar 02 '16 12:03 jotunskij