VMware Cloud Community
thale13
Contributor
Contributor

Ansible/PyVmomi issue

I have an ansible process to add disks to a vm on a specific datastore.  Until maybe this week its worked perfectly.  Today I noticed that it seems to be ignoring the 'datastore' parameter and just adding it with the vm itself.  I've tried the following code with both a specific datastore set and a datastore cluster.  Both times it fails because the datastore it chooses doesn't have enough space (it shouldn't) but that datastore is neither the one I said to use or in the cluster I said to use.

Any ideas?

---

- name: Add disks to vmware for temp

  hosts: localhost

  connection: localhost

  gather_facts: no

  tasks:

    - name: Verify hardware

      vmware_guest_disk:

        hostname: <VCENTER server>

        username: <User with Admin rights>

        password: <I think you can guess....>

        validate_certs: False

        datacenter: <Datacenter>

        name: <VM>

        disk:

          - size_gb: 64

            type: thick

            datastore: <Datastore Cluster>

            state: present

            scsi_controller: 2

            unit_number: 2

          - size_gb: 64

            type: thick

            datastore: <Datastore Cluster>

            state: present

            scsi_controller: 3

            unit_number: 2

          - size_gb: 64

            type: thick

            datastore: <Datastore Cluster>

            state: present

            scsi_controller: 2

            unit_number: 3

0 Kudos
1 Reply
thale13
Contributor
Contributor

Appears to be specific to Ansible 2.10.  Running with Ansible 2.9 works fine.

0 Kudos