Closed SlavisaBakicOB closed 8 months ago
Hi @SlavisaBakicOB thanks for opening the issue! When upgrade_mode
is set to Manual
, changing sku
on Azure Portal is quick since it doesn't update the sku
for existing VM in the scale set. In Terraform however, it is designed to run without manual operation outside Terraform, thus even with the Manual upgrade mode, we still do an update to the VM inside the scale set.
https://github.com/hashicorp/terraform-provider-azurerm/blob/c7e7b2b1982274cb7c509e495934d2a60dab18a0/internal/services/compute/virtual_machine_scale_set_update.go#L59-L60
This is unfortunate. As SlavisaBakicOB said above, when changing the sku
- not unlike when manually changing it in the portal - it would be nice to preserve the OS disk.
For me, the speed of the deployment isn't an issue. It is our customers who have changed the VM sku (for whatever reason they have), and are surprised when their OS disk has been re-formated.
I realize that a VM and a VMSS are separate resources altogether, however the virtual_machine has a delete_os_disk_on_termination argument and it would be nice to have a similar flag like that.
sku
in the azurerm_virtual_machine_scale_set
to match the manually set size.terraform plan
to validate the change:
@geglne
I've been adding a feature flag to skip the reimage process during the upgrade when upgrade_mode
is Manual
with #22975.
By specifying its value to false, the OS disk shall be preserved after the update.
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.
Is there an existing issue for this?
Community Note
Terraform Version
1.2.7
AzureRM Provider Version
3.19.1
Affected Resource(s)/Data Source(s)
azurerm_windows_virtual_machine_scale_set
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
TF should just change size if only sku attribute is changed without redeploying whole VMSS resource. Manually chaning VMSS Size via Portal is completed in less than 10 seconds and VMSS is not recreated.
Actual Behaviour
TF redeployed whole VMSS resource which can take up to 5 minutes instead of just changing VMSS sku which should not take more than 20 seconds.
Steps to Reproduce
No response
Important Factoids
No response
References
No response