Bug 1262454 - os-cloud-config: with fake_pxe pm_type in instackenv.json and thus no pm_addr entry, "openstack baremetal import --json instackenv.json" exits with: ERROR: openstack 'pm_addr'
os-cloud-config: with fake_pxe pm_type in instackenv.json and thus no pm_addr...
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: os-cloud-config (Show other bugs)
unspecified
x86_64 Linux
high Severity high
: y1
: 7.0 (Kilo)
Assigned To: Lucas Alvares Gomes
Alexander Chuzhoy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-11 14:37 EDT by Alexander Chuzhoy
Modified: 2015-10-08 08:19 EDT (History)
9 users (show)

See Also:
Fixed In Version: os-cloud-config-0.2.8-7.el7ost
Doc Type: Bug Fix
Doc Text:
The director expected power management authentication details when using the fake_pxe driver. This caused failure when registering nodes. This fix updates the os-cloud-config tool to disregard pm_addr, pm_password, and pm_user when using the fake_pxe driver. The director now successfully registers nodes using the fake_pxe driver.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-08 08:19:02 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
OpenStack gerrit 223046 None None None Never

  None (edit)
Description Alexander Chuzhoy 2015-09-11 14:37:07 EDT
os-cloud-config: with fake_pxe pm_type in instackenv.json and thus no pm_addr entry,  "openstack baremetal import --json instackenv.json"  exists with: ERROR: openstack 'pm_addr'


Environment:
instack-undercloud-2.1.2-25.el7ost.noarch
openstack-ironic-api-2015.1.1-4.el7ost.noarch
os-cloud-config-0.2.8-6.el7ost.noarch
python-ironic-discoverd-1.1.0-6.el7ost.noarch
openstack-ironic-common-2015.1.1-4.el7ost.noarch
python-ironicclient-0.5.1-10.el7ost.noarch
openstack-ironic-discoverd-1.1.0-6.el7ost.noarch
openstack-heat-api-cloudwatch-2015.1.1-3.el7ost.noarch
openstack-ironic-conductor-2015.1.1-4.el7ost.noarch


Steps to reproduce:
1. Install the undercloud.
2. Enable the fake_pxe driver in ironic.
3. 
With the instack file looking as following:
{                                                  
    "nodes":[                                      
        {                                          
            "pm_type":"fake_pxe",                  
            "mac":[                                
                "00:0a:f7:79:93:18"                
            ],                                     
            "cpu":null,                            
            "memory":null,                         
            "disk":null,                           
            "arch":null                            
        },                                         
        {                                          
            "pm_type":"fake_pxe",                  
            "mac":[                                
                "00:0a:f7:79:93:ce"                
            ],                                     
            "cpu":null,                            
            "memory":null,                         
            "disk":null,                           
            "arch":null
        },
        {
            "pm_type":"fake_pxe",
            "mac":[
                "00:0a:f7:79:93:2a"
            ],
            "cpu":null,
            "memory":null,
            "disk":null,
            "arch":null
        },
        {
            "pm_type":"fake_pxe",
            "mac":[
                "00:0a:f7:79:93:1a"
            ],
            "cpu":null,
            "memory":null,
            "disk":null,
            "arch":null
        }
    ]
}

Attempt to run:
openstack baremetal import --json instackenv.json


Result:
 ERROR: openstack 'pm_addr'

Expected result:

All the nodes using the fake_pxe pm_type should be added despite the missing pm_addr.
Comment 3 James Slagle 2015-09-11 17:39:42 EDT
can you try adding pm_addr to the json file, but set it to the empty string?

pm_addr: ""
Comment 4 James Slagle 2015-09-11 17:40:05 EDT
Lucas, can you have a look at this one?
Comment 5 Alexander Chuzhoy 2015-09-11 18:03:15 EDT
Changed the instackenv.json to the following (also tried with "pm_addr": null):
{                                                                         
    "nodes":[                                                             
        {                                                                 
            "pm_type":"fake_pxe",                                         
            "mac":[                                                       
                "00:0a:f7:79:93:18"                                       
            ],                                                            
            "cpu":null,                                                   
            "memory":null,                                                
            "disk":null,                                                  
            "arch":null,                                                  
            "pm_addr":""                                                  
        },                                                                
        {                                                                 
            "pm_type":"fake_pxe",                                         
            "mac":[                                                       
                "00:0a:f7:79:93:ce"                                       
            ],                                                            
            "cpu":null,                                                   
            "memory":null,                                                
            "disk":null,                                                  
            "arch":null,                                                  
            "pm_addr":""                                                  
        },                                                                
        {
            "pm_type":"fake_pxe",
            "mac":[
                "00:0a:f7:79:93:2a"
            ],
            "cpu":null,
            "memory":null,
            "disk":null,
            "arch":null,
            "pm_addr":""
        },
        {
            "pm_type":"fake_pxe",
            "mac":[
                "00:0a:f7:79:93:1a"
            ],
            "cpu":null,
            "memory":null,
            "disk":null,
            "arch":null,
            "pm_addr":""
        }
    ]
}


This time, when I run "openstack baremetal import --json instackenv.json" -  I get:
ERROR: openstack local variable 'driver_info' referenced before assignment
Comment 6 Lucas Alvares Gomes 2015-09-14 07:21:09 EDT
Hi Alexander,

I've uploaded a fix upstream to os-cloud-config and put a patch backporting it into ospd (see external trackers). Lemme know if that works for you.
Comment 7 Alexander Chuzhoy 2015-09-14 10:55:33 EDT
The patch worked!
I was able to register the nodes. Here's my instackenv.json file:

{                                                                                                            
    "nodes":[                                                                                                
        {                                                                                                    
            "pm_type":"fake_pxe",                                                                            
            "mac":[                                                                                          
                "00:0a:f7:79:93:18"                                                                          
            ],                                                                                               
            "cpu":null,                                                                                      
            "memory":null,                                                                                   
            "disk":null,                                                                                     
            "arch":null                                                                                      
        },                                                                                                   
        {                                                                                                    
            "pm_type":"fake_pxe",                                                                            
            "mac":[                                                                                          
                "00:0a:f7:79:93:ce"                                                                          
            ],                                                                                               
            "cpu":null,                                                                                      
            "memory":null,                                                                                   
            "disk":null,                                                                                     
            "arch":null
        },
        {
            "pm_type":"fake_pxe",
            "mac":[
                "00:0a:f7:79:93:2a"
            ],
            "cpu":null,
            "memory":null,
            "disk":null,
            "arch":null
        },
        {
            "pm_type":"fake_pxe",
            "mac":[
                "00:0a:f7:79:93:1a"
            ],
            "cpu":null,
            "memory":null,
            "disk":null,
            "arch":null
        }
    ]
}
Comment 10 Alexander Chuzhoy 2015-09-16 10:47:02 EDT
Verified:
os-cloud-config-0.2.8-7.el7ost.noarch

The reported issue doesn't reproduce and the nodes are registered successfully.
Comment 12 errata-xmlrpc 2015-10-08 08:19:02 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-2015:1862

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