community.vmware.vmware_guest_controller – Manage disk or USB controllers related to virtual machine in given vCenter infrastructure¶
Note
This plugin is part of the community.vmware collection (version 1.9.0).
To install it use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vmware_guest_controller
.
Synopsis¶
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.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.7
PyVmomi
Parameters¶
Examples¶
- 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
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Diane Wang (@Tomorrow9) <dianew@vmware.com>