Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ovirt_disk: Unable to configure (FC) Direct LUN #71210

Closed
mattpoel opened this issue Aug 11, 2020 · 2 comments
Closed

ovirt_disk: Unable to configure (FC) Direct LUN #71210

mattpoel opened this issue Aug 11, 2020 · 2 comments
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. cloud collection Related to Ansible Collections work module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md ovirt oVirt and RHV community python3 support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.

Comments

@mattpoel
Copy link

SUMMARY

ovirt_disk provides the functionality to configure (FC) direct LUNs. We tried to configure FC direct LUNs, but ran into multiple issues.

  • Problem 1: If we try to create the direct LUN according to documentation, we will receive "[Cannot add Virtual Disk. The provided LUN is not visible by the specified host, please check storage server connectivity.]"
  • Problem 2: If you remove the host in the task, the direct LUN will be created, but incorrectly and not attached to the VM.
ISSUE TYPE
  • Bug Report
COMPONENT NAME

ovirt_disk

ANSIBLE VERSION
ansible 2.9.11
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['//home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ansible
  executable location = /app/ansible/ovirt/tools/Python-3.8.5/bin/ansible
  python version = 3.8.5 (default, Jul 28 2020, 12:35:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
CONFIGURATION
No output
OS / ENVIRONMENT

ovirt / OLVM version: 4.3.6.6-1.0.9

STEPS TO REPRODUCE

Try to configure a FC direct LUN for a VM.

  - name: VM -> Add Direct LUNs
    ovirt_disk:
      auth:
        username: "{{ ovirt_username }}"
        password: "{{ ovirt_password }}"
        insecure: yes
        url: "{{ ovirt_url }}"
      
      name: "dluntest_TEST01"
      host: "kvm01"
      vm_name: "dluntest"
      logical_unit:
        id: "36000144xxxxxxxx1d38"
        storage_type: fcp
EXPECTED RESULTS

FC Direct LUN is created and attached to VM.

ACTUAL RESULTS

When we are running the playbook we will receive the following error:

TASK [VM -> Add Direct LUNs] *****************************************************************************************************************************************
task path: /app/ansible/ovirt/DBCLUSTER_dlun.yml:35
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: ansible
<127.0.0.1> EXEC /bin/sh -c 'echo ~ansible && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/ansible/.ansible/tmp `"&& mkdir /home/ansible/.ansible/tmp/ansible-tmp-1597136428.0939364-24094-36864609799735 && echo ansible-tmp-1597136428.0939364-24094-36864609799735="` echo /home/ansible/.ansible/tmp/ansible-tmp-1597136428.0939364-24094-36864609799735 `" ) && sleep 0'
Using module file /app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ansible/modules/cloud/ovirt/ovirt_disk.py
<127.0.0.1> PUT /app/homes/ansible/.ansible/tmp/ansible-local-23909nslz0cij/tmptw32qp39 TO /app/homes/ansible/.ansible/tmp/ansible-tmp-1597136428.0939364-24094-36864609799735/AnsiballZ_ovirt_disk.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/ansible/.ansible/tmp/ansible-tmp-1597136428.0939364-24094-36864609799735/ /home/ansible/.ansible/tmp/ansible-tmp-1597136428.0939364-24094-36864609799735/AnsiballZ_ovirt_disk.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/app/ansible/ovirt/tools/Python-3.8.5/bin/python3.8 /home/ansible/.ansible/tmp/ansible-tmp-1597136428.0939364-24094-36864609799735/AnsiballZ_ovirt_disk.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/ansible/.ansible/tmp/ansible-tmp-1597136428.0939364-24094-36864609799735/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_ovirt_disk_payload_e2ur8e_i/ansible_ovirt_disk_payload.zip/ansible/modules/cloud/ovirt/ovirt_disk.py", line 737, in main
  File "/tmp/ansible_ovirt_disk_payload_e2ur8e_i/ansible_ovirt_disk_payload.zip/ansible/module_utils/ovirt.py", line 621, in create
    entity = self._service.add(
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/services.py", line 7697, in add
    return self._internal_add(disk, headers, query, wait)
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/service.py", line 232, in _internal_add
    return future.wait() if wait else future
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/service.py", line 55, in wait
    return self._code(response)
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/service.py", line 229, in callback
    self._check_fault(response)
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/service.py", line 132, in _check_fault
    self._raise_error(response, body)
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/service.py", line 118, in _raise_error
    raise error
ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Cannot add Virtual Disk. The provided LUN is not visible by the specified host, please check storage server connectivity.]". HTTP response code is 400.
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "activate": true,
            "auth": {
                "insecure": true,
                "password": "userpassword",
                "url": "https://olvm.mydomain/ovirt-engine/api",
                "username": "ansible@internal"
            },
            "bootable": null,
            "content_type": "data",
            "description": null,
            "download_image_path": null,
            "fetch_nested": false,
            "force": false,
            "format": "cow",
            "host": "kvm01",
            "id": null,
            "image_provider": null,
            "interface": null,
            "logical_unit": {
                "id": "36000144xxxxxxxx1d38",
                "storage_type": "fcp"
            },
            "name": "dlun_TEST01",
            "nested_attributes": [],
            "openstack_volume_type": null,
            "poll_interval": 3,
            "profile": null,
            "quota_id": null,
            "shareable": null,
            "size": null,
            "sparse": null,
            "sparsify": null,
            "state": "present",
            "storage_domain": null,
            "storage_domains": null,
            "timeout": 180,
            "upload_image_path": null,
            "vm_id": null,
            "vm_name": "dlun",
            "wait": true,
            "wipe_after_delete": null
        }
    },
    "msg": "Fault reason is \"Operation Failed\". Fault detail is \"[Cannot add Virtual Disk. The provided LUN is not visible by the specified host, please check storage server connectivity.]\". HTTP response code is 400."

Although we can add the LUN via this host in UI:

UI_DirectLUN_List

If we remove the KVM host from the task, the direct LUN will be created but we receive the following error:

TASK [VM -> Add Direct LUNs] ****************************************************************************************************************************************
task path: /app/ansible/ovirt/DBCLUSTER_dlun.yml:35
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: ansible
<127.0.0.1> EXEC /bin/sh -c 'echo ~ansible && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/ansible/.ansible/tmp `"&& mkdir /home/ansible/.ansible/tmp/ansible-tmp-1597161047.3235068-7178-41153481182820 && echo ansible-tmp-1597161047.3235068-7178-41153481182820="` echo /home/ansible/.ansible/tmp/ansible-tmp-1597161047.3235068-7178-41153481182820 `" ) && sleep 0'
Using module file /app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ansible/modules/cloud/ovirt/ovirt_disk.py
<127.0.0.1> PUT /app/homes/ansible/.ansible/tmp/ansible-local-6988q6ur1ftc/tmp1pq4_ccj TO /app/homes/ansible/.ansible/tmp/ansible-tmp-1597161047.3235068-7178-41153481182820/AnsiballZ_ovirt_disk.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/ansible/.ansible/tmp/ansible-tmp-1597161047.3235068-7178-41153481182820/ /home/ansible/.ansible/tmp/ansible-tmp-1597161047.3235068-7178-41153481182820/AnsiballZ_ovirt_disk.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/app/ansible/ovirt/tools/Python-3.8.5/bin/python3.8 /home/ansible/.ansible/tmp/ansible-tmp-1597161047.3235068-7178-41153481182820/AnsiballZ_ovirt_disk.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/ansible/.ansible/tmp/ansible-tmp-1597161047.3235068-7178-41153481182820/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_ovirt_disk_payload_ksta8q1c/ansible_ovirt_disk_payload.zip/ansible/modules/cloud/ovirt/ovirt_disk.py", line 737, in main
  File "/tmp/ansible_ovirt_disk_payload_ksta8q1c/ansible_ovirt_disk_payload.zip/ansible/module_utils/ovirt.py", line 621, in create
    entity = self._service.add(
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/services.py", line 7697, in add
    return self._internal_add(disk, headers, query, wait)
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/service.py", line 232, in _internal_add
    return future.wait() if wait else future
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/service.py", line 55, in wait
    return self._code(response)
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/service.py", line 229, in callback
    self._check_fault(response)
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/service.py", line 132, in _check_fault
    self._raise_error(response, body)
  File "/app/ansible/ovirt/tools/Python-3.8.5/lib/python3.8/site-packages/ovirtsdk4/service.py", line 118, in _raise_error
    raise error
ovirtsdk4.NotFoundError: Fault reason is "Operation Failed". Fault detail is "Entity not found: b2db373a-5cb3-41e7-a2c2-3428e74add19". HTTP response code is 404.
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "activate": true,
            "auth": {
                "insecure": true,
                "password": "userpassword",
                "url": "https://olvm.mydomain/ovirt-engine/api",
                "username": "ansible@internal"
            },
            "bootable": null,
            "content_type": "data",
            "description": null,
            "download_image_path": null,
            "fetch_nested": false,
            "force": false,
            "format": "cow",
            "host": null,
            "id": null,
            "image_provider": null,
            "interface": null,
            "logical_unit": {
                "id": "36000144xxxxxxxx1d38",
                "storage_type": "fcp"
            },
            "name": "dlun_TEST01",
            "nested_attributes": [],
            "openstack_volume_type": null,
            "poll_interval": 3,
            "profile": null,
            "quota_id": null,
            "shareable": null,
            "size": null,
            "sparse": null,
            "sparsify": null,
            "state": "present",
            "storage_domain": null,
            "storage_domains": null,
            "timeout": 180,
            "upload_image_path": null,
            "vm_id": null,
            "vm_name": "dlun",
            "wait": true,
            "wipe_after_delete": null
        }
    },
    "msg": "Fault reason is \"Operation Failed\". Fault detail is \"Entity not found: b2db373a-5cb3-41e7-a2c2-3428e74add19\". HTTP response code is 404."

There is actually a direct LUN with the mentioned ID, but it doesn't look correct in terms of size <1GiB instead of 16GiB and it is not attached to the VM.

Incorrect_DirectLUN

@ansibot
Copy link
Contributor

ansibot commented Aug 11, 2020

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. cloud collection Related to Ansible Collections work collection:ovirt.ovirt module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md needs_triage Needs a first human triage before being processed. ovirt oVirt and RHV community python3 support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback. labels Aug 11, 2020
@Akasurde
Copy link
Member

Thank you very much for your interest in Ansible. This plugin/module is no longer maintained in this repository and has been migrated to https://github.com/oVirt/ovirt-ansible-collection

Migrated this issue in the above repository - oVirt/ovirt-ansible-collection#80.

If you have further questions please stop by IRC or the mailing list:

@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Aug 12, 2020
@ansible ansible locked and limited conversation to collaborators Sep 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. cloud collection Related to Ansible Collections work module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md ovirt oVirt and RHV community python3 support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.
Projects
None yet
Development

No branches or pull requests

4 participants