Setting persistent boot device does not work with ipmi_force_boot_device on

Bug #1626453 reported by Łukasz Leszczuk
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
High
Tuan

Bug Description

When ipmi_force_boot_device is set and node boot order is set to pxe, after 2 reboots settings disappear from driver.

I believe the root cause is in line: https://github.com/openstack/ironic/blob/1c339b6806580719d20b303d4506c754b9c59e96/ironic/drivers/utils.py#L205. utils.set_boot_device should be called with 'persistent=true' parameter.

Tags: ipmi
Revision history for this message
Dmitry Tantsur (divius) wrote :

How did you reboot your machine? With ipmi_force_boot_device set you are expected to use ironic or nova API to reboot it. We don't use persistent=True there, because ipmi_force_boot_device is designed to work around problems with persistent boot

Changed in ironic:
status: New → Incomplete
Revision history for this message
Tuan (tuanla) wrote :

Could you provide more information to me re-proceduce bugs

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.openstack.org/376322

Changed in ironic:
assignee: nobody → Tuan (tuanla)
status: Incomplete → In Progress
Dmitry Tantsur (divius)
Changed in ironic:
status: In Progress → Incomplete
Revision history for this message
Łukasz Leszczuk (lleszczuk) wrote : Re: Ironic fails to force boot device on ipmitool driver.

Dmitry,

I was using ironic API to reboot nodes.
It looks the flow looks like that:
1. utils.set_boot_device is called, with default persistent=False parameter
2. persistent parameter is passed to force_boot_device: https://github.com/openstack/ironic/blob/1c339b6806580719d20b303d4506c754b9c59e96/ironic/drivers/utils.py#L225
3. with is_next_boot_persistent is set to false
4. after next reboot the setting is removed from driver_internal_info: https://github.com/openstack/ironic/blob/1c339b6806580719d20b303d4506c754b9c59e96/ironic/drivers/utils.py#L199

Revision history for this message
Łukasz Leszczuk (lleszczuk) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on ironic (master)

Change abandoned by Tuan Luong-Anh (<email address hidden>) on branch: master
Review: https://review.openstack.org/376322

Revision history for this message
Dmitry Tantsur (divius) wrote : Re: Ironic fails to force boot device on ipmitool driver.

I was able to confirm this locally. The issue has two parts. First, we don't reset is_next_boot_persistent to True when a user requests persistent boot. Second, for some reason after the first reboot is_next_boot_persistent gets unconditionally set to False.

Changed in ironic:
status: Incomplete → Confirmed
importance: Undecided → High
tags: added: ipmi
Revision history for this message
Dmitry Tantsur (divius) wrote :

The first problem is solved by adding the following line after https://github.com/openstack/ironic/blob/1c339b6806580719d20b303d4506c754b9c59e96/ironic/drivers/utils.py#L223:

 driver_internal_info['is_next_boot_persistent'] = True

Still unclear to me what causes the second problem.

summary: - Ironic fails to force boot device on ipmitool driver.
+ Setting persistent boot device does not work with ipmi_force_boot_device
+ on
Changed in ironic:
status: Confirmed → In Progress
Revision history for this message
Tuan (tuanla) wrote :
Revision history for this message
Tuan (tuanla) wrote :

Hi Dmitry Tantsur, Łukasz Leszczuk,

Following guide from Dmitry Tantsur and i debug and test in my server show that when set ipmi_force_boot_device and node boot order is set to pxe will run persistent = False in function set_boot_device(self, task, device, persistent=False):
https://github.com/openstack/ironic/blob/master/ironic/drivers/modules/ipmitool.py#L912

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/376322
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=6fa142160e99ef6433a6f200511ef78f66b19f45
Submitter: Jenkins
Branch: master

commit 6fa142160e99ef6433a6f200511ef78f66b19f45
Author: Luong Anh Tuan <email address hidden>
Date: Mon Sep 26 16:06:28 2016 +0700

    Fix setting persistent boot device does not work

    - The old value 'is_next_boot_persistent'=False of "driver_internal_info"
    is still in database, Because when persistent set is True we didn't set
    'is_next_boot_persistent'=True. This will lead to get_boot_device work
    wrong in response boot information.

    https://github.com/openstack/ironic/blob/70b992c/ironic/drivers/modules/ipmitool.py#L975
    or
    https://github.com/openstack/ironic/blob/70b992c/ironic/drivers/modules/ipminative.py#L501

    Thus we have to pop "is_next_boot_persistent" to fix the problem.

    Co-Authored-By: Dmitry Tantsur <email address hidden>
    Change-Id: I79efed519b2bacf178f078b338394ca0c4e87d4f
    Closes-bug: #1626453

Changed in ironic:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic 7.0.0

This issue was fixed in the openstack/ironic 7.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.