{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/6590","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/6590/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/6590/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/6590/events","html_url":"https://github.com/hashicorp/terraform/issues/6590","id":154035723,"number":6590,"title":"terraform 0.6.16 - Vmware Vsphere Provider - ipv4_gateway not saved in tfstate file","user":{"login":"totojack","id":1204877,"avatar_url":"https://avatars.githubusercontent.com/u/1204877?v=3","gravatar_id":"","url":"https://api.github.com/users/totojack","html_url":"https://github.com/totojack","followers_url":"https://api.github.com/users/totojack/followers","following_url":"https://api.github.com/users/totojack/following{/other_user}","gists_url":"https://api.github.com/users/totojack/gists{/gist_id}","starred_url":"https://api.github.com/users/totojack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totojack/subscriptions","organizations_url":"https://api.github.com/users/totojack/orgs","repos_url":"https://api.github.com/users/totojack/repos","events_url":"https://api.github.com/users/totojack/events{/privacy}","received_events_url":"https://api.github.com/users/totojack/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/vsphere","name":"provider/vsphere","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-10T15:27:09Z","updated_at":"2016-05-10T17:19:20Z","closed_at":null,"body":"### Terraform Version\r\nv0.6.16\r\n\r\n### Affected Resource(s)\r\n- vpshere_virtual_machine \r\n- network_interface\r\n- ipv4_gateway\r\n\r\n### Terraform Configuration Files\r\n#define variable from terraform.tvars\r\nvariable \"vsphere_user\"       {}\r\nvariable \"vsphere_password\"   {}\r\nvariable \"vsphere_server\"     {}\r\nvariable \"vsphere_cluster\"    {}\r\nvariable \"vsphere_datacenter\" {}\r\nvariable \"vsphere_domain\"     {}\r\nvariable \"vsphere_dns\"        {}\r\nvariable \"vsphere_timezone\"   {}\r\n\r\n# Configure the VMware vSphere Provider\r\nprovider \"vsphere\" {\r\n  user           = \"${var.vsphere_user}\"\r\n  password       = \"${var.vsphere_password}\"\r\n  vsphere_server = \"${var.vsphere_server}\"\r\n  allow_unverified_ssl = true\r\n}\r\n\r\n# Create a folder\r\nresource \"vsphere_folder\" \"testfolder\" {\r\n  path = \"TEST/Vms\"\r\n  datacenter = \"${var.vsphere_datacenter}\"\r\n}\r\n\r\n# Create a virtual machine within the folder\r\nresource \"vsphere_virtual_machine\" \"web\" {\r\n  name   = \"terraform-web\"\r\n  folder = \"${vsphere_folder.testfolder.path}\"\r\n  vcpu   = 2\r\n  memory = 2048\r\n  datacenter = \"${var.vsphere_datacenter}\"\r\n  cluster = \"${var.vsphere_cluster}\"\r\n  domain = \"my.custom.domain.com\"\r\n  dns_servers = [\"${var.vsphere_dns}\"]\r\n  #resource_pool = \"\"\r\n  time_zone = \"${var.vsphere_timezone}\"\r\n\r\n  network_interface {\r\n    label = \"virtualwire_Template\"\r\n    ipv4_address = \"172.16.1.19\"\r\n    ipv4_prefix_length = \"28\"\r\n    ipv4_gateway = \"172.16.1.17\"\r\n  }\r\n\r\n  disk {\r\n    template = \"TEMPLATE/Centos7_tmpl_20160422_01\"\r\n    datastore = \"VPLEX-SAS\"\r\n  }\r\n  disk {\r\n    size = \"20\"\r\n    datastore = \"VPLEX-SAS\"\r\n  }\r\n  disk {\r\n    size = \"10\"\r\n    datastore = \"VPLEX-SAS\"\r\n  }\r\n}\r\n\r\n### Debug Output\r\nhttps://gist.github.com/totojack/4db892bf6d9b03b3b982401fedd8c2f6\r\n\r\n### Expected Behavior\r\nAfter applying the configuration, ipv4_gateway value is set on tfstate file.\r\n\r\n### Actual Behavior\r\nipv4_gateway value is not saved to tfstate file, and plan command shows another time changes to be applied for network_interface ipv4_gateway. Plan output is:\r\n(...)\r\n network_interface.0.ipv4_gateway:       \"\" => \"172.16.1.17\" (forces new resource)\r\n(...)\r\nPlan: 1 to add, 0 to change, 1 to destroy.\r\n\r\ntfstate file is:\r\n\r\n(...)\r\n\"network_interface.#\": \"1\",\r\n\"network_interface.0.adapter_type\": \"\",\r\n\"network_interface.0.ip_address\": \"\",\r\n\"network_interface.0.ipv4_address\": \"172.16.1.19\",\r\n\"network_interface.0.ipv4_gateway\": \"\",\r\n\"network_interface.0.ipv4_prefix_length\": \"28\",\r\n\"network_interface.0.ipv6_address\": \"\",\r\n\"network_interface.0.ipv6_gateway\": \"\",\r\n\"network_interface.0.ipv6_prefix_length\": \"0\",\r\n\"network_interface.0.label\": \"virtualwire_Template\",\r\n\"network_interface.0.subnet_mask\": \"\",\r\n\"skip_customization\": \"false\",\r\n\"time_zone\": \"Europe/Rome\",\r\n\"vcpu\": \"2\"\r\n(...)\r\n\r\n### Steps to Reproduce\r\n1. add ipv4_gateway to network_interface configuration\r\n1. `terraform apply`\r\n2. `terraform plan`\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/218227960","html_url":"https://github.com/hashicorp/terraform/issues/6590#issuecomment-218227960","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/6590","id":218227960,"user":{"login":"chrislovecnm","id":335402,"avatar_url":"https://avatars.githubusercontent.com/u/335402?v=3","gravatar_id":"","url":"https://api.github.com/users/chrislovecnm","html_url":"https://github.com/chrislovecnm","followers_url":"https://api.github.com/users/chrislovecnm/followers","following_url":"https://api.github.com/users/chrislovecnm/following{/other_user}","gists_url":"https://api.github.com/users/chrislovecnm/gists{/gist_id}","starred_url":"https://api.github.com/users/chrislovecnm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrislovecnm/subscriptions","organizations_url":"https://api.github.com/users/chrislovecnm/orgs","repos_url":"https://api.github.com/users/chrislovecnm/repos","events_url":"https://api.github.com/users/chrislovecnm/events{/privacy}","received_events_url":"https://api.github.com/users/chrislovecnm/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T17:19:20Z","updated_at":"2016-05-10T17:19:20Z","body":"@stack72 I think this is resolved. https://github.com/hashicorp/terraform/pull/6522\r\n\r\n@thetuxkeeper please confirm"}}