Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plan always shows azurerm_virtual_machine_scale_set change when nothing was changed #11626

Closed
guoshimin opened this issue Feb 2, 2017 · 3 comments

Comments

@guoshimin
Copy link

Terraform Version

v0.8.5

Affected Resource(s)

azurerm_virtual_machine_scale_set

Terraform Configuration Files

{
   "provider": {
      "azurerm": {
         "client_id": "[REDACTED]",
         "client_secret": "[REDACTED]",
         "subscription_id": "[REDACTED]",
         "tenant_id": "[REDACTED]"
      }
   },
   "resource": {
      "azurerm_availability_set": {
         "master": {
            "location": "westus",
            "name": "master",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_lb": {
         "master_lb": {
            "frontend_ip_configuration": {
               "name": "master-lb-ipconfig",
               "public_ip_address_id": "${azurerm_public_ip.master.id}"
            },
            "location": "westus",
            "name": "master-lb",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_lb_backend_address_pool": {
         "master_pool": {
            "loadbalancer_id": "${azurerm_lb.master_lb.id}",
            "location": "westus",
            "name": "master-pool",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_lb_nat_rule": {
         "ssh": {
            "backend_port": 22,
            "frontend_ip_configuration_name": "master-lb-ipconfig",
            "frontend_port": 22,
            "loadbalancer_id": "${azurerm_lb.master_lb.id}",
            "location": "westus",
            "name": "master-ssh",
            "protocol": "Tcp",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_lb_probe": {
         "https_probe": {
            "interval_in_seconds": 5,
            "loadbalancer_id": "${azurerm_lb.master_lb.id}",
            "location": "westus",
            "name": "https-probe",
            "number_of_probes": 2,
            "port": 443,
            "protocol": "Tcp",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_lb_rule": {
         "https": {
            "backend_address_pool_id": "${azurerm_lb_backend_address_pool.master_pool.id}",
            "backend_port": 443,
            "enable_floating_ip": false,
            "frontend_ip_configuration_name": "master-lb-ipconfig",
            "frontend_port": 443,
            "idle_timeout_in_minutes": 5,
            "load_distribution": "Default",
            "loadbalancer_id": "${azurerm_lb.master_lb.id}",
            "location": "westus",
            "name": "https",
            "probe_id": "${azurerm_lb_probe.https_probe.id}",
            "protocol": "Tcp",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_network_interface": {
         "master_nic": {
            "enable_ip_forwarding": true,
            "ip_configuration": [
               {
                  "load_balancer_backend_address_pools_ids": [
                     "${azurerm_lb_backend_address_pool.master_pool.id}"
                  ],
                  "load_balancer_inbound_nat_rules_ids": [
                     "${azurerm_lb_nat_rule.ssh.id}"
                  ],
                  "name": "ipconfig1",
                  "private_ip_address": "10.120.255.5",
                  "private_ip_address_allocation": "Static",
                  "subnet_id": "${azurerm_subnet.kube-subnet.id}"
               }
            ],
            "location": "westus",
            "name": "masternic",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_network_security_group": {
         "kube_nsg": {
            "location": "westus",
            "name": "kube_nsg",
            "resource_group_name": "${azurerm_resource_group.kube.name}",
            "security_rule": [
               {
                  "access": "Allow",
                  "description": "Allow SSH traffic to master",
                  "destination_address_prefix": "*",
                  "destination_port_range": "22-22",
                  "direction": "Inbound",
                  "name": "allow_ssh",
                  "priority": 101,
                  "protocol": "Tcp",
                  "source_address_prefix": "*",
                  "source_port_range": "*"
               },
               {
                  "access": "Allow",
                  "description": "Allow kube-apiserver (tls) traffic to master",
                  "destination_address_prefix": "*",
                  "destination_port_range": "443-443",
                  "direction": "Inbound",
                  "name": "allow_kube_tls",
                  "priority": 100,
                  "protocol": "Tcp",
                  "source_address_prefix": "*",
                  "source_port_range": "*"
               }
            ]
         }
      },
      "azurerm_public_ip": {
         "master": {
            "domain_name_label": "monkey",
            "location": "westus",
            "name": "master",
            "public_ip_address_allocation": "Dynamic",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_resource_group": {
         "kube": {
            "location": "westus",
            "name": "kube"
         }
      },
      "azurerm_route_table": {
         "kube-routetable": {
            "location": "westus",
            "name": "kube-routetable",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_storage_account": {
         "kube_storage": {
            "account_type": "Standard_LRS",
            "location": "westus",
            "name": "databrickskubestorage",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_storage_container": {
         "vhds": {
            "container_access_type": "private",
            "name": "vhds",
            "resource_group_name": "${azurerm_resource_group.kube.name}",
            "storage_account_name": "${azurerm_storage_account.kube_storage.name}"
         }
      },
      "azurerm_subnet": {
         "kube-subnet": {
            "address_prefix": "10.120.0.0/16",
            "name": "kube-subnet",
            "network_security_group_id": "${azurerm_network_security_group.kube_nsg.id}",
            "resource_group_name": "${azurerm_resource_group.kube.name}",
            "route_table_id": "${azurerm_route_table.kube-routetable.id}",
            "virtual_network_name": "${azurerm_virtual_network.kube_vn.name}"
         }
      },
      "azurerm_virtual_machine": {
         "master": {
            "availability_set_id": "${azurerm_availability_set.master.id}",
            "boot_diagnostics": {
               "enabled": true,
               "storage_uri": "${azurerm_storage_account.kube_storage.primary_blob_endpoint}"
            },
            "location": "westus",
            "name": "master",
            "network_interface_ids": [
               "${azurerm_network_interface.master_nic.id}"
            ],
            "os_profile": {
               "admin_password": "",
               "admin_username": "azureuser",
               "computer_name": "kube-master",
               "custom_data": "ewogICJpZ25pdGlvbiI6IHsKICAgICJ2ZXJzaW9uIjogIjIuMC4wIiwKICAgICJjb25maWciOiB7fQogIH0sCiAgInN0b3JhZ2UiOiB7fSwKICAic3lzdGVtZCI6IHsKICAgICJ1bml0cyI6IFsKICAgICAgewogICAgICAgICJuYW1lIjogInNzaGQuc29ja2V0IiwKICAgICAgICAiZW5hYmxlIjogdHJ1ZQogICAgICB9CiAgICBdCiAgfSwKICAibmV0d29ya2QiOiB7fSwKICAicGFzc3dkIjoge30KfQo="
            },
            "os_profile_linux_config": {
               "disable_password_authentication": true,
               "ssh_keys": [
                  {
                     "key_data": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPu+iRIN+Uk5vls+BuTn8FtUgWopvoQ8KdicT3VBFoc0A0m+h71DsfEDYjsAGfY83YF7wWj2O+B38c3CaIs8fx0lagg1Ir+kUrgas2P28mlblfeX/ZPDPytp5euEWlHDePOwpSa4dO4tq2efWkDJMC2HPLyj5BEeTc6OOCZWMbk711tzFrVcYGEw1jhkknMFGkdHNpl+KsPImm6AoGMJFDkpPAc96fDaotgtHIHiMeMZ5smAmAet6EgCwa/WJ0+ZYds+ne+FhIP7vxmqZ6qZlj1tFrMEqvl4b68G6QDGQrzx3zTZTvLZiyOrSpPRdqz78Pnk1SZgknAd87dIVKpjF9 admin2@Spares-MacBook-Pro.local",
                     "path": "/home/azureuser/.ssh/authorized_keys"
                  }
               ]
            },
            "resource_group_name": "${azurerm_resource_group.kube.name}",
            "storage_image_reference": {
               "offer": "CoreOS",
               "publisher": "CoreOS",
               "sku": "Stable",
               "version": "1235.8.0"
            },
            "storage_os_disk": {
               "create_option": "FromImage",
               "name": "master-osdisk",
               "vhd_uri": "${azurerm_storage_account.kube_storage.primary_blob_endpoint}${azurerm_storage_container.vhds.name}/master-osdisk1.vhd"
            },
            "vm_size": "Standard_D2_v2"
         }
      },
      "azurerm_virtual_machine_scale_set": {
         "agentpool": {
            "location": "westus",
            "name": "agentpool",
            "network_profile": {
               "ip_configuration": {
                  "name": "ipconfig",
                  "subnet_id": "${azurerm_subnet.kube-subnet.id}"
               },
               "name": "agent-network-profile",
               "primary": true
            },
            "os_profile": {
               "admin_password": "",
               "admin_username": "azureuser",
               "computer_name_prefix": "k8s-agent-"
            },
            "os_profile_linux_config": {
               "disable_password_authentication": true,
               "ssh_keys": [
                  {
                     "key_data": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPu+iRIN+Uk5vls+BuTn8FtUgWopvoQ8KdicT3VBFoc0A0m+h71DsfEDYjsAGfY83YF7wWj2O+B38c3CaIs8fx0lagg1Ir+kUrgas2P28mlblfeX/ZPDPytp5euEWlHDePOwpSa4dO4tq2efWkDJMC2HPLyj5BEeTc6OOCZWMbk711tzFrVcYGEw1jhkknMFGkdHNpl+KsPImm6AoGMJFDkpPAc96fDaotgtHIHiMeMZ5smAmAet6EgCwa/WJ0+ZYds+ne+FhIP7vxmqZ6qZlj1tFrMEqvl4b68G6QDGQrzx3zTZTvLZiyOrSpPRdqz78Pnk1SZgknAd87dIVKpjF9 admin2@Spares-MacBook-Pro.local",
                     "path": "/home/azureuser/.ssh/authorized_keys"
                  }
               ]
            },
            "resource_group_name": "${azurerm_resource_group.kube.name}",
            "sku": {
               "capacity": 3,
               "name": "Standard_D2_v2",
               "tier": "standard"
            },
            "storage_profile_image_reference": {
               "offer": "CoreOS",
               "publisher": "CoreOS",
               "sku": "Stable",
               "version": "1235.8.0"
            },
            "storage_profile_os_disk": {
               "caching": "ReadWrite",
               "create_option": "FromImage",
               "name": "agent-osdisk-profile",
               "vhd_containers": [
                  "${azurerm_storage_account.kube_storage.primary_blob_endpoint}${azurerm_storage_container.vhds.name}"
               ]
            },
            "upgrade_policy_mode": "Manual"
         }
      },
      "azurerm_virtual_network": {
         "kube_vn": {
            "address_space": [
               "10.0.0.0/8"
            ],
            "location": "westus",
            "name": "kube_vn",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      }
   }
}

Debug Output

https://gist.github.com/guoshimin/604847ec95e5c92d52e78905bf0614f0

Panic Output

Expected Behavior

terraform plan should show no diff when nothing was changed.

Actual Behavior

terrform plan always shows

~ azurerm_virtual_machine_scale_set.agentpool
    sku.1109371675.capacity: "" => "3"
    sku.1109371675.name:     "" => "Standard_D2_v2"
    sku.1109371675.tier:     "" => "standard"
    sku.3296928972.capacity: "3" => "0"
    sku.3296928972.name:     "Standard_D2_v2" => ""


Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan

Important Factoids

References

@rrudduck
Copy link
Contributor

Try chaning the tier from "standard" to "Standard". I've had some diffs caused by casing differences between the resources and what Azure returns in the API.

abhijeetgaiha pushed a commit to cloudbooster/terraform that referenced this issue May 10, 2017
abhijeetgaiha pushed a commit to cloudbooster/terraform that referenced this issue May 11, 2017
abhijeetgaiha pushed a commit to cloudbooster/terraform that referenced this issue May 12, 2017
abhijeetgaiha pushed a commit to cloudbooster/terraform that referenced this issue May 15, 2017
abhijeetgaiha pushed a commit to cloudbooster/terraform that referenced this issue May 24, 2017
abhijeetgaiha pushed a commit to cloudbooster/terraform that referenced this issue May 24, 2017
abhijeetgaiha pushed a commit to cloudbooster/terraform that referenced this issue May 24, 2017
@stack72
Copy link
Contributor

stack72 commented Jun 1, 2017

Closed via #14861

@stack72 stack72 closed this as completed Jun 1, 2017
@ghost
Copy link

ghost commented Apr 11, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants