From 54b530967b5a8f38230b7ca1d3942fc80a6823b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ne=C4=8Das?= <necas.marty@gmail.com> Date: Thu, 24 Oct 2019 09:17:18 +0200 Subject: [PATCH] ovirt disk correct fcp host (#63857) --- lib/ansible/modules/cloud/ovirt/ovirt_disk.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_disk.py b/lib/ansible/modules/cloud/ovirt/ovirt_disk.py index f52ddc46349..c295b960655 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_disk.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_disk.py @@ -284,6 +284,15 @@ EXAMPLES = ''' bootable: true format: raw content_type: iso + +# Add fiber chanel disk +- name: Create disk + ovirt_disk: + name: fcp_disk + host: my_host + logical_unit: + id: 3600a09803830447a4f244c4657597777 + storage_type: fcp ''' @@ -478,6 +487,7 @@ def upload_disk_image(connection, module): class DisksModule(BaseModule): def build_entity(self): + hosts_service = self._connection.system_service().hosts_service() logical_unit = self._module.params.get('logical_unit') disk = otypes.Disk( id=self._module.params.get('id'), @@ -509,6 +519,9 @@ class DisksModule(BaseModule): shareable=self._module.params.get('shareable'), wipe_after_delete=self.param('wipe_after_delete'), lun_storage=otypes.HostStorage( + host=otypes.Host( + id=get_id_by_name(hosts_service, self._module.params.get('host')) + ) if self.param('host') else None, type=otypes.StorageType( logical_unit.get('storage_type', 'iscsi') ),