Upgrade fails when having cinder_qos_specs defined

Bug #1794525 reported by Marcus Murwall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
High
Jesse Pretorius

Bug Description

If you run the os-cinder-install playbook and have specified cinder_qos_specs the playbook will fail if the qos already exist in the system.

The error occurs here:
https://github.com/openstack/openstack-ansible-os_cinder/blob/f1b2eed3eb89f19acf543782c621edb6715ad6d5/tasks/cinder_qos.yml#L20

Here it does a: `{{ cinder_bin }}/cinder qos-list | grep -x {{ item.name }}`

grep definition:
 `-x, --line-regexp force PATTERN to match only whole lines`

The output from cinder qos-list will be something like:
```+--------------------------------------+------------------+-----------+-----------------------------+
| ID | Name | Consumer | specs |
+--------------------------------------+------------------+-----------+-----------------------------+
| 1a12340d-36af-48bf-9d36-b556bc252123 | my-qos-name | front-end | {'total_iops_sec': '40000'} |
+--------------------------------------+------------------+-----------+-----------------------------+```

item.name in the task will match the qos.name defined in this case:`my-qos-name`.

Since the "grep -x" matches the entire line it won't get any “hit”, which will make ansible try and create the qos again and that results in a failure on duplicate name.

If we do a `grep -w {{item_name}}` instead it will do a word match, which will work in this specific case.
Or, since we already know the name of the qos, we could just as well just do a cinder `qos-show <name>`, register that and base further execution based on if it exists or not.

Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :
Changed in openstack-ansible:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Jesse Pretorius (jesse-pretorius)
Changed in openstack-ansible:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.