Bug 1256471

Summary: openstack baremetal import locks client with wrong ipmi ip address
Product: Red Hat OpenStack Reporter: ldomb
Component: openstack-ironicAssignee: Lucas Alvares Gomes <lmartins>
Status: CLOSED WONTFIX QA Contact: Toure Dunnon <tdunnon>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0 (Kilo)CC: dtantsur, srevivo
Target Milestone: ---Keywords: ZStream
Target Release: 8.0 (Liberty)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-06 15:00:24 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 ldomb 2015-08-24 16:33:24 UTC
Description of problem:

When adding a node with a wrong ipmi ip address the node cannot be removed from with ironic node-delete $uuid as the Node gets Locked. 

The only way to delete the node is: 

sudo mysql -u root -p

use ironic;

MariaDB [ironic]> select * from ports;
+---------------------+------------+----+--------------------------------------+-------------------+---------+-------+
| created_at          | updated_at | id | uuid                                 | address           | node_id | extra |
+---------------------+------------+----+--------------------------------------+-------------------+---------+-------+
| 2015-08-24 13:41:48 | NULL       |  5 | 06285093-b4ca-45e3-b920-266f7012adb7 | 1c:c1:de:71:b6:be |       5 | {}    |
+---------------------+------------+----+--------------------------------------+-------------------+---------+-------+
1 row in set (0.00 sec)

MariaDB [ironic]> delete from ports where uuid='06285093-b4ca-45e3-b920-266f7012adb7'
    -> ;
Query OK, 1 row affected (0.01 sec)

MariaDB [ironic]> delete from nodes where uuid='a48d7c3f-0008-462b-a2e1-179a3e5efc79';
Query OK, 1 row affected (0.01 sec)

MariaDB [ironic]> quit
Bye
[stack@ospdirector ~]$ ironic node-list
+------+------+---------------+-------------+-----------------+-------------+
| UUID | Name | Instance UUID | Power State | Provision State | Maintenance |
+------+------+---------------+-------------+-----------------+-------------+
+------+------+---------------+-------------+-----------------+-------------+
[stack@ospdirector ~]$ 


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


How reproducible:

Add a node with a wrong pm_addr

"pm_addr":"192.168.1.12"


Steps to Reproduce:
1. Create a instack.json with a pm_addr which does not match any ipmi address
2. openstack baremetal import --json instack.json
3. ironic node-list
4. ironic node-delete $uuid

Step 4 will fail.

Actual results:
Step 4 will fail.

Expected results:
Node should get deleted.

Additional info:

Comment 3 Dmitry Tantsur 2016-09-06 15:00:24 UTC
Hello!

The behavior is quite expected actually: Ironic tries to reach out to the wrong IP to check node's power state, and the request hangs. We've done quite a few things to avoid that, but the "import" command explicitly requests Ironic to do the power state validation. After a few minutes the node should go to maintenance mode and then you can delete it.