Bug 1269505 - Deleting a node shouldn't depend on power state
Summary: Deleting a node shouldn't depend on power state
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-ironic
Version: 7.0 (Kilo)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: z5
: 7.0 (Kilo)
Assignee: Lucas Alvares Gomes
QA Contact: Toure Dunnon
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-07 12:47 UTC by Lucas Alvares Gomes
Modified: 2023-02-22 23:02 UTC (History)
4 users (show)

Fixed In Version: openstack-ironic-2015.1.2-3.el7ost
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-15 18:04:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 186361 0 None None None Never
Red Hat Product Errata RHBA-2016:1234 0 normal SHIPPED_LIVE openstack-ironic bug fix advisory 2016-06-15 22:04:13 UTC

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


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