{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/26095","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/26095/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/26095/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/26095/events","html_url":"https://github.com/ansible/ansible/issues/26095","id":238549029,"number":26095,"title":"Unable to create a 2-disks vm on different datastores","user":{"login":"angystardust","id":1568397,"avatar_url":"https://avatars1.githubusercontent.com/u/1568397?v=4","gravatar_id":"","url":"https://api.github.com/users/angystardust","html_url":"https://github.com/angystardust","followers_url":"https://api.github.com/users/angystardust/followers","following_url":"https://api.github.com/users/angystardust/following{/other_user}","gists_url":"https://api.github.com/users/angystardust/gists{/gist_id}","starred_url":"https://api.github.com/users/angystardust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angystardust/subscriptions","organizations_url":"https://api.github.com/users/angystardust/orgs","repos_url":"https://api.github.com/users/angystardust/repos","events_url":"https://api.github.com/users/angystardust/events{/privacy}","received_events_url":"https://api.github.com/users/angystardust/received_events","type":"User","site_admin":false},"labels":[{"id":454885231,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.3","name":"affects_2.3","color":"5319e7","default":false},{"id":48276055,"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":61528803,"url":"https://api.github.com/repos/ansible/ansible/labels/cloud","name":"cloud","color":"c7def8","default":false},{"id":496359346,"url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":636352796,"url":"https://api.github.com/repos/ansible/ansible/labels/support:core","name":"support:core","color":"ededed","default":false},{"id":427121291,"url":"https://api.github.com/repos/ansible/ansible/labels/vmware","name":"vmware","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-26T13:48:39Z","updated_at":"2017-07-20T19:19:06Z","closed_at":null,"body":"<!---\r\nVerify first that your issue/request is not already reported on GitHub.\r\nAlso test if the latest release, and master branch are affected too.\r\n-->\r\n\r\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\ncloud/vmware_guest.py\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.3.0.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = [u'/home/ansible/infra/library', u'/usr/lib/python2.7/site-packages/ara/plugins/modules']\r\n  python version = 2.7.5 (default, Sep 15 2016, 22:37:39) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]\r\n```\r\n\r\n##### CONFIGURATION\r\nN.A.\r\n\r\n##### OS / ENVIRONMENT\r\nRed Hat Enterprise Linux 7.3\r\nVMware Vsphere 6.0\r\n\r\n##### SUMMARY\r\nWhen you try to create a 2-disks vm with each disk on a different datastore, both are created on the datastore specified as the first one.\r\n\r\n##### STEPS TO REPRODUCE\r\nCreate a playbook with the below example and specify 2 different datastores as the _datastore_ and the _disk2_datastore_ variables.\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```yaml\r\n- name: Create VM from template\r\n  vmware_guest:\r\n    name: \"{{ inventory_hostname }}\"\r\n\r\n    hostname: \"{{ vcenter_hostname }}\"\r\n    username: \"{{ vcenter_user }}\"\r\n    password: \"{{ vcenter_pass }}\"\r\n    validate_certs: False\r\n\r\n    esxi_hostname: \"{{ esxhost }}\"\r\n    datacenter: \"{{ datacenter }}\"\r\n\r\n    template: '{{ os_family}}{{ os_vers }}{{os_arch}}-template'\r\n    folder: \"{{ folder | default('/vm') }}\"\r\n\r\n    hardware:\r\n      num_cpus: \"{{ vm_cpus }}\"\r\n      memory_mb: \"{{ vm_memory * 1024 | default(1024) }}\"\r\n\r\n    disk:\r\n      - size_gb: \"{{ disk_size | default(10) }}\"\r\n        type: thin\r\n        datastore: \"{{ datastore }}\"\r\n        autoselect_datastore: False\r\n      - size_gb: \"{{ disk2_size | default(10) }}\"\r\n        type: thin\r\n        datastore: \"{{ disk2_datastore }}\"\r\n        autoselect_datastore: False\r\n\r\n    networks:\r\n      - name: \"{{ vlan }}\"\r\n        ip: \"{{ primary_ip }}\"\r\n        netmask: \"{{ netmask }}\"\r\n        gateway: \"{{ gateway }}\"\r\n      - name: \"{{ nic2_vlan }}\"\r\n        ip: \"{{ nic2_ip }}\"\r\n        netmask: \"{{ nic2_netmask }}\"\r\n\r\n    customization:\r\n      domain: \"{{ domain }}\"\r\n      dns_servers: \"{{ dns_servers }}\"\r\n\r\n    annotation: \"Created with Ansible\"\r\n    wait_for_ip_address: true\r\n\r\n  register: newvm\r\n  delegate_to: localhost\r\n\r\n```\r\n\r\n\r\n\r\n##### EXPECTED RESULTS\r\nThe new vm is created with the each disk on the his own datastore\r\n\r\n##### ACTUAL RESULTS\r\nThe new vm is created with the both disks on the same datastore\r\n\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/316803574","html_url":"https://github.com/ansible/ansible/issues/26095#issuecomment-316803574","issue_url":"https://api.github.com/repos/ansible/ansible/issues/26095","id":316803574,"user":{"login":"Akasurde","id":633765,"avatar_url":"https://avatars1.githubusercontent.com/u/633765?v=4","gravatar_id":"","url":"https://api.github.com/users/Akasurde","html_url":"https://github.com/Akasurde","followers_url":"https://api.github.com/users/Akasurde/followers","following_url":"https://api.github.com/users/Akasurde/following{/other_user}","gists_url":"https://api.github.com/users/Akasurde/gists{/gist_id}","starred_url":"https://api.github.com/users/Akasurde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Akasurde/subscriptions","organizations_url":"https://api.github.com/users/Akasurde/orgs","repos_url":"https://api.github.com/users/Akasurde/repos","events_url":"https://api.github.com/users/Akasurde/events{/privacy}","received_events_url":"https://api.github.com/users/Akasurde/received_events","type":"User","site_admin":false},"created_at":"2017-07-20T19:19:05Z","updated_at":"2017-07-20T19:19:05Z","body":"@angystardust Could you please try [this](https://github.com/Akasurde/ansible/commit/ced8c596b4b576eaaecfbb42f731fbad7c283f78) patch and let me know if it works for you?\r\ncc @jctanner "}}
{"actor":{"display_login":"Akasurde"}}