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

Question : how to configure Auto-Shutdown with azurerm_virtual_machine resource? #2169

Closed
guitarrapc opened this issue Oct 28, 2018 · 7 comments

Comments

@guitarrapc
Copy link

Hi, I'm wondering how to set Auto-shutdown with azurerm_virtual_machine resource.

https://azure.microsoft.com/ja-jp/blog/announcing-auto-shutdown-for-vms-using-azure-resource-manager/

Is there any way to configure it with https://www.terraform.io/docs/providers/azurerm/r/virtual_machine.html ?

@bostrowski13
Copy link

wondering the same thing

@tombuildsstuff
Copy link
Contributor

hi @guitarrapc @bostrowski13

Thanks for opening this issue :)

Taking a look into how the Azure Portal achieves this - it appears it configures a Schedule inside of DevTest Labs (even for Virtual Machines not provisioned using/attached with DevTest Labs) - since the "Auto Shutdown" page for a Virtual Machine makes a request out to this URL:

https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acctestRG-727834829814149628/providers/Microsoft.DevTestLab/schedules/shutdown-computevm-acctestvm?api-version=2018-10-15-preview

As such, I believe this would require a DevTest Labs Schedule to be configured to be used (it may also be possible through Azure Automation, but I'm unsure). We don't support DevTest Labs Schedules natively in Terraform at this time - if you'd like to see support for these please open an issue about it and we'll take a look - however since this issue is a question about how to configure Auto Shutdown I'm going to close this for the moment.

Thanks!

@Yvand
Copy link

Yvand commented Nov 12, 2018

Hi @tombuildsstuff sorry but you need to clarify a few things:
In this post you state it's not supported, but last year you opened #132 and explicitly referenced hashicorp/terraform-provider-azure-classic#36 to mention that you added support for DevTestLabs / auto-shutdown in 1.16.

So now I'm very confused what is the real status for those DevTest labs resources, and specifically the auto-shutdown?

Thanks!

@tombuildsstuff
Copy link
Contributor

@Yvand thanks for your interest in this :)

In this post you state it's not supported, but last year you opened #132 and explicitly referenced hashicorp/terraform-provider-azure-classic#36 to mention that you added support for DevTestLabs / auto-shutdown in 1.16.
So now I'm very confused what is the real status for those DevTest labs resources, and specifically the auto-shutdown?

DevTest Labs, Virtual Networks and Virtual Machines are supported at this time.

Since #132 is a meta-issue containing multiple issues / functionality - we've asked folks to open a separate Github issue if they're interested in additional functionality within Dev Test Labs so we can investigate/prioritise it accordingly.

Thanks!

@Yvand
Copy link

Yvand commented Nov 14, 2018

Ok, I missed the comment saying that separate issues should be opened.
Thank you for the explanation

@guitarrapc
Copy link
Author

@tombuildsstuff thank you for the clarification. I've added Feature Request issue, Let's see how others vote.

@ghost
Copy link

ghost commented Mar 5, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

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

No branches or pull requests

4 participants