ansible vmware 0:7 reserved scsi controller card

25 views
Skip to first unread message

Bhanu Prakash

unread,
Jun 10, 2020, 12:53:37 PM6/10/20
to Ansible Project
Hello Team,

I need to add 15 disks , I am getting error because of  0:7 reservation.

Is there any automation ..please find my below code and help

- name: Add disks
        vmware_guest_disk:
           hostname: "{{location}}"
           username: "{{vcenteruser}}"
           password: "{{vcenterpass}}"
           validate_certs: no
           datacenter: "{{datacentername}}"
           name: "{{hostname}}"
           disk:
             - size_gb: "{{ item }}"
               type: thin
               datastore: "{{datastoredetails}}"
               state: present
               scsi_controller: 0
               unit_number: "{{ my_idx + 1 }}"
               scsi_type: 'paravirtual'
        loop: "{{ storage }}"
        loop_control:
          index_var: my_idx
        delegate_to: localhost

Dick Visser

unread,
Jun 10, 2020, 3:50:13 PM6/10/20
to ansible...@googlegroups.com
What does your 'storage' variable look like?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e17ebdd8-fad4-42e2-a7f5-f31dd619362fo%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

Bhanu Prakash

unread,
Jun 10, 2020, 11:16:00 PM6/10/20
to Ansible Project
This are dynamic values like this

[5,4,3,2,5,4]

as it's in loop it creates disks accordingly ..
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.

Dick Visser

unread,
Jun 10, 2020, 11:44:49 PM6/10/20
to ansible...@googlegroups.com
Well then just remove 7 from that list if that can't be used. Also there are duplicates - even if that isn't a problem you can optimize the loop by removing those. See https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#set-theory-filters

To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f531c82c-187e-4e9d-84f0-eb095dc073e5o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages