{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/16373","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/16373/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/16373/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/16373/events","html_url":"https://github.com/hashicorp/terraform/issues/16373","id":266116837,"node_id":"MDU6SXNzdWUyNjYxMTY4Mzc=","number":16373,"title":"vsphere provider error: default resource pool resolves to multiple instances, please specify","user":{"login":"jeroenjacobs1205","id":8290833,"node_id":"MDQ6VXNlcjgyOTA4MzM=","avatar_url":"https://avatars1.githubusercontent.com/u/8290833?v=4","gravatar_id":"","url":"https://api.github.com/users/jeroenjacobs1205","html_url":"https://github.com/jeroenjacobs1205","followers_url":"https://api.github.com/users/jeroenjacobs1205/followers","following_url":"https://api.github.com/users/jeroenjacobs1205/following{/other_user}","gists_url":"https://api.github.com/users/jeroenjacobs1205/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroenjacobs1205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroenjacobs1205/subscriptions","organizations_url":"https://api.github.com/users/jeroenjacobs1205/orgs","repos_url":"https://api.github.com/users/jeroenjacobs1205/repos","events_url":"https://api.github.com/users/jeroenjacobs1205/events{/privacy}","received_events_url":"https://api.github.com/users/jeroenjacobs1205/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-10-17T13:05:51Z","updated_at":"2018-08-24T19:40:18Z","closed_at":"2017-10-18T11:18:11Z","author_association":"NONE","body":"\r\n### Terraform Version\r\n0.9.6\r\n### Terraform Configuration Files\r\n\r\nmain.tf:\r\n\r\n```\r\nmodule \"nexus\" {\r\n  source = \"./tf_modules/nexus\"\r\n  environment = \"${var.environment[\"dns_subdomain\"]}\"\r\n  cidr = \"${var.environment[\"network_cidr\"]}\"\r\n  gateway = \"${var.environment[\"gateway_ip\"]}\"\r\n  dns_domain = \"${var.environment[\"dns_domain\"]}\"\r\n  dns_servers = \"${var.environment[\"dns_servers\"]}\"\r\n  dns_suffixes = \"${var.environment[\"dns_suffixes\"]}\"\r\n  vcpu = \"${var.environment[\"nexus_cpu\"]}\"\r\n  memory = \"${var.environment[\"nexus_mem\"]}\"\r\n  datacenter = \"${var.environment[\"vsphere_datacenter\"]}\"\r\n  resource_pool = \"${var.environment[\"vsphere_cluster\"]}\"\r\n  count = \"${var.environment[\"nexus_count\"]}\"\r\n  name = \"nexus\"\r\n  role = \"nexus\"\r\n  folder = \"${vsphere_folder.env_folder.path}\"\r\n  ips = \"${var.environment[\"nexus_ips\"]}\"\r\n  vm_network = \"${var.environment[\"vm_network\"]}\"\r\n  vm_datastore = \"${var.environment[\"vm_datastore\"]}\"\r\n  vm_template = \"${var.environment[\"vm_template\"]}\"\r\n  nexus_volume_size = \"${var.environment[\"nexus_volume_size\"]}\"\r\n}\r\n\r\n```\r\n\r\n./tf_modules/nexus/main.tf:\r\n\r\n```\r\nvariable \"vcpu\" { type = \"string\" }\r\nvariable \"memory\" { type = \"string\" }\r\nvariable \"vm_network\" { type = \"string\" }\r\nvariable \"count\" { type = \"string\" }\r\nvariable \"environment\" { type = \"string\" }\r\nvariable \"name\" { type = \"string\" }\r\nvariable \"role\" { type = \"string\" }\r\nvariable \"ips\" { type = \"string\" }\r\nvariable \"datacenter\" { type = \"string\" }\r\nvariable \"vm_datastore\" { type = \"string\" }\r\nvariable \"vm_template\" { type = \"string\" }\r\nvariable \"cidr\" { type = \"string\" }\r\nvariable \"gateway\" { type = \"string\" }\r\nvariable \"dns_domain\" { type = \"string\" }\r\nvariable \"dns_servers\" { type = \"string\" }\r\nvariable \"dns_suffixes\" { type = \"string\" }\r\nvariable \"folder\" { type = \"string\" }\r\nvariable \"nexus_volume_size\" { type = \"string\" }\r\n\r\n\r\nresource \"vsphere_virtual_machine\" \"nexus_instance\" {\r\n\r\n  count = \"${var.count}\"\r\n  datacenter = \"${var.datacenter}\"\r\n  folder = \"${var.folder}\"\r\n  name = \"${var.environment}-${var.name}-${format(\"%03d\", count.index+1)}\"\r\n  domain = \"${var.dns_domain}\"\r\n\tdns_servers = \"${split(\",\", var.dns_servers)}\"\r\n\tdns_suffixes = \"${split(\",\", var.dns_suffixes)}\"\r\n\r\n  vcpu   = \"${var.vcpu}\"\r\n  memory = \"${var.memory}\"\r\n\r\n  network_interface {\r\n    label = \"${var.vm_network}\"\r\n    ipv4_address = \"${element(split(\",\", var.ips),count.index)}\"\r\n    ipv4_gateway = \"${var.gateway}\"\r\n    ipv4_prefix_length = \"${element(split(\"/\",var.cidr),1)}\"\r\n  }\r\n\r\n  disk {\r\n    template = \"${var.vm_template}\"\r\n    datastore = \"${var.vm_datastore}\"\r\n    type = \"thin\"\r\n  }\r\n\r\n  disk {\r\n    datastore = \"${var.vm_datastore}\"\r\n    size = \"${var.nexus_volume_size}\"\r\n    type = \"thin\"\r\n    name = \"${var.environment}-${var.name}-${format(\"%03d\", count.index+1)}_nexus_store.vmdk\"\r\n  }\r\n\r\n\r\n  custom_configuration_parameters = {\r\n    role = \"${var.role}\"\r\n  }\r\n\r\n}\r\n\r\n```\r\n\r\n### Crash Output\r\n\r\n### Expected Behavior\r\nMachine should be created.\r\n\r\n### Actual Behavior\r\n\r\n```\r\n* vsphere_virtual_machine.nexus_instance: default resource pool resolves to multiple instances, please specify                                                                                          \r\n* module.concourse.vsphere_virtual_machine.concourse_instance[2]: 1 error(s) occurred:   \r\n```\r\n\r\n### Steps to Reproduce\r\n\r\n### Important Factoids\r\n\r\n### References\r\n\r\n\r\n### additional info\r\n\r\nI was hoping there was a way to specify the resource pool to use, however, documentation for 0.9 release is no longer available on the terraform website.  So I have no clue which parameters to add. I tried \"resource_pool\", but that doesn't seem to work.\r\n\r\nAlso, upgrading to 0.10.x release is not option, as this implies we need to rewrite all our terraform config files. We just can't do that on the fly in an enterprise environment...\r\n\r\nAt least keep the documentation of older releases online for those who need it.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/415862347","html_url":"https://github.com/hashicorp/terraform/issues/16373#issuecomment-415862347","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/16373","id":415862347,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTg2MjM0Nw==","user":{"login":"kaizoku0506","id":9777085,"node_id":"MDQ6VXNlcjk3NzcwODU=","avatar_url":"https://avatars2.githubusercontent.com/u/9777085?v=4","gravatar_id":"","url":"https://api.github.com/users/kaizoku0506","html_url":"https://github.com/kaizoku0506","followers_url":"https://api.github.com/users/kaizoku0506/followers","following_url":"https://api.github.com/users/kaizoku0506/following{/other_user}","gists_url":"https://api.github.com/users/kaizoku0506/gists{/gist_id}","starred_url":"https://api.github.com/users/kaizoku0506/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaizoku0506/subscriptions","organizations_url":"https://api.github.com/users/kaizoku0506/orgs","repos_url":"https://api.github.com/users/kaizoku0506/repos","events_url":"https://api.github.com/users/kaizoku0506/events{/privacy}","received_events_url":"https://api.github.com/users/kaizoku0506/received_events","type":"User","site_admin":false},"created_at":"2018-08-24T19:40:18Z","updated_at":"2018-08-24T19:40:18Z","author_association":"NONE","body":"@jeroenjacobs1205  Do you have a code example for what worked for you?  We have an environment where we have 1x vcenter with 4x datacenters.  Each datacenter has multiple compute clusters.  Each compute cluster has three resource pools.  So our layout would be:\r\n\r\n* Datacenter:  location1\r\n  * Cluster: cluster4\r\n    * Resource Pool:  development\r\n\r\nThe issue I'm facing is that every cluster has 3x resource pools with the same names.  So if I tell TF to deploy into \"development\", I get the multiple instances error.\r\n\r\nI'm currently doing this in my vsphere_virtual_machine resource:\r\n\r\n```\r\nresource \"vsphere_virtual_machine\" \"vm\" {\r\n  count               = \"${var.vsphere_vm_count}\"\r\n\r\n  name                = \"tfpurest${count.index+1}.${var.vsphere_vm_domain}\"  \r\n  resource_pool_id    = \"${data.vsphere_compute_cluster.cluster.resource_pool_id}\"\r\n  datastore_id        = \"${data.vsphere_datastore.datastore.id}\"\r\n```\r\n\r\nwith the following in my data_sources:\r\n\r\n```\r\ndata \"vsphere_compute_cluster\" \"cluster\" {\r\n  name              = \"${var.vsphere_vm_compute_cluster}\"\r\n  datacenter_id     = \"${data.vsphere_datacenter.dc.id}\"\r\n}\r\n```\r\n\r\nand a variable for my resource pool:\r\n\r\n```\r\nvariable \"vsphere_vm_resource_pool\" {\r\n\ttype = \"string\"\r\n\tdescription = \"vSphere resource pool into which VMs will be deployed\"\r\n  default = \"default\"\r\n}\r\n```\r\nset using an environment variable `TF_VAR_vsphere_vm_resource_pool='development'`\r\n\r\nMy deploys aren't going into the resource pool for some reason, but I can't figure out why."}}
{"actor":{"display_login":"kaizoku0506"}}