Skip to content

Azure Virtual Machine Scale Set is not returning the publicIPPrefixID after a SKU update #10190

Open
hashicorp/terraform-provider-azurerm
#24939

Description

To reproduce:

  1. Create a VMSS with a publicIPPrefixID assigned by using the following tf config
resource "azurerm_linux_virtual_machine_scale_set" "linux_nvavss" {
  name                            = "test"
  location                        = azurerm_resource_group.main.location
  resource_group_name             = azurerm_resource_group.main.name
  computer_name_prefix            = "dapzhang"
  admin_username                  = "dapzhang"
  admin_password                  = "Passw0rd123!"
  disable_password_authentication = false
  instances                       = 2

  # automatic rolling upgrade
  upgrade_mode = "Manual"
  sku          = "Standard_F2"
 
  zones        = []
  
  source_image_reference {
    publisher = "Canonical"
    offer     = "UbuntuServer"
    sku       = "16.04-LTS"
    version   = "latest"
  }
 
  os_disk {
    caching              = "ReadWrite"
    storage_account_type = "Standard_LRS"
  }
 
  network_interface {
    name                          = "eth0"
    primary                       = true
    enable_accelerated_networking = true
    enable_ip_forwarding          = false
    ip_configuration {
      name                                   = "ipconfig1"
      primary                                = true
      subnet_id                              = azurerm_subnet.front.id
      load_balancer_backend_address_pool_ids = [azurerm_lb_backend_address_pool.test.id]
      public_ip_address {
        name                    = "instancePublicIP"
        idle_timeout_in_minutes = 30
        domain_name_label       = "testdomain"
        public_ip_prefix_id     = azurerm_public_ip_prefix.test.id
      }
    }
  }
}
  1. Update the VMSS sku with the following request body:
   "properties": {
        "upgradePolicy": {
            "mode": "Manual"
        },
        "virtualMachineProfile": {
            "networkProfile": {
                "networkInterfaceConfigurations": [
                    {
                        "name": "eth0",
                        "properties": {
                            "primary": true,
                            "enableAcceleratedNetworking": true,
                            "dnsSettings": {
                                "dnsServers": []
                            },
                            "ipConfigurations": [
                                {
                                    "name": "ipconfig1",
                                    "properties": {
                                        "subnet": {
                                            "id": "/subscriptions/85b3dbca-0000-0000-0000-67a141095a76/resourceGroups/test/providers/Microsoft.Network/virtualNetworks/network/subnets/front"
                                        },
                                        "primary": true,
                                        "publicIPAddressConfiguration": {
                                            "name": "instancePublicIP",
                                            "properties": {
                                                "idleTimeoutInMinutes": 30,
                                                "dnsSettings": {
                                                    "domainNameLabel": "testdomain"
                                                }
                                            }
                                        },
                                        "privateIPAddressVersion": "IPv4",
                                        "applicationGatewayBackendAddressPools": [],
                                        "applicationSecurityGroups": [],
                                        "loadBalancerBackendAddressPools": [
                                            {
                                                "id": "/subscriptions/85b3dbca-0000-0000-0000-67a141095a76/resourceGroups/test/providers/Microsoft.Network/loadBalancers/acctestlb-001/backendAddressPools/test"
                                            }
                                        ],
                                        "loadBalancerInboundNatPools": []
                                    }
                                }
                            ],
                            "enableIPForwarding": false
                        }
                    }
                ]
            }
        }
    },
    "sku": {
        "name": "Standard_D3_v2",
        "tier": "Standard",
        "capacity": 2
    }
}
  1. Get the updated VMSS and found publicIPPrefixID is empty.

Here are two assumptions:

  1. The PATCH request erased the public ip prefix
  2. The PATCH request did not change the public ip prefix, but it just did not returned after the PATCH is done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

NetworkService AttentionWorkflow: This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions