RoleValidator doesn't take into account volumes metadata from plugins

Bug #1619494 reported by Sergey Kreys
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Invalid
High
Fuel Sustaining
Mitaka
Invalid
High
Vladimir Kuklin

Bug Description

"fuel role --update" is failed if role metadata contains custom volume defined by some fuel plugin:

# fuel role --rel 2 --role aic-swift-storage --update --file ./aic-swift-storage.yaml
400 Client Error: Bad Request for url: http://1.0.35.2:8000/api/v1/releases/2/roles/aic-swift-storage/ (Wrong data in volumes_roles_mapping. Volumes with ids [u'swift-storage'] are not in the list of allowed volumes [u'os', u'logs', u'mongo', u'ceph', u'cephjournal', u'mysql', u'vm', u'image', u'horizon', u'cinder', u'cinder-block-device'])

Fuel plugin can provide custom volume metadata. Refer to method get_volumes_metadata in nailgun/objects/cluster.py - as an example how to get these volumes.

Steps to reproduce:
1) Install fuel plugin that provides custom volume (new volume with id 'swift-storage' - in our case);
2) assume that at a post-install step roles that use that custom volume from plugin are created; *
3) Update plugin to a newer version;
4) assume that after plugin update roles are going to be updated from updated yaml files. *

*Steps 2,4 can actually be done manually, without losing generality.

Expected results:
Roles are updated according to a metadata provided with updated fuel plugin.

Actual result:
"fuel role --update" is failed for roles with custom volumes in volumes_roles_mapping.

Reproducibility: always

Workaround: no

Impact: User is not able to update roles with new metadata.
Thus, if new version of fuel plugin contains change for allocate_size in volumes_roles_mapping, it will not be applied to existing environment.

Revision history for this message
Vitalii Kulanov (vitaliy-t) wrote :

Can you, please, specify fuel version?

Revision history for this message
Sergey Kreys (skreys) wrote :

[root@nailgun ~]# fuel -v
9.0.0

tags: added: area-python
Changed in fuel:
milestone: none → 9.1
assignee: nobody → Fuel Sustaining (fuel-sustaining-team)
importance: Undecided → High
status: New → Confirmed
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
milestone: 9.1 → 10.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/381324

Revision history for this message
Evgeniy L (rustyrobot) wrote :

`fuel role --update` command tries to update `releases` model, plugin roles are attached to cluster, not release.

There are multiple ways to deal with it:

1. The easiest way is to update plugin roles using plugin mechanism, which is a. change plugin, b. update it.

2. Do refactoring of the way we store roles, and create a full copy of roles metadata into cluster related model, after that reimplement roles update handler and cli, to be able to update roles for cluster, not for release, using this mechanism we will be able to accumulate per-cluster roles.

Revision history for this message
Vladimir Kuklin (vkuklin) wrote :

The issue is that you are using release roles instead of plugin-provided roles. You need to refactor the plugin to use plugin-provided roles.

Changed in fuel:
status: Confirmed → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (stable/mitaka)

Change abandoned by Vladimir Kuklin (<email address hidden>) on branch: stable/mitaka
Review: https://review.openstack.org/381324

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.