Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

remove version lock from the engine #318

Merged
merged 1 commit into from
May 3, 2020

Conversation

eslutsky
Copy link
Contributor

the patch removes the yam version lock , after the engine recovery and before the engine-setup role execution.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1827135
Signed-off-by: Evgeny Slutsky eslutsky@redhat.com

Copy link
Member

@sandrobonazzola sandrobonazzola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have considered calling rm on the versionlock list file instead of calling yum

@sandrobonazzola
Copy link
Member

ci test please

@michalskrivanek
Copy link
Member

why is done in the ansible role and not inside engine-backup when doing the restore? How is it a unique problem to this role and not a general problem of restoring(upgrading) from older release?

@eslutsky
Copy link
Contributor Author

why is done in the ansible role and not inside engine-backup when doing the restore? How is it a unique problem to this role and not a general problem of restoring(upgrading) from older release?

agreed, it better to be part of the engine-backup --restore flow.

@eslutsky eslutsky force-pushed the remove-lock-before-engine-setup branch from f9a5c83 to ea97f94 Compare April 28, 2020 09:31
Copy link
Member

@michalskrivanek michalskrivanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, sorry, maybe I wasn't clear in the last comment. I meant to fix this in the restore script itself, i.e. in https://github.com/oVirt/ovirt-engine/blob/master/packaging/bin/engine-backup.sh.in

you will face the same problem when upgrading manually without any ansible role involved

@eslutsky
Copy link
Contributor Author

oh, sorry, maybe I wasn't clear in the last comment. I meant to fix this in the restore script itself, i.e. in https://github.com/oVirt/ovirt-engine/blob/master/packaging/bin/engine-backup.sh.in

you will face the same problem when upgrading manually without any ansible role involved

@michalskrivanek, yes that what I was referring to.

see didi's comment on that:
https://bugzilla.redhat.com/show_bug.cgi?id=1827135#c6

@eslutsky eslutsky force-pushed the remove-lock-before-engine-setup branch from ea97f94 to 834bccd Compare April 28, 2020 09:48
@eslutsky eslutsky force-pushed the remove-lock-before-engine-setup branch 2 times, most recently from 92d8837 to 8fd0fe4 Compare April 28, 2020 10:17
@eslutsky
Copy link
Contributor Author

eslutsky commented Apr 30, 2020

removing the file /etc/dnf/plugins/versionlock.list causes this error when running engine-setup:

[ ERROR ] fatal: [localhost -> engine.es.localvms.com]: FAILED! => {"changed": false, "module_stderr": "Shared connection to engine.es.localvms.com closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/usr/lib/python3.6/site-packages/dnf-plugins/versionlock.py\", line 184, in _read_locklist\r\n    with open(locklist_fn) as llfile:\r\nFileNotFoundError: [Errno 2] No such file or directory: '/etc/dnf/plugins/versionlock.list'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/root/.ansible/tmp/ansible-tmp-1588248748.822611-1967-113087827221267/AnsiballZ_dnf.py\", line 102, in <module>\r\n    _ansiballz_main()\r\n  File \"/root/.ansible/tmp/ansible-tmp-1588248748.822611-1967-113087827221267/AnsiballZ_dnf.py\", line 94, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/root/.ansible/tmp/ansible-tmp-1588248748.822611-1967-113087827221267/AnsiballZ_dnf.py\", line 40, in invoke_module\r\n    runpy.run_module(mod_name='ansible.modules.packaging.os.dnf', init_globals=None, run_name='__main__', alter_sys=True)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\r\n    mod_name, mod_spec, pkg_name, script_name)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/tmp/ansible_dnf_payload_y5l1lo2t/ansible_dnf_payload.zip/ansible/modules/packaging/os/dnf.py\", line 1304, in <module>\r\n  File \"/tmp/ansible_dnf_payload_y5l1lo2t/ansible_dnf_payload.zip/ansible/modules/packaging/os/dnf.py\", line 1293, in main\r\n  File \"/tmp/ansible_dnf_payload_y5l1lo2t/ansible_dnf_payload.zip/ansible/modules/packaging/os/dnf.py\", line 1266, in run\r\n  File \"/tmp/ansible_dnf_payload_y5l1lo2t/ansible_dnf_payload.zip/ansible/modules/packaging/os/dnf.py\", line 649, in _base\r\n  File \"/usr/lib/python3.6/site-packages/dnf/base.py\", line 435, in fill_sack\r\n    self._plugins.run_sack()\r\n  File \"/usr/lib/python3.6/site-packages/dnf/plugin.py\", line 155, in run_sack\r\n    self._caller('sack')\r\n  File \"/usr/lib/python3.6/site-packages/dnf/plugin.py\", line 104, in _caller\r\n    getattr(plugin, method)()\r\n  File \"/usr/lib/python3.6/site-packages/dnf-plugins/versionlock.py\", line 78, in sack\r\n    for pat in _read_locklist():\r\n  File \"/usr/lib/python3.6/site-packages/dnf-plugins/versionlock.py\", line 190, in _read_locklist\r\n    raise dnf.exceptions.Error(NOT_READABLE % e)\r\ndnf.exceptions.Error: Unable to read version lock configuration: [Errno 2] No such file or directory: '/etc/dnf/plugins/versionlock.list'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

@eslutsky eslutsky force-pushed the remove-lock-before-engine-setup branch from 8fd0fe4 to fb5a0a8 Compare April 30, 2020 12:26
@michalskrivanek
Copy link
Member

@eslutsky @sandrobonazzola but Didi's comment suggests a different path - to stop updating the package, i.e. invoke engine-setup with --offline. That does solve the problem without touching/removing any files anywhere.

@eslutsky
Copy link
Contributor Author

eslutsky commented Apr 30, 2020

@eslutsky @sandrobonazzola but Didi's comment suggests a different path - to stop updating the package, i.e. invoke engine-setup with --offline. That does solve the problem without touching/removing any files anywhere.

@eslutsky @sandrobonazzola but Didi's comment suggests a different path - to stop updating the package, i.e. invoke engine-setup with --offline. That does solve the problem without touching/removing any files anywhere.

in this case we are invoking engine-setup role [0]
which tries to install ovirt-engine package regardless of the offline parameter [1]
so if the versionlock is set to incorrect OS it will fail to find the package.

[0]

- name: Engine Setup on local VM

[1] https://github.com/oVirt/ovirt-ansible-engine-setup/blob/baa98047ba902201aac4f595986c29816ad4d8fc/tasks/install_packages.yml#L2

@michalskrivanek
Copy link
Member

yep, so that's the only change needed. any package upgrade/installation need to happen before restore and engine-setup. then everything's going to work nicely

@eslutsky
Copy link
Contributor Author

eslutsky commented Apr 30, 2020

yep, so that's the only change needed. any package upgrade/installation need to happen before restore and engine-setup. then everything's going to work nicely

there are cases when engine-setup role runs against host which doesn't have the ovirt-engine package installed, so the deployment invoked through ansible only (without any wrappers).

@michalskrivanek
Copy link
Member

engine-setup role yes, but not the hosted-engine setup. the step you're fixing is part of the installation originating from appliance, so you always have ovirt-engine installed. It just may not be up to date (along with other outdated packages, so "dnf upgrade" makes sense to do in earlier step anyway

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1827135
Signed-off-by: Evgeny Slutsky <eslutsky@redhat.com>
@eslutsky eslutsky force-pushed the remove-lock-before-engine-setup branch from fb5a0a8 to e6fdb15 Compare April 30, 2020 13:42
@eslutsky eslutsky merged commit e920aaf into oVirt:master May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants