|
|
@ -10,7 +10,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|
|
|
|
|
|
|
|
|
|
|
DOCUMENTATION = '''
|
|
|
|
DOCUMENTATION = '''
|
|
|
|
---
|
|
|
|
---
|
|
|
|
module: ovirt_vms
|
|
|
|
module: ovirt_vm
|
|
|
|
short_description: Module to manage Virtual Machines in oVirt/RHV
|
|
|
|
short_description: Module to manage Virtual Machines in oVirt/RHV
|
|
|
|
version_added: "2.2"
|
|
|
|
version_added: "2.2"
|
|
|
|
author:
|
|
|
|
author:
|
|
|
@ -46,6 +46,7 @@ options:
|
|
|
|
allow_partial_import:
|
|
|
|
allow_partial_import:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Boolean indication whether to allow partial registration of Virtual Machine when C(state) is registered.
|
|
|
|
- Boolean indication whether to allow partial registration of Virtual Machine when C(state) is registered.
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
version_added: "2.4"
|
|
|
|
version_added: "2.4"
|
|
|
|
vnic_profile_mappings:
|
|
|
|
vnic_profile_mappings:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
@ -105,6 +106,7 @@ options:
|
|
|
|
reassign_bad_macs:
|
|
|
|
reassign_bad_macs:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "Boolean indication whether to reassign bad macs when C(state) is registered."
|
|
|
|
- "Boolean indication whether to reassign bad macs when C(state) is registered."
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
version_added: "2.5"
|
|
|
|
version_added: "2.5"
|
|
|
|
template:
|
|
|
|
template:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
@ -186,47 +188,13 @@ options:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Operating system of the Virtual Machine.
|
|
|
|
- Operating system of the Virtual Machine.
|
|
|
|
- Default value is set by oVirt/RHV engine.
|
|
|
|
- Default value is set by oVirt/RHV engine.
|
|
|
|
choices:
|
|
|
|
- "Possible values: debian_7, freebsd, freebsdx64, other, other_linux,
|
|
|
|
- debian_7
|
|
|
|
other_linux_ppc64, other_ppc64, rhel_3, rhel_4, rhel_4x64, rhel_5, rhel_5x64,
|
|
|
|
- freebsd
|
|
|
|
rhel_6, rhel_6x64, rhel_6_ppc64, rhel_7x64, rhel_7_ppc64, sles_11, sles_11_ppc64,
|
|
|
|
- freebsdx64
|
|
|
|
ubuntu_12_04, ubuntu_12_10, ubuntu_13_04, ubuntu_13_10, ubuntu_14_04, ubuntu_14_04_ppc64,
|
|
|
|
- other
|
|
|
|
windows_10, windows_10x64, windows_2003, windows_2003x64, windows_2008, windows_2008x64,
|
|
|
|
- other_linux
|
|
|
|
windows_2008r2x64, windows_2008R2x64, windows_2012x64, windows_2012R2x64, windows_7,
|
|
|
|
- other_linux_ppc64
|
|
|
|
windows_7x64, windows_8, windows_8x64, windows_xp"
|
|
|
|
- other_ppc64
|
|
|
|
|
|
|
|
- rhel_3
|
|
|
|
|
|
|
|
- rhel_4
|
|
|
|
|
|
|
|
- rhel_4x64
|
|
|
|
|
|
|
|
- rhel_5
|
|
|
|
|
|
|
|
- rhel_5x64
|
|
|
|
|
|
|
|
- rhel_6
|
|
|
|
|
|
|
|
- rhel_6x64
|
|
|
|
|
|
|
|
- rhel_6_ppc64
|
|
|
|
|
|
|
|
- rhel_7x64
|
|
|
|
|
|
|
|
- rhel_7_ppc64
|
|
|
|
|
|
|
|
- sles_11
|
|
|
|
|
|
|
|
- sles_11_ppc64
|
|
|
|
|
|
|
|
- ubuntu_12_04
|
|
|
|
|
|
|
|
- ubuntu_12_10
|
|
|
|
|
|
|
|
- ubuntu_13_04
|
|
|
|
|
|
|
|
- ubuntu_13_10
|
|
|
|
|
|
|
|
- ubuntu_14_04
|
|
|
|
|
|
|
|
- ubuntu_14_04_ppc64
|
|
|
|
|
|
|
|
- windows_10
|
|
|
|
|
|
|
|
- windows_10x64
|
|
|
|
|
|
|
|
- windows_2003
|
|
|
|
|
|
|
|
- windows_2003x64
|
|
|
|
|
|
|
|
- windows_2008
|
|
|
|
|
|
|
|
- windows_2008x64
|
|
|
|
|
|
|
|
- windows_2008r2x64
|
|
|
|
|
|
|
|
- windows_2008R2x64
|
|
|
|
|
|
|
|
- windows_2012x64
|
|
|
|
|
|
|
|
- windows_2012R2x64
|
|
|
|
|
|
|
|
- windows_7
|
|
|
|
|
|
|
|
- windows_7x64
|
|
|
|
|
|
|
|
- windows_8
|
|
|
|
|
|
|
|
- windows_8x64
|
|
|
|
|
|
|
|
- windows_xp
|
|
|
|
|
|
|
|
boot_devices:
|
|
|
|
boot_devices:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- List of boot devices which should be used to boot. For example C([ cdrom, hd ]).
|
|
|
|
- List of boot devices which should be used to boot. For example C([ cdrom, hd ]).
|
|
|
@ -235,18 +203,22 @@ options:
|
|
|
|
boot_menu:
|
|
|
|
boot_menu:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "I(True) enable menu to select boot device, I(False) to disable it. By default is chosen by oVirt/RHV engine."
|
|
|
|
- "I(True) enable menu to select boot device, I(False) to disable it. By default is chosen by oVirt/RHV engine."
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
version_added: "2.5"
|
|
|
|
version_added: "2.5"
|
|
|
|
usb_support:
|
|
|
|
usb_support:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "I(True) enable USB support, I(False) to disable it. By default is chosen by oVirt/RHV engine."
|
|
|
|
- "I(True) enable USB support, I(False) to disable it. By default is chosen by oVirt/RHV engine."
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
version_added: "2.5"
|
|
|
|
version_added: "2.5"
|
|
|
|
serial_console:
|
|
|
|
serial_console:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "I(True) enable VirtIO serial console, I(False) to disable it. By default is chosen by oVirt/RHV engine."
|
|
|
|
- "I(True) enable VirtIO serial console, I(False) to disable it. By default is chosen by oVirt/RHV engine."
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
version_added: "2.5"
|
|
|
|
version_added: "2.5"
|
|
|
|
sso:
|
|
|
|
sso:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "I(True) enable Single Sign On by Guest Agent, I(False) to disable it. By default is chosen by oVirt/RHV engine."
|
|
|
|
- "I(True) enable Single Sign On by Guest Agent, I(False) to disable it. By default is chosen by oVirt/RHV engine."
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
version_added: "2.5"
|
|
|
|
version_added: "2.5"
|
|
|
|
host:
|
|
|
|
host:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
@ -282,11 +254,13 @@ options:
|
|
|
|
- If I(yes) Virtual Machine will be set as delete protected.
|
|
|
|
- If I(yes) Virtual Machine will be set as delete protected.
|
|
|
|
- If I(no) Virtual Machine won't be set as delete protected.
|
|
|
|
- If I(no) Virtual Machine won't be set as delete protected.
|
|
|
|
- If no value is passed, default value is set by oVirt/RHV engine.
|
|
|
|
- If no value is passed, default value is set by oVirt/RHV engine.
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
stateless:
|
|
|
|
stateless:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- If I(yes) Virtual Machine will be set as stateless.
|
|
|
|
- If I(yes) Virtual Machine will be set as stateless.
|
|
|
|
- If I(no) Virtual Machine will be unset as stateless.
|
|
|
|
- If I(no) Virtual Machine will be unset as stateless.
|
|
|
|
- If no value is passed, default value is set by oVirt/RHV engine.
|
|
|
|
- If no value is passed, default value is set by oVirt/RHV engine.
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
clone:
|
|
|
|
clone:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- If I(yes) then the disks of the created virtual machine will be cloned and independent of the template.
|
|
|
|
- If I(yes) then the disks of the created virtual machine will be cloned and independent of the template.
|
|
|
@ -382,6 +356,7 @@ options:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "If I(true) the C(cloud_init) or C(sysprep) parameters will be saved for the virtual machine
|
|
|
|
- "If I(true) the C(cloud_init) or C(sysprep) parameters will be saved for the virtual machine
|
|
|
|
and won't be virtual machine won't be started as run-once."
|
|
|
|
and won't be virtual machine won't be started as run-once."
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
version_added: "2.5"
|
|
|
|
version_added: "2.5"
|
|
|
|
aliases: [ 'sysprep_persist' ]
|
|
|
|
aliases: [ 'sysprep_persist' ]
|
|
|
|
kernel_path:
|
|
|
|
kernel_path:
|
|
|
@ -423,6 +398,7 @@ options:
|
|
|
|
- C(vm) - Sets the Virtual Machine's UUID as its serial number.
|
|
|
|
- C(vm) - Sets the Virtual Machine's UUID as its serial number.
|
|
|
|
- C(host) - Sets the host's UUID as the Virtual Machine's serial number.
|
|
|
|
- C(host) - Sets the host's UUID as the Virtual Machine's serial number.
|
|
|
|
- C(custom) - Allows you to specify a custom serial number in C(serial_policy_value).
|
|
|
|
- C(custom) - Allows you to specify a custom serial number in C(serial_policy_value).
|
|
|
|
|
|
|
|
choices: ['vm', 'host', 'custom']
|
|
|
|
version_added: "2.3"
|
|
|
|
version_added: "2.3"
|
|
|
|
serial_policy_value:
|
|
|
|
serial_policy_value:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
@ -499,6 +475,7 @@ options:
|
|
|
|
- "If I(true), in addition return I(remote_vv_file) inside I(vm) dictionary, which contains compatible
|
|
|
|
- "If I(true), in addition return I(remote_vv_file) inside I(vm) dictionary, which contains compatible
|
|
|
|
content for remote-viewer application. Works only C(state) is I(running)."
|
|
|
|
content for remote-viewer application. Works only C(state) is I(running)."
|
|
|
|
version_added: "2.7"
|
|
|
|
version_added: "2.7"
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
cpu_pinning:
|
|
|
|
cpu_pinning:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "CPU Pinning topology to map virtual machine CPU to host CPU."
|
|
|
|
- "CPU Pinning topology to map virtual machine CPU to host CPU."
|
|
|
@ -509,10 +486,12 @@ options:
|
|
|
|
soundcard_enabled:
|
|
|
|
soundcard_enabled:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "If I(true), the sound card is added to the virtual machine."
|
|
|
|
- "If I(true), the sound card is added to the virtual machine."
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
version_added: "2.5"
|
|
|
|
version_added: "2.5"
|
|
|
|
smartcard_enabled:
|
|
|
|
smartcard_enabled:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "If I(true), use smart card authentication."
|
|
|
|
- "If I(true), use smart card authentication."
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
version_added: "2.5"
|
|
|
|
version_added: "2.5"
|
|
|
|
io_threads:
|
|
|
|
io_threads:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
@ -523,12 +502,14 @@ options:
|
|
|
|
- "If I(true), use memory ballooning."
|
|
|
|
- "If I(true), use memory ballooning."
|
|
|
|
- "Memory balloon is a guest device, which may be used to re-distribute / reclaim the host memory
|
|
|
|
- "Memory balloon is a guest device, which may be used to re-distribute / reclaim the host memory
|
|
|
|
based on VM needs in a dynamic way. In this way it's possible to create memory over commitment states."
|
|
|
|
based on VM needs in a dynamic way. In this way it's possible to create memory over commitment states."
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
version_added: "2.5"
|
|
|
|
version_added: "2.5"
|
|
|
|
numa_tune_mode:
|
|
|
|
numa_tune_mode:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "Set how the memory allocation for NUMA nodes of this VM is applied (relevant if NUMA nodes are set for this VM)."
|
|
|
|
- "Set how the memory allocation for NUMA nodes of this VM is applied (relevant if NUMA nodes are set for this VM)."
|
|
|
|
- "It can be one of the following: I(interleave), I(preferred) or I(strict)."
|
|
|
|
- "It can be one of the following: I(interleave), I(preferred) or I(strict)."
|
|
|
|
- "If no value is passed, default value is set by oVirt/RHV engine."
|
|
|
|
- "If no value is passed, default value is set by oVirt/RHV engine."
|
|
|
|
|
|
|
|
choices: ['interleave', 'preferred', 'strict']
|
|
|
|
version_added: "2.6"
|
|
|
|
version_added: "2.6"
|
|
|
|
numa_nodes:
|
|
|
|
numa_nodes:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
@ -592,28 +573,28 @@ EXAMPLES = '''
|
|
|
|
# look at ovirt_auth module to see how to reuse authentication:
|
|
|
|
# look at ovirt_auth module to see how to reuse authentication:
|
|
|
|
|
|
|
|
|
|
|
|
- name: Creates a new Virtual Machine from template named 'rhel7_template'
|
|
|
|
- name: Creates a new Virtual Machine from template named 'rhel7_template'
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
state: present
|
|
|
|
state: present
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
template: rhel7_template
|
|
|
|
template: rhel7_template
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
|
|
|
|
|
|
|
|
|
- name: Register VM
|
|
|
|
- name: Register VM
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
state: registered
|
|
|
|
state: registered
|
|
|
|
storage_domain: mystorage
|
|
|
|
storage_domain: mystorage
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
|
|
|
|
|
|
|
|
- name: Register VM using id
|
|
|
|
- name: Register VM using id
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
state: registered
|
|
|
|
state: registered
|
|
|
|
storage_domain: mystorage
|
|
|
|
storage_domain: mystorage
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
|
id: 1111-1111-1111-1111
|
|
|
|
id: 1111-1111-1111-1111
|
|
|
|
|
|
|
|
|
|
|
|
- name: Register VM, allowing partial import
|
|
|
|
- name: Register VM, allowing partial import
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
state: registered
|
|
|
|
state: registered
|
|
|
|
storage_domain: mystorage
|
|
|
|
storage_domain: mystorage
|
|
|
|
allow_partial_import: "True"
|
|
|
|
allow_partial_import: "True"
|
|
|
@ -621,7 +602,7 @@ EXAMPLES = '''
|
|
|
|
id: 1111-1111-1111-1111
|
|
|
|
id: 1111-1111-1111-1111
|
|
|
|
|
|
|
|
|
|
|
|
- name: Register VM with vnic profile mappings and reassign bad macs
|
|
|
|
- name: Register VM with vnic profile mappings and reassign bad macs
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
state: registered
|
|
|
|
state: registered
|
|
|
|
storage_domain: mystorage
|
|
|
|
storage_domain: mystorage
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
@ -636,7 +617,7 @@ EXAMPLES = '''
|
|
|
|
reassign_bad_macs: "True"
|
|
|
|
reassign_bad_macs: "True"
|
|
|
|
|
|
|
|
|
|
|
|
- name: Register VM with mappings
|
|
|
|
- name: Register VM with mappings
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
state: registered
|
|
|
|
state: registered
|
|
|
|
storage_domain: mystorage
|
|
|
|
storage_domain: mystorage
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
@ -671,7 +652,7 @@ EXAMPLES = '''
|
|
|
|
dest_name: cluster_B
|
|
|
|
dest_name: cluster_B
|
|
|
|
|
|
|
|
|
|
|
|
- name: Creates a stateless VM which will always use latest template version
|
|
|
|
- name: Creates a stateless VM which will always use latest template version
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
template: rhel7
|
|
|
|
template: rhel7
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
@ -680,7 +661,7 @@ EXAMPLES = '''
|
|
|
|
# Creates a new server rhel7 Virtual Machine from Blank template
|
|
|
|
# Creates a new server rhel7 Virtual Machine from Blank template
|
|
|
|
# on brq01 cluster with 2GiB memory and 2 vcpu cores/sockets
|
|
|
|
# on brq01 cluster with 2GiB memory and 2 vcpu cores/sockets
|
|
|
|
# and attach bootable disk with name rhel7_disk and attach virtio NIC
|
|
|
|
# and attach bootable disk with name rhel7_disk and attach virtio NIC
|
|
|
|
- ovirt_vms:
|
|
|
|
- ovirt_vm:
|
|
|
|
state: present
|
|
|
|
state: present
|
|
|
|
cluster: brq01
|
|
|
|
cluster: brq01
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
@ -697,7 +678,7 @@ EXAMPLES = '''
|
|
|
|
- name: nic1
|
|
|
|
- name: nic1
|
|
|
|
|
|
|
|
|
|
|
|
- name: Run VM with cloud init
|
|
|
|
- name: Run VM with cloud init
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: rhel7
|
|
|
|
name: rhel7
|
|
|
|
template: rhel7
|
|
|
|
template: rhel7
|
|
|
|
cluster: Default
|
|
|
|
cluster: Default
|
|
|
@ -722,7 +703,7 @@ EXAMPLES = '''
|
|
|
|
root_password: super_password
|
|
|
|
root_password: super_password
|
|
|
|
|
|
|
|
|
|
|
|
- name: Run VM with cloud init, with multiple network interfaces
|
|
|
|
- name: Run VM with cloud init, with multiple network interfaces
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: rhel7_4
|
|
|
|
name: rhel7_4
|
|
|
|
template: rhel7
|
|
|
|
template: rhel7
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
@ -738,7 +719,7 @@ EXAMPLES = '''
|
|
|
|
nic_on_boot: true
|
|
|
|
nic_on_boot: true
|
|
|
|
|
|
|
|
|
|
|
|
- name: Run VM with sysprep
|
|
|
|
- name: Run VM with sysprep
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: windows2012R2_AD
|
|
|
|
name: windows2012R2_AD
|
|
|
|
template: windows2012R2
|
|
|
|
template: windows2012R2
|
|
|
|
cluster: Default
|
|
|
|
cluster: Default
|
|
|
@ -750,47 +731,47 @@ EXAMPLES = '''
|
|
|
|
root_password: SuperPassword123
|
|
|
|
root_password: SuperPassword123
|
|
|
|
|
|
|
|
|
|
|
|
- name: Migrate/Run VM to/on host named 'host1'
|
|
|
|
- name: Migrate/Run VM to/on host named 'host1'
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
state: running
|
|
|
|
state: running
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
host: host1
|
|
|
|
host: host1
|
|
|
|
|
|
|
|
|
|
|
|
- name: Change VMs CD
|
|
|
|
- name: Change VMs CD
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
cd_iso: drivers.iso
|
|
|
|
cd_iso: drivers.iso
|
|
|
|
|
|
|
|
|
|
|
|
- name: Eject VMs CD
|
|
|
|
- name: Eject VMs CD
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
cd_iso: ''
|
|
|
|
cd_iso: ''
|
|
|
|
|
|
|
|
|
|
|
|
- name: Boot VM from CD
|
|
|
|
- name: Boot VM from CD
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
cd_iso: centos7_x64.iso
|
|
|
|
cd_iso: centos7_x64.iso
|
|
|
|
boot_devices:
|
|
|
|
boot_devices:
|
|
|
|
- cdrom
|
|
|
|
- cdrom
|
|
|
|
|
|
|
|
|
|
|
|
- name: Stop vm
|
|
|
|
- name: Stop vm
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
state: stopped
|
|
|
|
state: stopped
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
|
|
|
|
|
|
|
|
- name: Upgrade memory to already created VM
|
|
|
|
- name: Upgrade memory to already created VM
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
memory: 4GiB
|
|
|
|
memory: 4GiB
|
|
|
|
|
|
|
|
|
|
|
|
- name: Hot plug memory to already created and running VM (VM won't be restarted)
|
|
|
|
- name: Hot plug memory to already created and running VM (VM won't be restarted)
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
memory: 4GiB
|
|
|
|
memory: 4GiB
|
|
|
|
|
|
|
|
|
|
|
|
# Create/update a VM to run with two vNUMA nodes and pin them to physical NUMA nodes as follows:
|
|
|
|
# Create/update a VM to run with two vNUMA nodes and pin them to physical NUMA nodes as follows:
|
|
|
|
# vnuma index 0-> numa index 0, vnuma index 1-> numa index 1
|
|
|
|
# vnuma index 0-> numa index 0, vnuma index 1-> numa index 1
|
|
|
|
- name: Create a VM to run with two vNUMA nodes
|
|
|
|
- name: Create a VM to run with two vNUMA nodes
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
|
numa_tune_mode: "interleave"
|
|
|
|
numa_tune_mode: "interleave"
|
|
|
@ -805,7 +786,7 @@ EXAMPLES = '''
|
|
|
|
numa_node_pins: [1]
|
|
|
|
numa_node_pins: [1]
|
|
|
|
|
|
|
|
|
|
|
|
- name: Update an existing VM to run without previously created vNUMA nodes (i.e. remove all vNUMA nodes+NUMA pinning setting)
|
|
|
|
- name: Update an existing VM to run without previously created vNUMA nodes (i.e. remove all vNUMA nodes+NUMA pinning setting)
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
|
state: "present"
|
|
|
|
state: "present"
|
|
|
@ -816,14 +797,14 @@ EXAMPLES = '''
|
|
|
|
# When change on the VM needs restart of the VM, use next_run state,
|
|
|
|
# When change on the VM needs restart of the VM, use next_run state,
|
|
|
|
# The VM will be updated and rebooted if there are any changes.
|
|
|
|
# The VM will be updated and rebooted if there are any changes.
|
|
|
|
# If present state would be used, VM won't be restarted.
|
|
|
|
# If present state would be used, VM won't be restarted.
|
|
|
|
- ovirt_vms:
|
|
|
|
- ovirt_vm:
|
|
|
|
state: next_run
|
|
|
|
state: next_run
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
boot_devices:
|
|
|
|
boot_devices:
|
|
|
|
- network
|
|
|
|
- network
|
|
|
|
|
|
|
|
|
|
|
|
- name: Import virtual machine from VMware
|
|
|
|
- name: Import virtual machine from VMware
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
state: stopped
|
|
|
|
state: stopped
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
|
name: vmware_win10
|
|
|
|
name: vmware_win10
|
|
|
@ -837,7 +818,7 @@ EXAMPLES = '''
|
|
|
|
password: password
|
|
|
|
password: password
|
|
|
|
|
|
|
|
|
|
|
|
- name: Create vm from template and create all disks on specific storage domain
|
|
|
|
- name: Create vm from template and create all disks on specific storage domain
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: vm_test
|
|
|
|
name: vm_test
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
|
template: mytemplate
|
|
|
|
template: mytemplate
|
|
|
@ -846,7 +827,7 @@ EXAMPLES = '''
|
|
|
|
- name: nic1
|
|
|
|
- name: nic1
|
|
|
|
|
|
|
|
|
|
|
|
- name: Remove VM, if VM is running it will be stopped
|
|
|
|
- name: Remove VM, if VM is running it will be stopped
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
state: absent
|
|
|
|
state: absent
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
|
|
|
|
|
|
|
@ -855,7 +836,7 @@ EXAMPLES = '''
|
|
|
|
- ovirt_quotas_facts:
|
|
|
|
- ovirt_quotas_facts:
|
|
|
|
data_center: Default
|
|
|
|
data_center: Default
|
|
|
|
name: myquota
|
|
|
|
name: myquota
|
|
|
|
- ovirt_vms:
|
|
|
|
- ovirt_vm:
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
sso: False
|
|
|
|
sso: False
|
|
|
|
boot_menu: True
|
|
|
|
boot_menu: True
|
|
|
@ -864,7 +845,7 @@ EXAMPLES = '''
|
|
|
|
quota_id: "{{ ovirt_quotas[0]['id'] }}"
|
|
|
|
quota_id: "{{ ovirt_quotas[0]['id'] }}"
|
|
|
|
|
|
|
|
|
|
|
|
- name: Create a VM that has the console configured for both Spice and VNC
|
|
|
|
- name: Create a VM that has the console configured for both Spice and VNC
|
|
|
|
ovirt_vms:
|
|
|
|
ovirt_vm:
|
|
|
|
name: myvm
|
|
|
|
name: myvm
|
|
|
|
template: mytemplate
|
|
|
|
template: mytemplate
|
|
|
|
cluster: mycluster
|
|
|
|
cluster: mycluster
|
|
|
@ -1849,7 +1830,7 @@ def control_state(vm, vms_service, module):
|
|
|
|
vm.status == otypes.VmStatus.UNKNOWN
|
|
|
|
vm.status == otypes.VmStatus.UNKNOWN
|
|
|
|
):
|
|
|
|
):
|
|
|
|
# Invalid states:
|
|
|
|
# Invalid states:
|
|
|
|
module.fail_json(msg="Not possible to control VM, if it's in '{}' status".format(vm.status))
|
|
|
|
module.fail_json(msg="Not possible to control VM, if it's in '{0}' status".format(vm.status))
|
|
|
|
elif vm.status == otypes.VmStatus.POWERING_DOWN:
|
|
|
|
elif vm.status == otypes.VmStatus.POWERING_DOWN:
|
|
|
|
if (force and state == 'stopped') or state == 'absent':
|
|
|
|
if (force and state == 'stopped') or state == 'absent':
|
|
|
|
vm_service.stop()
|
|
|
|
vm_service.stop()
|
|
|
@ -1890,7 +1871,7 @@ def main():
|
|
|
|
type=dict(type='str', choices=['server', 'desktop', 'high_performance']),
|
|
|
|
type=dict(type='str', choices=['server', 'desktop', 'high_performance']),
|
|
|
|
operating_system=dict(type='str'),
|
|
|
|
operating_system=dict(type='str'),
|
|
|
|
cd_iso=dict(type='str'),
|
|
|
|
cd_iso=dict(type='str'),
|
|
|
|
boot_devices=dict(type='list'),
|
|
|
|
boot_devices=dict(type='list', choices=['cdrom', 'hd', 'network']),
|
|
|
|
vnic_profile_mappings=dict(default=[], type='list'),
|
|
|
|
vnic_profile_mappings=dict(default=[], type='list'),
|
|
|
|
cluster_mappings=dict(default=[], type='list'),
|
|
|
|
cluster_mappings=dict(default=[], type='list'),
|
|
|
|
role_mappings=dict(default=[], type='list'),
|
|
|
|
role_mappings=dict(default=[], type='list'),
|
|
|
@ -1951,6 +1932,10 @@ def main():
|
|
|
|
supports_check_mode=True,
|
|
|
|
supports_check_mode=True,
|
|
|
|
required_one_of=[['id', 'name']],
|
|
|
|
required_one_of=[['id', 'name']],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if module._name == 'ovirt_vms':
|
|
|
|
|
|
|
|
module.deprecate("The 'ovirt_vms' module is being renamed 'ovirt_vm'", version=2.8)
|
|
|
|
|
|
|
|
|
|
|
|
check_sdk(module)
|
|
|
|
check_sdk(module)
|
|
|
|
check_params(module)
|
|
|
|
check_params(module)
|
|
|
|
|
|
|
|
|