hashicorp / terraform-provider-azure-classic

Terraform Azure Classic (Service Management) provider
https://www.terraform.io/docs/providers/azure/
Mozilla Public License 2.0
2 stars 11 forks source link

Azure provider: Use VM image name instead of label #7

Closed hashibot closed 6 years ago

hashibot commented 7 years ago

This issue was originally opened by @dyep49 as hashicorp/terraform#3595. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform searches for VM images by label. A label is not unique to an image. As a result, Terraform selects the first image with a matching label. In the case of CoreOS, Terraform selects the oldest image. At the very least, users should have the option to create instances by VM image name.

Here's a terrible, quick workaround I've been using:

https://github.com/dyep49/terraform/commit/24afd1db0b8b16b2f2721c8373419631a00802f0?diff=split

Ignore the changes to config/lang/y.go

hashibot commented 7 years ago

This comment was originally opened by @xied75 as https://github.com/hashicorp/terraform/issues/3595#issuecomment-160137353. It was migrated here as part of the provider split. The original comment is below.


@dyep49 I love you, so I just deployed CoreOS Alpha 475.1.0 :)

Apparently searching on label is definitely wrong, this should now be a PR and get merged.

Apparently the bunch who code for Azure are busy on coding TF support of the new ARM mode, yet we still need to carry on to make ASM work.

hashibot commented 7 years ago

This comment was originally opened by @jen20 as https://github.com/hashicorp/terraform/issues/3595#issuecomment-160153962. It was migrated here as part of the provider split. The original comment is below.


Hi @xied75. If you want to submit your diff from above as a pull request I'll look at merging it.

Looking at the diff, could you ensure that changes to config/lang/y.go or any other automatically generated code are not included as part of the commits though?

hashibot commented 7 years ago

This comment was originally opened by @xied75 as https://github.com/hashicorp/terraform/issues/3595#issuecomment-161708201. It was migrated here as part of the provider split. The original comment is below.


@jen20 Thanks for supporting. I did a try above, yet need some discussion here before I make another try or PR this.

The issue is that in the above change I removed using "label" altogether, only searching on VM image name. I can see the problem immediately with this approach in the sense all current TF files will break. That end user would need to find out the long unique VM image name and update their TF files. Which might not be ideal.

On the other hand, I wonder how other providers handle this? e.g. in aws people use ami number, which is unique and not user friendly at all but the world is happy with that. So I reckon doing the same in azure should be "correct" too.

If backward compatibility is hugely important, I can propose another try:

1, search on VM image name, (can only find 0/1) if not found 2, search on OS image name, (can only find 0/1) if not found 3, search on VM image by label, (can find 0+) if not found 4, search on OS image by label, (can find 0+) if not found, err

When >1 found, we can't really do anything to help user here, either choose the first or the last, I would prefer the last.

Although this can be smoother, there are too much assumptions made for the user and it could equally confuse him.

I guess searching on label is really a historic event and frankly it doesn't make any real world sense, it's almost like user wants to pay for a VM "Just pick any CoreOS" for me "I don't care which one you pick"...

p.s. In the new ARM mode, it's publisher plus region stuff, with each image a URN, which is much reasonable design, I would rather settle this asap and switch to work on ARM.

vancluever commented 6 years ago

Hello!

Thank you for opening this issue and participating in the discussion. Today (December 19, 2017) we’ve announced the deprecation and archival of the Azure Classic Provider. Matching Microsoft’s commitment to gradually remove access to Azure Classic (or Service Management) which is outlined in this blog post, we are closing all open PR's and Issues here. This repository will remain available here on GitHub, but in an archived state, and no longer receiving support or new releases.

The Azure (Resource Manager) Provider remains fully supported and is our recommended approach for managing Azure with Terraform. More information about this process is available in the blog post linked above.

Thanks! The Terraform Team