Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1647931

Summary: Incorrect capabilities handling on node update
Product: Red Hat OpenStack Reporter: Dmitry Tantsur <dtantsur>
Component: openstack-tripleo-commonAssignee: Dmitry Tantsur <dtantsur>
Status: CLOSED ERRATA QA Contact: Alexander Chuzhoy <sasha>
Severity: medium Docs Contact:
Priority: medium    
Version: 13.0 (Queens)CC: bfournie, jschluet, mariel, mburns, mlammon, slinaber
Target Milestone: z4Keywords: Triaged, ZStream
Target Release: 13.0 (Queens)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-common-8.6.6-7.el7ost Doc Type: Bug Fix
Doc Text:
Previously, when you updated a node from the undercloud, the `capabilities` field values were not always converted to a string value type. After this bug fix, the `capabilities field now always converts to the string value type during node updates.
Story Points: ---
Clone Of:
: 1655776 (view as bug list) Environment:
Last Closed: 2019-01-16 17:55:25 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:
Bug Depends On:    
Bug Blocks: 1655776    

Description Dmitry Tantsur 2018-11-08 15:04:13 UTC
Capabilities provided as a dict are not converted into string representation.

Comment 10 Dmitry Tantsur 2019-01-02 16:55:28 UTC
To be honest, I can no longer trigger the bug on unpatched master, but the idea was the following: you need to enroll nodes, then update them via instackenv.json by setting capabilities to a dict.

E.g. pick one node, and add/replace its "capabilities" in instackenv.json with "capabilities": {"profile": "control", "boot_option": "local", "foo": "bar"}. Then update the nodes via 'openstack overcloud node import instackenv.json'. The capabilities should be correctly converted to a string:

$ openstack baremetal node show control-0 -c properties                                                                                                                           
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                              |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| properties | {u'memory_mb': u'10240', u'cpu_arch': u'x86_64', u'local_gb': u'50', u'cpus': u'2', u'capabilities': u'profile:control,foo:bar,boot_option:local'} |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------+

Comment 11 mlammon 2019-01-02 19:22:57 UTC
13   -p 2018-12-13.4

Env:
(undercloud) [stack@undercloud-0 ~]$ sudo rpm -qa | grep openstack-tripleo-common
openstack-tripleo-common-containers-8.6.6-8.el7ost.noarch
openstack-tripleo-common-8.6.6-8.el7ost.noarch

original
controller-1 original capabilities
(undercloud) [stack@undercloud-0 ~]$ openstack baremetal node show controller-1 -c properties
+------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                                                                                       |
+------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| properties | {u'memory_mb': u'20480', u'cpu_arch': u'x86_64', u'local_gb': u'39', u'cpus': u'4', u'capabilities': u'cpu_aes:true,cpu_hugepages:true,boot_option:local,cpu_vt:true,cpu_hugepages_1g:true,boot_mode:bios'} |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------

Note: changed the boot_mode to uefi

.... instackenv.json

      "name": "controller-1",
      "mac": ["52:54:00:d4:82:b3"],
      "cpu": "4",
      "memory": "20480",
      "capabilities": {"profile": "controller", "boot_option": "local", "cpu_vt": "true", "cpu_hugepages_1g": "true", "boot_mode": "uefi"},
      "disk": "40",
            "arch": "x86_64",
              "pm_addr": "172.16.0.1",
        "pm_type": "ipmi",
        "pm_user": "admin",
        "pm_password": "password",
        "pm_port": "6231"

.....


openstack overcloud node import instackenv.json

You can see we successfully updated and did not have any error

(undercloud) [stack@undercloud-0 ~]$ openstack baremetal node show controller-1 -c properties
+------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                                                                          |
+------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| properties | {u'memory_mb': u'20480', u'cpu_arch': u'x86_64', u'local_gb': u'40', u'cpus': u'4', u'capabilities': u'boot_mode:uefi,boot_option:local,cpu_hugepages_1g:true,cpu_vt:true,profile:controller'} |
+------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Comment 14 errata-xmlrpc 2019-01-16 17:55:25 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-2019:0068