RDO tickets are now tracked in Jira https://issues.redhat.com/projects/RDO/issues/
Bug 1229493 - Difficult to synchronise tuskar stored files with /usr/share/openstack-tripleo-heat-templates
Summary: Difficult to synchronise tuskar stored files with /usr/share/openstack-triple...
Keywords:
Status: CLOSED EOL
Alias: None
Product: RDO
Classification: Community
Component: openstack-tuskar
Version: trunk
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: Kilo
Assignee: Marios Andreou
QA Contact: Shai Revivo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-08 23:55 UTC by Steve Baker
Modified: 2016-05-19 15:38 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-05-19 15:38:48 UTC
Embargoed:


Attachments (Terms of Use)

Description Steve Baker 2015-06-08 23:55:59 UTC
The instack instructions say that an undercloud can be upgraded just by running yum update, however any changes to openstack-tripleo-heat-templates won't be pulled into the tuskar database unless /usr/libexec/os-refresh-config/configure.d/90-tuskar-db-sync is run again (and I could only get this to work by deleting the tuskar database and running all tuskar os-refresh-config scripts)

I have a couple of questions:
- Is there a documented way to sync the tuskar db with openstack-tripleo-heat-templates which doesn't involve a full os-refresh-config run?
- Has tuskar considered moving to a model where template files are not stored in the database so that no synchronisation is needed at all?

Comment 1 Jay Dobies 2015-06-09 15:15:22 UTC
I ran into this too last week. There's a process that we can document, but unfortunately it's going to involve deleting the plan and recreating it. Tuskar supports versioned roles which was supposed to answer this, but we don't have the client workflow in place for upgrading a plan to use a newer version of the role.

The reason they are stored in the DB is that they were supposed to be stored in swift but their APIs didn't support what we needed yet. The local DB was supposed to be a temporary thing.

The reason for storing them at all is the versioning; if a new version of the templates come out, we can't just blanket replace the existing ones since it will invalidate existing plans that contain configuration for the old versions of the templates.

Comment 2 Steve Baker 2015-06-09 21:59:25 UTC
Maybe the first step is to get most of the logic into their own /usr/bin/tuskar-* scripts, so these can be called by os-refresh-config or manually.

Comment 3 Jay Dobies 2015-06-10 15:11:03 UTC
Agreed. I've had that on my todo list for a while, but it keeps getting bumped. Now that I have a bug to hang the work off of, I'll try to prioritize it and get started on it today.

Comment 4 Jay Dobies 2015-06-12 18:11:09 UTC
First part of this is at: https://review.openstack.org/191170

Comment 5 Marios Andreou 2015-06-22 16:29:00 UTC
so the current way I reload roles is like:

roles=`tuskar role-list | grep OpenStack | awk '{print $2}'`
tuskar plan-delete overcloud
tuskar-delete-roles --config-file /etc/tuskar/tuskar.conf --uuids $roles
# manually execute the load-roles script from the tuskar image element to load roles and extra data
roles=`tuskar role-list | grep OpenStack | awk '{print $2}'`
tuskar plan-create overcloud
plan_id=`tuskar plan-list | grep overcloud | awk '{print $2}'`
for role in ${roles[@]}; do tuskar plan-add-role -r $role $plan_id; done


The workflow I'm aiming for is like:

1. tuskar plan-delete overcloud
2. tuskar-delete-roles --config-file /etc/tuskar/tuskar.conf --all
3. tuskar plan-create overcloud
4. tuskar load-roles --config-file /etc/tuskar/tuskar.conf --all
5. tuskar plan-add-role --all

====
2. is the review jdob has out @ https://review.openstack.org/191170
4. there is no --all flag to load-roles, I add this @ https://review.openstack.org/#/c/194224/ 
5. there is no --all flag to plan-add-role, I'll be visiting this soon unless someone beats me, if you do, please update here.


Also please comment if you think the workflow I'm aiming for makes sense given what we currently have and as a workflow we can at least document for when someone wants to reload their tripleo heat templates and then tuskar roles.

Comment 6 Marios Andreou 2015-06-23 15:05:48 UTC
added the --all for plan-add-role @  (tuskarclient) https://review.openstack.org/#/c/194693/

with this, and the two tuskar patches in place I can do:

tuskar plan-delete overcloud
tuskar-delete-roles --all
tuskar-load-roles --all -tht ./TEMPLATES_TEST/openstack-tripleo-heat-templates/
tuskar plan-create overcloud
tuskar plan-add-role --all-roles  ef2370b9-a139-458c-aab7-b55cbbc4323a

deploy

Comment 7 Jay Dobies 2015-06-23 16:36:47 UTC
This looks good. Do we want to change the os-refresh-config scripts to use these same calls instead of the bash they do today? It doesn't have to be part of this bug (we can file it separately), just something to think about.

Comment 9 Marios Andreou 2015-07-27 13:41:17 UTC
(I have added a section to the Advanced Deployment section of the docs for reloading of roles and plans, at https://review.gerrithub.io/241459 "Updates docs for for recreation of deployment plan and roles ")



To reset the deployment plan and all deployment roles:

#  1. Delete the management plan:
openstack management plan delete PLAN_UUID    # openstack management plan list will show you the plan and its uuid

#  2. Delete the management roles:
roles=`tuskar role-list | grep OpenStack | awk '{print $2}'`
tuskar-delete-roles --config-file /etc/tuskar/tuskar.conf --uuids $roles

#  3. Recreate the management roles:
/usr/share/tripleo-image-elements/tuskar/os-refresh-config/configure.d/90-tuskar-db-sync 
#     Note: this script defaults to /usr/share/openstack-tripleo-heat-templates/
#     for the tripleo-heat-templates to use in the role definitions. This can be
#     overridden with the TUSKAR_ROLE_DIRECTORY environment variable:
TUSKAR_ROLE_DIRECTORY=/foo /usr/share/tripleo-image-elements/tuskar/os-refresh-config/configure.d/90-tuskar-db-sync

#  4. Create a new management plan and associate the newly created roles to it:
/usr/share/tripleo-image-elements/tuskar/os-refresh-config/post-configure.d/101-plan-add-roles

For step 2 we actually already have an upstream '--all' flag for tuskar delete-roles @ [1] (jdob, merged upstream, but not in openstack-tuskar-0.4.18-3.el7ost.noarch ). 
For step 3 we have an upstream '--all' flag for tuskar load-roles @ [2] (marios, unmerged)
For step 4 we have an upstream '--all' flag for tuskar plan-add-role @ [3] (marios, unmgerged)

With these applied the workflow becomes:

openstack management plan delete PLAN_UUID    # openstack management plan list will show you the plan and its uuid
tuskar-delete-roles --all
tuskar-load-roles --all -tht ./TEMPLATES_TEST/openstack-tripleo-heat-templates/
tuskar plan-create overcloud
tuskar plan-add-role --all-roles NEW_PLAN_UUID

Comment 12 Mike McCune 2016-03-28 23:00:31 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 14 Chandan Kumar 2016-05-19 15:38:48 UTC
This bug is against a Version which has reached End of Life.
If it's still present in supported release (http://releases.openstack.org), please update Version and reopen.


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