Ironic virt driver should not JSON encode traits in instance_info

Bug #1748942 reported by Mark Goddard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Mark Goddard
Queens
Fix Committed
Low
Mark Goddard

Bug Description

As of queens, the ironic virt driver pushes traits set on the flavor to the ironic node's instance_info during instance spawn. This list of traits is currently encoded as a JSON string, inside the JSON-encoded instance_info. We should not use this double layer of JSON encoding, as ironic expects instance_info.traits to be a list.

Steps to reproduce
==================

Add a trait to an ironic node:

openstack baremetal node add trait <node> <trait>

Add a required trait to a flavor:

openstack flavor set <flavor> --property 'trait:<trait>=required'

Create an instance using this flavor:

openstack server create ...

Expected result
===============

Nova sets the node's instance_info.traits to a list containing the trait.

Actual result
=============

Nova sets the node's instance_info.traits to a JSON-encoded string containing a list containing the trait.

Environment
===========

Nova stable/queens @ 01b756f960ed19ab801994d08d749dd94d729a22

Tags: ironic
Mark Goddard (mgoddard)
Changed in nova:
assignee: nobody → Mark Goddard (mgoddard)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/543574

Changed in nova:
status: New → In Progress
Revision history for this message
Matt Riedemann (mriedem) wrote :

How is instance_info.traits used in nova? What impact does this have? What doesn't work if we don't fix this?

tags: added: ironic
Revision history for this message
Matt Riedemann (mriedem) wrote :

(1:29:28 PM) mgoddard: mriedem: the scheduling works, but any flavor-requested traits won't be pushed to the ironic node's instance_info. These are not yet used by ironic, but will be used in future for some capabilities-like things
(1:29:49 PM) mriedem: mgoddard: if they aren't used in ironic in queens, then it's not something worth holding up rc2 IMO

Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/543574
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=54713a834f2a0e5b55b8f77c601ff35eb74b9b09
Submitter: Zuul
Branch: master

commit 54713a834f2a0e5b55b8f77c601ff35eb74b9b09
Author: Mark Goddard <email address hidden>
Date: Mon Feb 12 18:35:33 2018 +0000

    Don't JSON encode instance_info.traits for ironic

    As of queens, the ironic virt driver pushes traits set on the flavor to
    the ironic node's instance_info during instance spawn. This list of
    traits is currently encoded as a JSON string, inside the JSON-encoded
    instance_info. We should not use this double layer of JSON encoding, as
    ironic expects instance_info.traits to be a list.

    This change removes the nested JSON encoding when setting
    node.instance_info.traits.

    Change-Id: I1f3f96f7ef310022accde67cab1ae415bbc3c292
    Closes-Bug: #1748942

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/545037

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/queens)

Reviewed: https://review.openstack.org/545037
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d0c10db716c6d5a90ed329ba4806535ec91b34c0
Submitter: Zuul
Branch: stable/queens

commit d0c10db716c6d5a90ed329ba4806535ec91b34c0
Author: Mark Goddard <email address hidden>
Date: Mon Feb 12 18:35:33 2018 +0000

    Don't JSON encode instance_info.traits for ironic

    As of queens, the ironic virt driver pushes traits set on the flavor to
    the ironic node's instance_info during instance spawn. This list of
    traits is currently encoded as a JSON string, inside the JSON-encoded
    instance_info. We should not use this double layer of JSON encoding, as
    ironic expects instance_info.traits to be a list.

    This change removes the nested JSON encoding when setting
    node.instance_info.traits.

    Change-Id: I1f3f96f7ef310022accde67cab1ae415bbc3c292
    Closes-Bug: #1748942
    (cherry picked from commit 54713a834f2a0e5b55b8f77c601ff35eb74b9b09)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.0.0rc2

This issue was fixed in the openstack/nova 17.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 18.0.0.0b1

This issue was fixed in the openstack/nova 18.0.0.0b1 development milestone.

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.