Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Initial Work to create AzureRM Extensions #6548

Closed
wants to merge 1 commit into from

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented May 9, 2016

Work to allow AzureRM Extensions (for things like joining a domain)

  • schema
  • CRUD
  • acceptance tests
  • documentation

@stack72
Copy link
Contributor Author

stack72 commented May 9, 2016

Basic creation and deletion is currently done.

make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachineExtension_basic' 2>~/tf.log
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/azurerm -v -run=TestAccAzureRMVirtualMachineExtension_basic -timeout 120m
=== RUN   TestAccAzureRMVirtualMachineExtension_basic
--- PASS: TestAccAzureRMVirtualMachineExtension_basic (606.63s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm    606.653s

The trouble we have right now is the settings, Azure takes the following structure:

Settings                *map[string]interface{}              `json:"settings,omitempty"`

Settings needs to have the following JSON structure:

"settings": {
      "fileUris": [ "scriptFilePath"],
      "commandToExecute": "command"
    }

So the fileUris list needs to be created as part of the map..

USeful link for creation: https://azure.microsoft.com/en-us/blog/automate-linux-vm-customization-tasks-using-customscript-extension/

@stack72 stack72 changed the title Initial Work to create AzureRM Extensions [WIP] Initial Work to create AzureRM Extensions May 9, 2016
@clintonm9
Copy link

@stack72 This feature would be perfect for our use case. If you need anyone to test, just let me know.

@clintonm9
Copy link

@stack72 I got to spend some time playing with this feature today. Seems very useful to us AzureRM people.

I ended up using version 1.4 of the customScriptForLinux (type_handler_version = "1.4")

I got the commandToExecute to work well. Did you get to the point where you could set an array of file_uris?

Thanks

@stack72
Copy link
Contributor Author

stack72 commented May 10, 2016

oh you have tried this branch?

@clintonm9
Copy link

I did, hope that is ok.

@stack72
Copy link
Contributor Author

stack72 commented May 10, 2016

that's brilliant that it sort of worked for you :)

I will get the fileUrls working - I have some issues to fix first due to their SDK api for that part :(

@stack72
Copy link
Contributor Author

stack72 commented May 17, 2016

@clintonm9

So I am not that familiar with Azure VMs. What sources would you use for a file uri here? Can I just put a simple bash script into a github gist and use that?

P.

@clintonm9
Copy link

@stack72

You are correct. That would work.

We currently upload to a storage account in azure then link from there with our powershell scripts.

@stack72
Copy link
Contributor Author

stack72 commented May 17, 2016

and for that scenario you would need private_settings declared as well right?

@clintonm9
Copy link

Currently we are not using the SA name and key (if this is what private_setting is).

We just set the files to Blob (which makes them accessible from a public url)

@clintonm9
Copy link

@stack72 Any updates on when this PR will be completed?

Thanks!

@stack72
Copy link
Contributor Author

stack72 commented Jun 1, 2016

ok, after looking into this more, there is no way that this is easily achieved with Terraform. The Extension schema is very specific to each extension type. The work here is only for CustomExtensions. We can continue down that path if we want to but this will then only work for that type

There are many different types: https://acom-swtest-2.azurewebsites.net/en-gb/documentation/articles/virtual-machines-extensions-configuration-samples-linux/

@jen20 would love your thoughts here

P

@jen20
Copy link
Contributor

jen20 commented Jun 1, 2016

I guess we should support some of the ones that seem useful (on a case-by-case basis) on that page and the custom one that is part of this PR. I don't know offhand what is useful though!

@gambrose
Copy link
Contributor

@stack72
What is the status of vm extensions? You seemed to imply that it was too hard to do. So I'm thinking this feature my have been put on ice. But I'm hoping you have some master plan as I think this is a really important feature to support.

I have been adding extensions to my vms using azurerm_template_deployment after the vm has been created but this seems pretty hacky.

You linked to VM extensions from Linux. For what is worth these extensions are really useful for windows vms as well. I mostly use the DSC one myself to bootstrap the vm configuration.

Also if there is a plan for vm extensions would this include adding extensions to vm scale sets?

@stack72
Copy link
Contributor Author

stack72 commented Aug 15, 2016

Hi all

I am going to close this out. I am not getting time right now to circle back to it but i know that @tombuildsstuff is looking at this :)

P.

@stack72 stack72 closed this Aug 15, 2016
pmcatominey pushed a commit to BedeGaming/terraform that referenced this pull request Nov 8, 2016
Picked up from where hashicorp#6548 left off

settings and protected_settings take JSON objects as strings to make extension
generic

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m
=== RUN   TestAccAzureRMVirtualMachineExtension_importBasic
--- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (810.44s)
=== RUN   TestAccAzureRMVirtualMachineExtension_basic
--- PASS: TestAccAzureRMVirtualMachineExtension_basic (839.55s)
=== RUN   TestAccAzureRMVirtualMachineExtension_concurrent
--- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (689.69s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	2339.695s
pmcatominey pushed a commit to BedeGaming/terraform that referenced this pull request Nov 8, 2016
Picked up from where hashicorp#6548 left off

settings and protected_settings take JSON objects as strings to make extension
generic

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m
=== RUN   TestAccAzureRMVirtualMachineExtension_importBasic
--- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (810.44s)
=== RUN   TestAccAzureRMVirtualMachineExtension_basic
--- PASS: TestAccAzureRMVirtualMachineExtension_basic (839.55s)
=== RUN   TestAccAzureRMVirtualMachineExtension_concurrent
--- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (689.69s)
PASS
ok          github.com/hashicorp/terraform/builtin/providers/azurerm        2339.695s
pmcatominey pushed a commit to BedeGaming/terraform that referenced this pull request Nov 9, 2016
Picked up from where hashicorp#6548 left off

settings and protected_settings take JSON objects as strings to make extension
generic

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m
=== RUN   TestAccAzureRMVirtualMachineExtension_importBasic
--- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (810.44s)
=== RUN   TestAccAzureRMVirtualMachineExtension_basic
--- PASS: TestAccAzureRMVirtualMachineExtension_basic (839.55s)
=== RUN   TestAccAzureRMVirtualMachineExtension_concurrent
--- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (689.69s)
PASS
ok          github.com/hashicorp/terraform/builtin/providers/azurerm        2339.695s
pmcatominey pushed a commit to BedeGaming/terraform that referenced this pull request Nov 9, 2016
Picked up from where hashicorp#6548 left off

settings and protected_settings take JSON objects as strings to make extension
generic

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m
=== RUN   TestAccAzureRMVirtualMachineExtension_importBasic
--- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (697.55s)
=== RUN   TestAccAzureRMVirtualMachineExtension_basic
--- PASS: TestAccAzureRMVirtualMachineExtension_basic (824.17s)
=== RUN   TestAccAzureRMVirtualMachineExtension_concurrent
--- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (929.74s)
=== RUN   TestAccAzureRMVirtualMachineExtension_linuxDiagnostics
--- PASS: TestAccAzureRMVirtualMachineExtension_linuxDiagnostics (803.19s)
PASS
ok 	github.com/hashicorp/terraform/builtin/providers/azurerm	3254.663s
stack72 pushed a commit that referenced this pull request Nov 9, 2016
Picked up from where #6548 left off

settings and protected_settings take JSON objects as strings to make extension
generic

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m
=== RUN   TestAccAzureRMVirtualMachineExtension_importBasic
--- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (697.55s)
=== RUN   TestAccAzureRMVirtualMachineExtension_basic
--- PASS: TestAccAzureRMVirtualMachineExtension_basic (824.17s)
=== RUN   TestAccAzureRMVirtualMachineExtension_concurrent
--- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (929.74s)
=== RUN   TestAccAzureRMVirtualMachineExtension_linuxDiagnostics
--- PASS: TestAccAzureRMVirtualMachineExtension_linuxDiagnostics (803.19s)
PASS
ok 	github.com/hashicorp/terraform/builtin/providers/azurerm	3254.663s
stack72 pushed a commit that referenced this pull request Nov 9, 2016
Picked up from where #6548 left off

settings and protected_settings take JSON objects as strings to make extension
generic

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m
=== RUN   TestAccAzureRMVirtualMachineExtension_importBasic
--- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (697.55s)
=== RUN   TestAccAzureRMVirtualMachineExtension_basic
--- PASS: TestAccAzureRMVirtualMachineExtension_basic (824.17s)
=== RUN   TestAccAzureRMVirtualMachineExtension_concurrent
--- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (929.74s)
=== RUN   TestAccAzureRMVirtualMachineExtension_linuxDiagnostics
--- PASS: TestAccAzureRMVirtualMachineExtension_linuxDiagnostics (803.19s)
PASS
ok 	github.com/hashicorp/terraform/builtin/providers/azurerm	3254.663s
@stack72 stack72 deleted the arm-vm-extensions branch November 25, 2016 16:27
gusmat pushed a commit to gusmat/terraform that referenced this pull request Dec 6, 2016
)

Picked up from where hashicorp#6548 left off

settings and protected_settings take JSON objects as strings to make extension
generic

TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m
=== RUN   TestAccAzureRMVirtualMachineExtension_importBasic
--- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (697.55s)
=== RUN   TestAccAzureRMVirtualMachineExtension_basic
--- PASS: TestAccAzureRMVirtualMachineExtension_basic (824.17s)
=== RUN   TestAccAzureRMVirtualMachineExtension_concurrent
--- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (929.74s)
=== RUN   TestAccAzureRMVirtualMachineExtension_linuxDiagnostics
--- PASS: TestAccAzureRMVirtualMachineExtension_linuxDiagnostics (803.19s)
PASS
ok 	github.com/hashicorp/terraform/builtin/providers/azurerm	3254.663s
@ghost
Copy link

ghost commented Apr 19, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants