mnecas / mnecas.ovirt / 1.5.5 / module / ovirt_instance_type Module to manage Instance Types in oVirt/RHV | "added in version" 1.0.0 of mnecas.ovirt" Authors: Martin Necas (@mnecas), Ondra Machacek (@machacekondra)mnecas.ovirt.ovirt_instance_type (1.5.5) — module
Install with ansible-galaxy collection install mnecas.ovirt:==1.5.5
collections: - name: mnecas.ovirt version: 1.5.5
This module manages whole lifecycle of the Instance Type in oVirt/RHV.
# Examples don't contain auth parameter for simplicity, # look at ovirt_auth module to see how to reuse authentication: # Create instance type - name: Create instance type mnecas.ovirt.ovirt_instance_type: state: present name: myit rng_device: hwrng rng_bytes: 200 rng_period: 200 soundcard_enabled: true virtio_scsi: true boot_devices: - network
# Remove instance type - mnecas.ovirt.ovirt_instance_type: state: absent name: myit
# Create instance type with predefined memory and cpu limits. - mnecas.ovirt.ovirt_instance_type: state: present name: myit memory: 2GiB cpu_cores: 2 cpu_sockets: 2 nics: - name: nic1
# Enable usb support and serial console - mnecas.ovirt.ovirt_instance_type: name: myit usb_support: True serial_console: True
# Use graphical console with spice and vnc - name: Create a instance type that has the console configured for both Spice and VNC mnecas.ovirt.ovirt_instance_type: name: myit graphical_console: protocol: - spice - vnc
id: description: - ID of the Instance Type to manage. type: str auth: description: - 'Dictionary with values needed to create HTTP/HTTPS connection to oVirt:' required: true suboptions: ca_file: description: - A PEM file containing the trusted CA certificates. - The certificate presented by the server will be verified using these CA certificates. - If C(ca_file) parameter is not set, system wide CA certificate store is used. - Default value is set by C(OVIRT_CAFILE) environment variable. type: str compress: default: true description: Flag indicating if compression is used for connection. type: bool headers: description: - Dictionary of HTTP headers to be added to each API call. type: dict hostname: description: - A string containing the hostname of the server, usually something like `I(server.example.com)`. - Default value is set by C(OVIRT_HOSTNAME) environment variable. - Either C(url) or C(hostname) is required. type: str insecure: default: false description: - A boolean flag that indicates if the server TLS certificate and host name should be checked. type: bool kerberos: description: - A boolean flag indicating if Kerberos authentication should be used instead of the default basic authentication. type: bool password: description: - The password of the user. - Default value is set by C(OVIRT_PASSWORD) environment variable. required: true type: str timeout: description: Number of seconds to wait for response. type: int token: description: - Token to be used instead of login with username/password. - Default value is set by C(OVIRT_TOKEN) environment variable. type: str url: description: - A string containing the API URL of the server, usually something like `I(https://server.example.com/ovirt-engine/api)`. - Default value is set by C(OVIRT_URL) environment variable. - Either C(url) or C(hostname) is required. type: str username: description: - The name of the user, something like I(admin@internal). - Default value is set by C(OVIRT_USERNAME) environment variable. required: true type: str type: dict host: description: - Specify host where Instance Type should be running. By default the host is chosen by engine scheduler. - This parameter is used only when C(state) is I(running) or I(present). type: str name: description: - Name of the Instance Type to manage. - If instance type don't exists C(name) is required. Otherwise C(id) or C(name) can be used. type: str nics: description: - List of NICs, which should be attached to Virtual Machine. NIC is described by following dictionary. - NOTE - This parameter is used only when C(state) is I(running) or I(present) and is able to only create NICs. To manage NICs of the instance type in more depth please use M(mnecas.ovirt.ovirt_nic) module instead. elements: dict suboptions: interface: choices: - virtio - e1000 - rtl8139 default: virtio description: - Type of the network interface. type: str mac_address: description: - Custom MAC address of the network interface, by default it's obtained from MAC pool. type: str name: description: - Name of the NIC. type: str profile_name: description: - Profile name where NIC should be attached. type: str type: list wait: default: true description: - C(yes) if the module should wait for the entity to get into desired state. type: bool state: choices: - absent - present default: present description: - Should the Instance Type be present/absent. - I(present) state will create/update instance type and don't change its state if it already exists. type: str memory: description: - Amount of memory of the Instance Type. Prefix uses IEC 60027-2 standard (for example 1GiB, 1024MiB). - Default value is set by engine. type: str timeout: default: 180 description: - The amount of time in seconds the module should wait for the instance to get into desired state. type: int cpu_mode: description: - 'CPU mode of the instance type. It can be some of the following: I(host_passthrough), I(host_model) or I(custom).' - For I(host_passthrough) CPU type you need to set C(placement_policy) to I(pinned). - If no value is passed, default value is set by oVirt/RHV engine. type: str watchdog: description: - Assign watchdog device for the instance type. - 'Watchdogs is a dictionary which can have following values:' - 'C(model) - Model of the watchdog device. For example: I(i6300esb), I(diag288) or I(null).' - 'C(action) - Watchdog action to be performed when watchdog is triggered. For example: I(none), I(reset), I(poweroff), I(pause) or I(dump).' type: dict cpu_cores: description: - Number of virtual CPUs cores of the Instance Type. - Default value is set by oVirt/RHV engine. type: int rng_bytes: description: - Number of bytes allowed to consume per period. type: int io_threads: description: - Number of IO threads used by instance type. I(0) means IO threading disabled. type: int memory_max: description: - Upper bound of instance type memory up to which memory hot-plug can be performed. Prefix uses IEC 60027-2 standard (for example 1GiB, 1024MiB). - Default value is set by engine. type: str rng_device: description: - Random number generator (RNG). You can choose of one the following devices I(urandom), I(random) or I(hwrng). - In order to select I(hwrng), you must have it enabled on cluster first. - /dev/urandom is used for cluster version >= 4.1, and /dev/random for cluster version <= 4.0 type: str rng_period: description: - Duration of one period in milliseconds. type: int cpu_pinning: description: - CPU Pinning topology to map instance type CPU to host CPU. - 'CPU Pinning topology is a list of dictionary which can have following values:' elements: dict suboptions: cpu: description: - Number of the host CPU. vcpu: description: - Number of the instance type CPU. type: list cpu_sockets: description: - Number of virtual CPUs sockets of the Instance Type. - Default value is set by oVirt/RHV engine. type: int cpu_threads: description: - Number of virtual CPUs sockets of the Instance Type. - Default value is set by oVirt/RHV engine. type: int description: description: - Description of the instance type. type: str usb_support: description: - I(True) enable USB support, I(False) to disable it. By default is chosen by oVirt/RHV engine. type: bool virtio_scsi: description: - If I(true), virtio scsi will be enabled. type: bool boot_devices: choices: - cdrom - hd - network description: - List of boot devices which should be used to boot. For example C([ cdrom, hd ]). - Default value is set by oVirt/RHV engine. elements: str type: list fetch_nested: default: false description: - If I(True) the module will fetch additional data from the API. - It will fetch IDs of the VMs disks, snapshots, etc. User can configure to fetch other attributes of the nested entities by specifying C(nested_attributes). type: bool poll_interval: default: 3 description: - Number of the seconds the module waits until another poll request on entity status is sent. type: int serial_console: description: - I(True) enable VirtIO serial console, I(False) to disable it. By default is chosen by oVirt/RHV engine. type: bool operating_system: description: - Operating system of the Instance Type, for example 'rhel_8x64'. - Default value is set by oVirt/RHV engine. - Use the M(mnecas.ovirt.ovirt_vm_os_info) module to obtain the current list. type: str placement_policy: description: - The configuration of the instance type's placement policy. - 'Placement policy can be one of the following values:' - C(migratable) - Allow manual and automatic migration. - C(pinned) - Do not allow migration. - C(user_migratable) - Allow manual migration only. - If no value is passed, default value is set by oVirt/RHV engine. type: str graphical_console: description: - Assign graphical console to the instance type. - 'Graphical console is a dictionary which can have following values:' - C(headless_mode) - If I(true) disable the graphics console for this instance type. - C(protocol) - Graphical protocol, a list of I(spice), I(vnc), or both. type: dict high_availability: description: - If I(yes) Instance Type will be set as highly available. - If I(no) Instance Type won't be set as highly available. - If no value is passed, default value is set by oVirt/RHV engine. type: bool memory_guaranteed: description: - Amount of minimal guaranteed memory of the Instance Type. Prefix uses IEC 60027-2 standard (for example 1GiB, 1024MiB). - C(memory_guaranteed) parameter can't be lower than C(memory) parameter. - Default value is set by engine. type: str nested_attributes: description: - Specifies list of the attributes which should be fetched from the API. - This parameter apply only when C(fetch_nested) is I(true). elements: str type: list smartcard_enabled: description: - If I(true), use smart card authentication. type: bool soundcard_enabled: description: - If I(true), the sound card is added to the instance type. type: bool ballooning_enabled: description: - If I(true), use memory ballooning. - Memory balloon is a guest device, which may be used to re-distribute / reclaim the host memory based on instance type needs in a dynamic way. In this way it's possible to create memory over commitment states. type: bool high_availability_priority: description: - Indicates the priority of the instance type inside the run and migration queues. Instance Type with higher priorities will be started and migrated before instance types with lower priorities. The value is an integer between 0 and 100. The higher the value, the higher the priority. - If no value is passed, default value is set by oVirt/RHV engine. type: int
id: description: ID of the instance type which is managed returned: On success if instance type is found. sample: 7de90f31-222c-436c-a1ca-7e655bd5b60c type: str instancetype: description: 'Dictionary of all the instance type attributes. instance type attributes can be found on your oVirt/RHV instance at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/instance_type.' returned: On success if instance type is found. type: dict