Bug 1269505

Summary: Deleting a node shouldn't depend on power state
Product: Red Hat OpenStack Reporter: Lucas Alvares Gomes <lmartins>
Component: openstack-ironicAssignee: Lucas Alvares Gomes <lmartins>
Status: CLOSED ERRATA QA Contact: Toure Dunnon <tdunnon>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0 (Kilo)CC: mburns, rhel-osp-director-maint, sclewis, srevivo
Target Milestone: z5Keywords: Triaged, ZStream
Target Release: 7.0 (Kilo)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-ironic-2015.1.2-3.el7ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-15 18:04:48 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 Lucas Alvares Gomes 2015-10-07 12:47:42 UTC
Description of problem:

When deleting a node Ironic will check two things:

1) Whether a node is associated with an instance and if so it will prevent the deletion.

2) If a node is powred on and if so it will prevent the deletion.

For 1) this only makes sense when used with Nova because nova will update the instance_uuid field in Ironic to create between the instance and nova and the node in Ironic. For the standalone version that's not a requirement to deploy a node.

So we need to make Ironic look at the provision states of the node instead of the instance association. Say the node is ACTIVE we should prevent it from being deleted from the db so that we make sure the user goes through the state machine flow and get the node to a safe state prior to deletion (so that he won't leave the node in a whacky state or with data from the tenant in the local disk)

For 2) it doesn't matter whether the node is powered on or off. Ironic will issue REBOOT when start the deployment, so it will reboot the node if powered on, or start the node if it's powered off. I think this check is a historical thing.


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


How reproducible:
100% of the time

Steps to Reproduce:

1. Power on a machine

$ ironic node-set-power-state 267e42c8-df07-49f5-bc7f-48b566acb109 on

2. Try to delete the node

$ ironic node-delete 267e42c8-df07-49f5-bc7f-48b566acb109
Node 267e42c8-df07-49f5-bc7f-48b566acb109 can't be deleted because it's not powered off


Actual results:
Node doesn't get delete if it's powered on


Expected results:
Node deleted

Additional info:

Comment 6 errata-xmlrpc 2016-06-15 18:04:48 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-2016:1234