Bug 1278181

Summary: 55-heat-config shouldn't use /var/run for it's DEPLOYED_DIR
Product: Red Hat OpenStack Reporter: James Slagle <jslagle>
Component: openstack-heat-templatesAssignee: Steve Baker <sbaker>
Status: CLOSED ERRATA QA Contact: Amit Ugol <augol>
Severity: unspecified Docs Contact:
Priority: urgent    
Version: 7.0 (Kilo)CC: apevec, calfonso, jcoufal, jliberma, josorior, jslagle, lhh, mburns, mcornea, rbiba, sasha, sbaker, yeylon
Target Milestone: z3Keywords: ZStream
Target Release: 7.0 (Kilo)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-heat-templates-0-0.8.20150605git.el7ost Doc Type: Bug Fix
Doc Text:
This update moves the deployed directory from /var/run/heat-config/deployed, which is usually tmpfs, to /var/lib/heat-config/deployed, which allows the deployed state to persist across reboots.
Story Points: ---
Clone Of:
: 1405896 (view as bug list) Environment:
Last Closed: 2015-12-21 17:02:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description James Slagle 2015-11-04 21:12:54 UTC
The os-refresh-config script 55-heat-config uses /var/run for the value of it's DEPLOYED_DIR variable. DEPLOYED_DIR is then used to determine what SoftwareDeployments have already been applied or not.

The issue is that /var/run is often tmpfs mounted, which means after a reboot and any subsequent os-collect-config metadata changes all the SoftwareDeployemnts are reapplied whether they should be or not.

Comment 2 Steve Baker 2015-11-04 21:37:11 UTC
The permanent fix will be in heat-templates, but if we need a fix which doesn't require a new image we could put a workaround in tripleo-heat-templates which moves existing files from /var/run/heat-config to /var/lib/heat-config and creates a symlink from /var/run/heat-config to /var/lib/heat-config

Comment 7 James Slagle 2015-11-06 15:24:28 UTC
i think we need an async update to openstack-heat-templates to address this, or at the very least in z3.

the package update could have a %post script to do a migration of the existing /var/run/heat-config to a more persistent location

steve what are your thoughts on this and when it could get done?

Comment 8 Steve Baker 2015-11-06 21:39:19 UTC
If it is a priority I can do it early next week.

As an alternative to %post migration, 55-heat-config could check for old and new paths and self-migrate the next time it is run.

Comment 9 Steve Baker 2015-11-10 23:22:31 UTC
Upstream fix is ready for review, its not obvious to me whether this gets downstream via rebase or rh gerrit.

Comment 13 James Slagle 2015-12-01 00:55:41 UTC
there's an additional fix needed for this one, so moving back to ON_DEV. the patches are posted (see external ref's).

Comment 14 Amit Ugol 2015-12-09 13:46:32 UTC
Unless I am missing something here, then /var/run must not be used at all.
on this version: openstack-heat-templates-0-0.8.20150605git.el7ost.noarch
and in this file /usr/share/openstack-heat-templates/software-config/heat-container-agent/scripts/55-heat-config
lines 27 and 31 point to /var/run anyway.

Comment 15 Amit Ugol 2015-12-10 14:37:30 UTC
I re-read it again. If the script is there, moving things after reboot and upgrade works (7.0 to 7.2 and 7.1 to 7.2 works at this time) then this is suffice to say that it did its job and verify this bug.

Comment 17 errata-xmlrpc 2015-12-21 17:02:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2015:2680