From 3f8b51491d95951be6b23472dba39c655c072268 Mon Sep 17 00:00:00 2001 From: Petr Balogh Date: Tue, 21 Aug 2018 12:35:47 +0200 Subject: [PATCH] Add io_thread parameter for ovirt_templates module (#44406) Adds ability to set io_threads for template. --- lib/ansible/modules/cloud/ovirt/ovirt_templates.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_templates.py b/lib/ansible/modules/cloud/ovirt/ovirt_templates.py index 68cc1f6bb3..1a043690d9 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_templates.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_templates.py @@ -97,6 +97,10 @@ options: - "When C(state) is I(imported) and C(image_provider) is used this parameter specifies the name of disk to be imported as template." aliases: ['glance_image_disk_name'] + io_threads: + description: + - "Number of IO threads used by virtual machine. I(0) means IO threading disabled." + version_added: "2.7" template_image_disk_name: description: - "When C(state) is I(imported) and C(image_provider) is used this parameter specifies the new name for imported disk, @@ -308,6 +312,9 @@ class TemplatesModule(BaseModule): self.param('memory_guaranteed'), self.param('memory_max') )) else None, + io=otypes.Io( + threads=self.param('io_threads'), + ) if self.param('io_threads') is not None else None, ) def update_check(self, entity): @@ -318,7 +325,8 @@ class TemplatesModule(BaseModule): equal(convert_to_bytes(self.param('memory_guaranteed')), entity.memory_policy.guaranteed) and equal(convert_to_bytes(self.param('memory_max')), entity.memory_policy.max) and equal(convert_to_bytes(self.param('memory')), entity.memory) and - equal(self._module.params.get('cpu_profile'), get_link_name(self._connection, entity.cpu_profile)) + equal(self._module.params.get('cpu_profile'), get_link_name(self._connection, entity.cpu_profile)) and + equal(self.param('io_threads'), entity.io.threads) ) def _get_export_domain_service(self): @@ -438,6 +446,7 @@ def main(): exclusive=dict(type='bool'), image_provider=dict(default=None), image_disk=dict(default=None, aliases=['glance_image_disk_name']), + io_threads=dict(type='int', default=None), template_image_disk_name=dict(default=None), seal=dict(type='bool'), vnic_profile_mappings=dict(default=[], type='list'),