Open vangork opened 2 months ago
@vangork interesting have you tried with version 4.2.0?
@Chambras I've checked the code, there is no change between 4.2.0 and 3.116.0 for azurerm_virtual_machine_run_command
.
I am guessing that extensions_time_budget
with defalt value 90 mins of azurerm_linux_virtual_machine
cause the limitation, but this value can only be set to [15mins, 120mins].
Shall we allow a wider range for extensions_time_budget
?
Hi @vangork , there is a blog might help, for now the azurerm_virtual_machine_run_command
resource only supports synchronous mode, by review comment. As for azurerm_linux_virtual_machine.extensions_time_budget
this seems a API limitation for the value must be '15' and '120' minutes, sending 180
will get error message
performing CreateOrUpdate: unexpected status 400 (400 Bad Request) with error: InvalidParameter: The value 180 of parameter 'extensionsTimeBudget' is out of range. The value must be between '15' and '120', inclusive.
@teowa Thanks for the info. Even if azurerm_virtual_machine_run_command
support async mode later, it doesn't solve my problem. The custom-data
which uses cloud-init agent of azurerm_linux_virtual_machine
already can help with async long running job creation post vm creation. I just need a way to track the successful execution of the job, get the output for downstream resources and move forward. Currently I only found custom-data, user-data, CustomScript and RunCommand to excute a command inside of the vm, but unfortunately none of them supports a timeout of 3 hours. Do you see other ways if I can do that?
Is there an existing issue for this?
Community Note
Terraform Version
1.7.5
AzureRM Provider Version
3.116.0
Affected Resource(s)/Data Source(s)
azurerm_virtual_machine_run_command
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
My vm has a "pfmp installation" job which would last around 2 - 2.5 hours being set in the
custom_data
. I wanna leverage managed run command of "cloud-init status --wait" to check if the job is done and move forward. As per https://learn.microsoft.com/en-us/azure/virtual-machines/linux/run-command-managed, managed run command should support for long running (hours/days) scripts.Actual Behaviour
But the managed run command would timeout after 90 minutes even the create timeout value has been set to 180m.
Steps to Reproduce
No response
Important Factoids
No response
References
No response