Vmware.community: bus_sharing parameter is not working with disk option

What are you experiencing? What are you expecting to happen?
bus sharing parameter is not working with disk option in vmware.

Play-Book:

---
- name: vm disk demo
  hosts: localhost
  become: false
  gather_facts: false
  pre_tasks:
    - include_vars: vars.yml
  tasks:
    - name: add disk to vm
      vmware_guest_disk:
        hostname: "{{ vcenter_hostname }}"
        username: "{{ vcenter_username }}"
        password: "{{ vcenter_password }}"
        validate_certs: "{{ vcenter_validate_certs }}"
        datacenter: "{{ vcenter_datacenter }}"
        name: "{{ vm_name }}"
        disk:
          - size_gb: "{{ vm_disk_gb }}"
            type: "{{ vm_disk_type }}"
            datastore: "{{ vm_disk_datastore }}"
            state: present
            scsi_controller: "{{ vm_disk_scsi_controller }}"
            sharing: "{{ vm_disk_sharing }}"
            unit_number: "{{ vm_disk_scsi_unit }}"
            scsi_type: "{{ vm_disk_scsi_type }}"
            disk_mode: "{{ vm_disk_mode }}"
            bus_sharing: "physicalSharing"

vars.yaml

---
vcenter_hostname: "192.168.10.10"
vcenter_datacenter: "datacenter"
vcenter_validate_certs: no
vcenter_username: "administrator@vsphere.local"
vcenter_password: "**password**"
vm_name: "standalonenode"
vm_disk_gb: 1
vm_disk_type: "eagerzeroedthick"
vm_disk_datastore: "datastore1"
vm_disk_scsi_controller: 3
vm_disk_scsi_unit: 3
vm_disk_scsi_bus_sharing: "physicalSharing"
vm_disk_scsi_type: 'paravirtual'
vm_disk_mode: 'persistent'
vm_disk_sharing: true

Here vm_disk_sharing value is true but in controller the set value is None, How to fix this?

Define the value or impact to you or the business
Delivery impact

Where are you experiencing this behavior? What environment?
dev

Hello @Mohit , welcome to the forum!

I just edited your message to include the “code blocks” tags for the playbook section, this makes it easier to read as it keeps the playbook format and spacing. Sharing with you below how to do it for next time!

When composing your next messages, you can select the playbook section of text you copy/pasted and use the </> button in the tool-bar right at the top of the message window where you are typing, this will automatically put it in the box you see in the messages above. Here is a screen capture to show the button location:

3 Likes