Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1404464 - Heat doesn't inject personality files on rebuild
Heat doesn't inject personality files on rebuild
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-heat (Show other bugs)
7.0 (Kilo)
Unspecified Unspecified
medium Severity medium
: async
: 7.0 (Kilo)
Assigned To: Rabi Mishra
Amit Ugol
: Triaged, ZStream
Depends On:
Blocks: 1424578 1424586 1424587
  Show dependency treegraph
 
Reported: 2016-12-13 17:13 EST by Robin Cernin
Modified: 2018-02-08 06:27 EST (History)
13 users (show)

See Also:
Fixed In Version: openstack-heat-2015.1.4-3.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1424578 1424586 1424587 (view as bug list)
Environment:
Last Closed: 2017-06-14 11:31:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1650470 None None None 2016-12-16 03:16 EST
OpenStack gerrit 414127 None None None 2017-02-17 12:42 EST
Red Hat Product Errata RHSA-2017:1450 normal SHIPPED_LIVE Low: openstack-heat security and bug fix update 2017-06-14 15:18:59 EDT

  None (edit)
Description Robin Cernin 2016-12-13 17:13:58 EST
Description of problem:

When we change image and do heat stack update it doesn't re-inject the personality files.

By default OS::Nova::Server image_update_policy is doing REBUILD of an instance.

http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Nova::Server-prop-image_update_policy

We can see that in nova when we call rebuild we preserve all the VMs metadata and personality files.

Also it's bit confusing since in Heat Resource OS::Nova::Server it shows that the personality property is update_allowed: false and from the developer_guide [1] we can see that this means that update is accomplished only by delete and re-create.

# heat resource-type-show OS::Nova::Server  | grep personality -A6
    "personality": {
      "description": "A map of files to create/overwrite on the server upon boot. Keys are file names and values are the file contents.", 
      "default": {}, 
      "required": false, 
      "update_allowed": false, 
      "type": "map", 
      "immutable": false

When we switched the image_update_policy to REPLACE it worked, that could be explained by above.

However if the personality files are preserved with nova, shouldn't it also be same for Heat?

[1] http://docs.openstack.org/developer/heat/developing_guides/pluginguide.html

Version-Release number of selected component (if applicable):

heat 2015.1.2

How reproducible:

Steps to Reproduce:
1. Create stack
2. Change image to another image.
3. Update stack with new image

Actual results:

Personality files not injected

Expected results:

Inject personality files.

Additional info:

Possible patch submitted:

1, /usr/lib/python2.7/site-packages/heat/engine/resources/openstack/nova/server.py

def _update_image(self, prop_diff):
    image_update_policy = (prop_diff.get(self.IMAGE_UPDATE_POLICY) or self.properties[self.IMAGE_UPDATE_POLICY])
    image = prop_diff[self.IMAGE]
    image_id = self.client_plugin('glance').get_image_id(image)
    preserve_ephemeral = (image_update_policy == 'REBUILD_PRESERVE_EPHEMERAL')
    password = (prop_diff.get(self.ADMIN_PASS) or
    self.properties[self.ADMIN_PASS])
    personality_files = self.properties[self.PERSONALITY]
    kwargs = {'password': password,'preserve_ephemeral': preserve_ephemeral, 'files_to_inject':personality_files}
    prg = progress.ServerUpdateProgress(self.resource_id,'rebuild',handler_extra={'args': (image_id,), 'kwargs': kwargs})
    return prg

2,
/usr/lib/python2.7/site-packages/heat/engine/clients/os/nova.py

def rebuild(self, server_id, image_id, password=None,preserve_ephemeral=False, files_to_inject=None):
    """Rebuild the server and call check_rebuild to verify."""
    server = self.fetch_server(server_id)
    if server:
        server.rebuild(image_id, password=password,preserve_ephemeral=preserve_ephemeral,files=files_to_inject)
        return True
    else:
        return False
Comment 1 Zane Bitter 2016-12-15 17:06:08 EST
There may already be a patch for this upstream in a later release. We'll see if we can track it down.
Comment 2 Rabi Mishra 2016-12-16 03:14:37 EST
It seems we're not doing it. I've raised an upstream bug and would send a patch to fix it soon.
Comment 4 Rabi Mishra 2016-12-19 23:04:30 EST
Hi Robin,

I think this can be backported till mitaka(RHOS9) upstream. kilo(OSP7)/liberty(OSP8) releases are already EOL. I'm not sure if we can backport downstream to OSP7. Zane could you please confirm, if it's possible?
Comment 5 Zane Bitter 2016-12-21 12:33:34 EST
Once the fix and stable backports have been accepted upstream there's no reason we couldn't backport to RHOS 7/8.
Comment 6 Zane Bitter 2017-01-26 16:36:23 EST
Ocata fix and backports to Newton and Mitaka have all merged upstream.
Comment 10 Ronnie Rasouli 2017-06-14 04:26:02 EDT
medium BZ
Comment 12 errata-xmlrpc 2017-06-14 11:31:10 EDT
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/RHSA-2017:1450

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