RFE (libvirt-reproducer): misc improvements / nits in snapshot role

Bug #1769533 reported by Matt Young on 2018-05-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
High
Matt Young

Bug Description

This RFE is a result of testing / iterating on the CI squad's 12th sprint:

https://trello.com/c/JEGLSVh6/51-reproduce-ci-jobs-with-libvirt
https://trello.com/c/3aSQKPt6/69-add-snapshotting-capabilites-to-the-workflow#comment-5ae8ce37b2bd1af5775bd35b

---

A few (minor) things I noticed we might address in a future sprint. None IMHO should to be addressed in sprint 12.

If neither snapshot_create nor snapshot_restore is specified, the role should bail early and do nothing. Presently it'll reboot the VM's.

the README has the volume path variable defined and preloaded to default /opt/vm_images) but the sample playbook omits it. This causes the role to fail, but only after it's shut down VM's.

TASK [snapshot-libvirt : Commit any changes if a snapshot already exists]
fatal: [127.0.0.2]: FAILED! => {"failed": true, "msg": "The task includes an option with an undefined variable. The error was: 'libvirt_volume_path' is undefined\n\nThe error appears to have been in '/home/somedev/s12/validate-fs010/tripleo-quickstart-extras/roles/snapshot-libvirt/tasks/main.yml': line 27, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Commit any changes if a snapshot already exists\n ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'libvirt_volume_path' is undefined"}

If libvirt_volume_path is defined but points to a location that doesn't exist, or one that doesn't contain snapshots (in the restore case), we fail, but again only after the VM's have been shut down, and we then leave them off as the playbook fails.
TASK [snapshot-libvirt : Create snapshot]
failed: [127.0.0.2] (item={u'name': u'subnode-0'}) => {"changed": true, "cmd": "mv /opt/vm_images/subnode-0.qcow2 /opt/vm_images/subnode-0.qcow2.bak\n qemu-img create -f qcow2 -b /opt/vm_images/subnode-0.qcow2.bak /opt/vm_images/subnode-0.qcow2", "delta": "0:00:00.024475", "end": "2018-05-01 18:11:28.406737", "failed": true, "item": {"name": "subnode-0"}, "msg": "non-zero return code", "rc": 1, "start": "2018-05-01 18:11:28.382262", "stderr": "mv: cannot stat '/opt/vm_images/subnode-0.qcow2': No such file or directory\nqemu-img: /opt/vm_images/subnode-0.qcow2: Could not open '/opt/vm_images/subnode-0.qcow2.bak': No such file or directory\nCould not open backing image to determine size.", "stderr_lines": ["mv: cannot stat '/opt/vm_images/subnode-0.qcow2': No such file or directory", "qemu-img: /opt/vm_images/subnode-0.qcow2: Could not open '/opt/vm_images/subnode-0.qcow2.bak': No such file or directory", "Could not open backing image to determine size."], "stdout": "", "stdout_lines": []}
failed: [127.0.0.2] (item={u'name': u'subnode-1'}) => {"changed": true, "cmd": "mv /opt/vm_images/subnode-1.qcow2 /opt/vm_images/subnode-1.qcow2.bak\n qemu-img create -f qcow2 -b /opt/vm_images/subnode-1.qcow2.bak /opt/vm_images/subnode-1.qcow2", "delta": "0:00:00.016167", "end": "2018-05-01 18:11:29.004991", "failed": true, "item": {"name": "subnode-1"}, "msg": "non-zero return code", "rc": 1, "start": "2018-05-01 18:11:28.988824", "stderr": "mv: cannot stat '/opt/vm_images/subnode-1.qcow2': No such file or directory\nqemu-img: /opt/vm_images/subnode-1.qcow2: Could not open '/opt/vm_images/subnode-1.qcow2.bak': No such file or directory\nCould not open backing image to determine size.", "stderr_lines": ["mv: cannot stat '/opt/vm_images/subnode-1.qcow2': No such file or directory", "qemu-img: /opt/vm_images/subnode-1.qcow2: Could not open '/opt/vm_images/subnode-1.qcow2.bak': No such file or directory", "Could not open backing image to determine size."], "stdout": "", "stdout_lines": []}

Changed in tripleo:
milestone: rocky-2 → rocky-3
Changed in tripleo:
milestone: rocky-3 → rocky-rc1
Changed in tripleo:
milestone: rocky-rc1 → stein-1
Changed in tripleo:
milestone: stein-1 → stein-2
Changed in tripleo:
milestone: stein-2 → stein-3

Is this still being worked on?

Changed in tripleo:
milestone: stein-3 → stein-rc1
Changed in tripleo:
milestone: stein-rc1 → train-1
Changed in tripleo:
milestone: train-1 → train-2
Changed in tripleo:
milestone: train-2 → train-3
Changed in tripleo:
milestone: train-3 → ussuri-1
Changed in tripleo:
milestone: ussuri-1 → ussuri-2
wes hayutin (weshayutin) on 2020-02-10
Changed in tripleo:
milestone: ussuri-2 → ussuri-3
wes hayutin (weshayutin) on 2020-04-07
Changed in tripleo:
status: Triaged → Incomplete
wes hayutin (weshayutin) on 2020-04-13
Changed in tripleo:
milestone: ussuri-3 → ussuri-rc3
wes hayutin (weshayutin) on 2020-05-26
Changed in tripleo:
milestone: ussuri-rc3 → victoria-1
Changed in tripleo:
milestone: victoria-1 → victoria-3
Changed in tripleo:
milestone: victoria-3 → wallaby-1
Changed in tripleo:
milestone: wallaby-1 → wallaby-2
Changed in tripleo:
milestone: wallaby-2 → wallaby-3
Marios Andreou (marios-b) wrote :

This is an automated action. Bug status has been set to 'Incomplete' and target milestone has been removed due to inactivity. If you disagree please re-set these values and reach out to us on freenode #tripleo

Changed in tripleo:
milestone: wallaby-3 → none
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers