Bug 1882451 - "list index out of range" error during HE deployment
Summary: "list index out of range" error during HE deployment
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-ansible-collection
Classification: oVirt
Component: General
Version: 1.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-4.4.3
: ---
Assignee: Martin Necas
QA Contact: Petr Matyáš
URL:
Whiteboard:
: 1890369 (view as bug list)
Depends On:
Blocks: 1879995 1890425
TreeView+ depends on / blocked
 
Reported: 2020-09-24 15:33 UTC by Asaf Rachmani
Modified: 2020-11-11 06:47 UTC (History)
12 users (show)

Fixed In Version: ovirt-ansible-collection-1.2.0-0.2
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-11 06:41:50 UTC
oVirt Team: Infra
Embargoed:
pm-rhel: ovirt-4.4+
pm-rhel: blocker?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-ansible-collection pull 132 0 None closed ovirt_vm: fix template search 2020-11-09 09:20:50 UTC

Description Asaf Rachmani 2020-09-24 15:33:11 UTC
Description of problem:
HE deployment fails probably due to the following code change in ovirt_vm module:
https://github.com/oVirt/ovirt-ansible-collection/pull/108/files

Error:

TASK [ovirt.ovirt.hosted_engine_setup : Trigger hosted engine OVF update and enable the serial console] **************************************************************************************
task path: /usr/share/ansible/collections/ansible_collections/ovirt/ovirt/roles/hosted_engine_setup/tasks/create_target_vm/03_hosted_engine_final_tasks.yml:6
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir /root/.ansible/tmp/ansible-tmp-1600935825.121518-1986870-42701854023323 && echo ansible-tmp-1600935825.121518-1986870-42701854023323="` echo /root/.ansible/tmp/ansible-tmp-1600935825.121518-1986870-42701854023323 `" ) && sleep 0'
Using module file /usr/share/ansible/collections/ansible_collections/ovirt/ovirt/plugins/modules/ovirt_vm.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-1952173_lc2y5ac/tmp_j1nft1r TO /root/.ansible/tmp/ansible-tmp-1600935825.121518-1986870-42701854023323/AnsiballZ_ovirt_vm.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1600935825.121518-1986870-42701854023323/ /root/.ansible/tmp/ansible-tmp-1600935825.121518-1986870-42701854023323/AnsiballZ_ovirt_vm.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/libexec/platform-python /root/.ansible/tmp/ansible-tmp-1600935825.121518-1986870-42701854023323/AnsiballZ_ovirt_vm.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1600935825.121518-1986870-42701854023323/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_ovirt_vm_payload__c4v3vsk/ansible_ovirt_vm_payload.zip/ansible_collections/ovirt/ovirt/plugins/modules/ovirt_vm.py", line 2571, in main
  File "/tmp/ansible_ovirt_vm_payload__c4v3vsk/ansible_ovirt_vm_payload.zip/ansible_collections/ovirt/ovirt/plugins/module_utils/ovirt.py", line 600, in create
    new_entity = self.build_entity()
  File "/tmp/ansible_ovirt_vm_payload__c4v3vsk/ansible_ovirt_vm_payload.zip/ansible_collections/ovirt/ovirt/plugins/modules/ovirt_vm.py", line 1444, in build_entity
  File "/tmp/ansible_ovirt_vm_payload__c4v3vsk/ansible_ovirt_vm_payload.zip/ansible_collections/ovirt/ovirt/plugins/modules/ovirt_vm.py", line 1379, in __get_template_with_version
IndexError: list index out of range
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "affinity_group_mappings": [],
            "affinity_label_mappings": [],
            "allow_partial_import": null,
            "ballooning_enabled": null,
            "bios_type": null,
            "boot_devices": null,
            "boot_menu": null,
            "cd_iso": null,
            "clone": false,
            "clone_permissions": false,
            "cloud_init": null,
            "cloud_init_nics": [],
            "cloud_init_persist": false,
            "cluster": null,
            "cluster_mappings": [],
            "comment": null,
            "cpu_cores": null,
            "cpu_mode": null,
            "cpu_pinning": null,
            "cpu_shares": null,
            "cpu_sockets": null,
            "cpu_threads": null,
            "custom_compatibility_version": null,
            "custom_emulated_machine": null,
            "custom_properties": null,
            "delete_protected": null,
            "description": "Hosted engine VM",
            "disk_format": "cow",
            "disks": [],
            "domain_mappings": [],
            "exclusive": null,
            "export_domain": null,
            "export_ova": null,
            "fetch_nested": false,
            "force": false,
            "force_migrate": null,
            "graphical_console": null,
            "high_availability": null,
            "high_availability_priority": null,
            "host": null,
            "host_devices": null,
            "id": "f6a5affe-58fa-439e-88e5-08cdde872342",
            "initrd_path": null,
            "instance_type": null,
            "io_threads": null,
            "kernel_params": null,
            "kernel_params_persist": false,
            "kernel_path": null,
            "kvm": null,
            "lease": null,
            "lun_mappings": [],
            "memory": null,
            "memory_guaranteed": null,
            "memory_max": null,
            "migrate": null,
            "name": null,
            "nested_attributes": [],
            "next_run": null,
            "nics": [],
            "numa_nodes": [],
            "numa_tune_mode": null,
            "operating_system": null,
            "placement_policy": null,
            "poll_interval": 3,
            "quota_id": null,
            "reassign_bad_macs": null,
            "rng_device": null,
            "role_mappings": [],
            "serial_console": true,
            "serial_policy": null,
            "serial_policy_value": null,
            "smartcard_enabled": null,
            "snapshot_name": null,
            "snapshot_vm": null,
            "soundcard_enabled": null,
            "sso": null,
            "state": "present",
            "stateless": null,
            "storage_domain": null,
            "sysprep": null,
            "template": null,
            "template_version": null,
            "ticket": null,
            "timeout": 180,
            "timezone": null,
            "type": null,
            "usb_support": null,
            "use_latest_template_version": null,
            "vmware": null,
            "vnic_profile_mappings": [],
            "wait": true,
            "watchdog": null,
            "xen": null
        }
    },
    "msg": "list index out of range"
}



Version-Release number of selected component (if applicable):
ovirt-ansible-collection-1.2.0-0.1.el8.noarch

Comment 1 Asaf Rachmani 2020-09-24 15:40:00 UTC
Martin, can you please have a look?

Comment 2 Martin Necas 2020-10-06 05:53:29 UTC
The PR was merged and will be released in ovirt-ansible-collection-1.2.0

Comment 3 Asaf Rachmani 2020-10-22 06:30:35 UTC
*** Bug 1890369 has been marked as a duplicate of this bug. ***

Comment 4 cshao 2020-10-22 09:58:31 UTC
Add "Testblocker" keyword due to this bug blocker HostEngine Testing on RHVH 4.4.3.

Comment 5 RHEL Program Management 2020-10-22 11:19:39 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 6 Petr Matyáš 2020-10-26 15:23:15 UTC
Verified on ovirt-ansible-collection-1.2.0-0.3.el8ev.noarch

I was able to run deploy of HE over RHVH hosts, not sure if there were other requirements, if there were please test on your env.

Comment 7 Sandro Bonazzola 2020-11-11 06:41:50 UTC
This bugzilla is included in oVirt 4.4.3 release, published on November 10th 2020.

Since the problem described in this bug report should be resolved in oVirt 4.4.3 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.