Manage disk or USB controllers related to virtual machine in given vCenter infrastructure
- This module can be used to add, remove disk controllers or USB controllers belonging to given virtual machine.
- All parameters and VMware object names are case sensitive.
Note
- All modules requires API write access and hence is not supported on a free ESXi license.
- name: Add disk and USB 3.0 controllers for virtual machine located by name
community.vmware.vmware_guest_controller:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datacenter: "{{ datacenter_name }}"
name: test_VM
controllers:
- state: present
type: sata
- state: present
type: nvme
- state: present
type: usb3
delegate_to: localhost
register: disk_controller_facts
- name: Remove disk controllers and USB 2.0 from virtual machine located by moid
community.vmware.vmware_guest_controller:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datacenter: "{{ datacenter_name }}"
moid: vm-33
controllers:
- state: absent
controller_number: 1
type: sata
- state: absent
controller_number: 0
type: nvme
- state: absent
type: usb2
delegate_to: localhost
register: disk_controller_facts
Common return values are documented here, the following are the fields unique to this module:
- Diane Wang (@Tomorrow9) <[email protected]>