Added the following blocks to all azurerm_virtual_machine and azurerm_virtual_machine_scale_set:
timeouts {
read = "60m"
}
What’s happening, I believe, is that Azure takes forever to make VMs, and will lie about having created it, so the Azure provider makes the call to create a resource, then sits there polling for it. If it takes longer than five minutes (the default setting for the read timeout), then it gives up. When it gives up, the resource isn’t put in the Terraform state.
In this track we pre-provision a bunch of stuff during the track setup so that it’s ready for students as they go through the challenges. So we try to create a VM during track setup, it takes too long, Terraform gives up. Then we get to the challenge where we’d use that resource, and we run the Terraform command (like we tell students to do during that challenge) to create those resources. By that point the VM exists, but because it isn’t in the Terraform state TF tries to create it again, sees that it already exists, and tells you “This already exists, you need to import this resource into your Terraform state”, which is not only confusing for a student but also gums up our test suite.
Added the following blocks to all
azurerm_virtual_machine
andazurerm_virtual_machine_scale_set
:What’s happening, I believe, is that Azure takes forever to make VMs, and will lie about having created it, so the Azure provider makes the call to create a resource, then sits there polling for it. If it takes longer than five minutes (the default setting for the read timeout), then it gives up. When it gives up, the resource isn’t put in the Terraform state.
In this track we pre-provision a bunch of stuff during the track setup so that it’s ready for students as they go through the challenges. So we try to create a VM during track setup, it takes too long, Terraform gives up. Then we get to the challenge where we’d use that resource, and we run the Terraform command (like we tell students to do during that challenge) to create those resources. By that point the VM exists, but because it isn’t in the Terraform state TF tries to create it again, sees that it already exists, and tells you “This already exists, you need to import this resource into your Terraform state”, which is not only confusing for a student but also gums up our test suite.