Terraform-provider-azurerm: Question : how to configure Auto-Shutdown with azurerm_virtual_machine resource?

Created on 28 Oct 2018  ·  7Comments  ·  Source: terraform-providers/terraform-provider-azurerm

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 ?

question servicvirtual-machine

Most helpful comment

@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 terraform-providers/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!

All 7 comments

wondering the same thing

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!

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 https://github.com/terraform-providers/terraform-provider-azurerm/issues/132 and explicitly referenced https://github.com/terraform-providers/terraform-provider-azure-classic/issues/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!

@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 terraform-providers/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!

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

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

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!

Was this page helpful?
0 / 5 - 0 ratings