Open JanVidarElven opened 3 years ago
resource "azurerm_windows_virtual_machine" "vm" {
name = "vmthfa02" # Simplified for testing
location = var.azure_region
resource_group_name = azurerm_resource_group.authservicesresourcegroup.name
size = "Standard_D4s_v4"
admin_username = "adminuser"
admin_password = "P@ssw0rd123" # Use a secure password or use key vault for storing it
network_interface_ids = [azurerm_network_interface.nicvfkvm.id]
os_disk {
name = "mdisk-${var.server_name}-os"
caching = "ReadWrite"
storage_account_type = "StandardSSD_LRS"
}
source_image_reference {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2019-Datacenter"
version = "latest"
}
boot_diagnostics {
storage_account_uri = module.deploy-assets.diagstorageaccount_uri
}
provision_vm_agent = true
enable_automatic_updates = false
patch_mode = "Manual"
license_type = "None"
timezone = "W. Europe Standard Time"
tags = var.deployment_tags
}
Community Note
Terraform (and AzureRM Provider) Version
TerraForm 1.0.8, AzureRM Provider version 2.79.1
Affected Resource(s)
azurerm_windows_virtual_machine
Terraform Configuration Files
Module Configuration
Debug Output
Panic Output
Expected Behaviour
Windows Virtual Machine should be created successfully. I have been using this module config many times for this project, only last few weeks this has been starting to error.
Actual Behaviour
Every VM tries to create for over 10 minutes before this is returned in VS Code: │ Error: creating Windows Virtual Machine "vmthfa02" (Resource Group "rg-authservices"): compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InternalOperationError" Message="An internal error occurred in the operation." │ │ with module.windows-server-fas["vmthfa02"].azurerm_windows_virtual_machine.vm, │ on .terraform\modules\windows-server-fas\windows-server\server.tf line 24, in resource "azurerm_windows_virtual_machine" "vfkvm": │ 24: resource "azurerm_windows_virtual_machine" "vm" {
There is nothing more of info that helps me find where the error is.
Steps to Reproduce
terraform apply
Important Factoids
It should be noted that if I try to create this server in TerraForm without using a module, just manually specifiying the exact same values it works.
References
0000