From 78937c3b42704ae75c58320371ade3493e4157f8 Mon Sep 17 00:00:00 2001 From: mnecas Date: Mon, 20 Sep 2021 10:28:10 +0200 Subject: [PATCH 1/4] ovirt_vm: add virtio_scsi_enabled --- plugins/modules/ovirt_vm.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/modules/ovirt_vm.py b/plugins/modules/ovirt_vm.py index 0be4a1b5..20d69a50 100644 --- a/plugins/modules/ovirt_vm.py +++ b/plugins/modules/ovirt_vm.py @@ -894,6 +894,10 @@ description: - "Sets the value of the custom_emulated_machine attribute." type: str + virtio_scsi_enabled: + description: + - "Enable Virtio SCSI support." + type: bool notes: - If VM is in I(UNASSIGNED) or I(UNKNOWN) state before any operation, the module will fail. @@ -1553,6 +1557,9 @@ def build_entity(self): self.param('cpu_pinning') )) else None, cpu_shares=self.param('cpu_shares'), + virtio_scsi=otypes.VirtioScsi( + enabled=self.param('virtio_scsi_enabled'), + ) if self.param('virtio_scsi_enabled') is not None else None, os=otypes.OperatingSystem( type=self.param('operating_system'), boot=otypes.Boot( @@ -1746,6 +1753,7 @@ def check_custom_compatibility_version(): equal(self.param('serial_policy'), str(getattr(entity.serial_number, 'policy', None))) and equal(self.param('serial_policy_value'), getattr(entity.serial_number, 'value', None)) and equal(self.param('numa_tune_mode'), str(entity.numa_tune_mode)) and + equal(self.param('virtio_scsi_enabled'), entity.virtio_scsi.enabled) and equal(self.param('rng_device'), str(entity.rng_device.source) if entity.rng_device else None) and equal(provided_vm_display.get('monitors'), getattr(vm_display, 'monitors', None)) and equal(provided_vm_display.get('keyboard_layout'), getattr(vm_display, 'keyboard_layout', None)) and @@ -2579,6 +2587,7 @@ def main(): force_migrate=dict(type='bool'), migrate=dict(type='bool', default=None), next_run=dict(type='bool'), + virtio_scsi_enabled=dict(type='bool'), snapshot_name=dict(type='str'), snapshot_vm=dict(type='str'), ) From 742dba2e1270bbda8c32b4a86ddc6d9edb80f81f Mon Sep 17 00:00:00 2001 From: mnecas Date: Mon, 20 Sep 2021 10:41:51 +0200 Subject: [PATCH 2/4] ovirt_vm add multi_queues_enabled --- plugins/modules/ovirt_vm.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/modules/ovirt_vm.py b/plugins/modules/ovirt_vm.py index 20d69a50..3fab9b53 100644 --- a/plugins/modules/ovirt_vm.py +++ b/plugins/modules/ovirt_vm.py @@ -898,6 +898,10 @@ description: - "Enable Virtio SCSI support." type: bool + multi_queues_enabled: + description: + - "If `true`, each virtual interface will get the optimal number of queues, depending on the available virtual Cpus." + type: bool notes: - If VM is in I(UNASSIGNED) or I(UNKNOWN) state before any operation, the module will fail. @@ -1560,6 +1564,7 @@ def build_entity(self): virtio_scsi=otypes.VirtioScsi( enabled=self.param('virtio_scsi_enabled'), ) if self.param('virtio_scsi_enabled') is not None else None, + multi_queues_enabled=self.param('multi_queues_enabled'), os=otypes.OperatingSystem( type=self.param('operating_system'), boot=otypes.Boot( @@ -1754,6 +1759,7 @@ def check_custom_compatibility_version(): equal(self.param('serial_policy_value'), getattr(entity.serial_number, 'value', None)) and equal(self.param('numa_tune_mode'), str(entity.numa_tune_mode)) and equal(self.param('virtio_scsi_enabled'), entity.virtio_scsi.enabled) and + equal(self.param('multi_queues_enabled'), entity.multi_queues_enabled) and equal(self.param('rng_device'), str(entity.rng_device.source) if entity.rng_device else None) and equal(provided_vm_display.get('monitors'), getattr(vm_display, 'monitors', None)) and equal(provided_vm_display.get('keyboard_layout'), getattr(vm_display, 'keyboard_layout', None)) and @@ -2588,6 +2594,7 @@ def main(): migrate=dict(type='bool', default=None), next_run=dict(type='bool'), virtio_scsi_enabled=dict(type='bool'), + multi_queues_enabled=dict(type='bool'), snapshot_name=dict(type='str'), snapshot_vm=dict(type='str'), ) From 4cb6bb44a0dbfd47c97744965f76b4c8966f6e36 Mon Sep 17 00:00:00 2001 From: mnecas Date: Mon, 20 Sep 2021 10:55:31 +0200 Subject: [PATCH 3/4] add changelogs --- ...irt_vm-add-virtio_scsi_enabled-and-multi_queues_enabled.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/fragments/348-ovirt_vm-add-virtio_scsi_enabled-and-multi_queues_enabled.yml diff --git a/changelogs/fragments/348-ovirt_vm-add-virtio_scsi_enabled-and-multi_queues_enabled.yml b/changelogs/fragments/348-ovirt_vm-add-virtio_scsi_enabled-and-multi_queues_enabled.yml new file mode 100644 index 00000000..8ea71612 --- /dev/null +++ b/changelogs/fragments/348-ovirt_vm-add-virtio_scsi_enabled-and-multi_queues_enabled.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - ovirt_vm - Add virtio_scsi_enabled and multi_queues_enabled (https://github.com/oVirt/ovirt-ansible-collection/pull/348). From 422b151e08704eb1e0c393a689865b2b79614e8a Mon Sep 17 00:00:00 2001 From: mnecas Date: Mon, 20 Sep 2021 11:18:12 +0200 Subject: [PATCH 4/4] add version_added --- plugins/modules/ovirt_vm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/modules/ovirt_vm.py b/plugins/modules/ovirt_vm.py index 3fab9b53..8ec1610f 100644 --- a/plugins/modules/ovirt_vm.py +++ b/plugins/modules/ovirt_vm.py @@ -898,10 +898,12 @@ description: - "Enable Virtio SCSI support." type: bool + version_added: 1.7.0 multi_queues_enabled: description: - "If `true`, each virtual interface will get the optimal number of queues, depending on the available virtual Cpus." type: bool + version_added: 1.7.0 notes: - If VM is in I(UNASSIGNED) or I(UNKNOWN) state before any operation, the module will fail.