Unable to create server with image that has hw_watchdog_action='disabled'

Bug #1633200 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Matt Riedemann

Bug Description

This is from ocata devstack. Set the hw_watchdog_action image property with value 'disabled':

stack@osc:~$ openstack image set --property hw_watchdog_action=disabled cirros-0.3.4-x86_64-uec

stack@osc:~$ openstack image show -c properties cirros-0.3.4-x86_64-uec
+------------+------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------+------------------------------------------------------------------------------------------------------------------------------------+
| properties | hw_watchdog_action='disabled', kernel_id='08463073-3460-4b5f-92cc-ade974936e96', ramdisk_id='ff195fc4-c039-43b5-acca-501aba68aba2' |
+------------+------------------------------------------------------------------------------------------------------------------------------------+

Then try to boot the server and it will fail:

stack@osc:~$ nova boot --poll --image c8af19ff-cebc-4112-a237-78dcd19e588c --flavor 42 test-watchdog-disabled
ERROR (BadRequest): Invalid image metadata. Error: Field value disabled is invalid (HTTP 400) (Request-ID: req-488be9ab-ebcb-473b-b238-968f91ed0f48)

stack@osc:/opt/stack/nova$ git log -1
commit 7a9eb10d0d15e5327aa73c72418d89afce11abef
Merge: b796673 951dee3
Author: Jenkins <email address hidden>
Date: Wed Oct 5 18:27:22 2016 +0000

    Merge "Fix periodic-nova-py{27,35}-with-oslo-master"

The problem is the ImageMetaProps object in nova is using enums for the hw_watchdog_action field:

https://github.com/openstack/nova/blob/7a9eb10d0d15e5327aa73c72418d89afce11abef/nova/objects/fields.py#L383

And that doesn't have 'disabled' as a value.

However, if you look at the glance metadef it's an option, so someone using Horizon could set this:

https://github.com/openstack/glance/blob/d3e820724e1d578003b13e72e753d9b1d75173e1/etc/metadefs/compute-watchdog.json#L25

And the libvirt driver actually defaults to 'disabled':

https://github.com/openstack/nova/blob/7a9eb10d0d15e5327aa73c72418d89afce11abef/nova/virt/libvirt/driver.py#L4536

Matt Riedemann (mriedem)
Changed in nova:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Matt Riedemann (mriedem)
Matt Riedemann (mriedem)
no longer affects: nova/newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

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

Reviewed: https://review.openstack.org/386221
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=98d93196cddab435f7a258bc1ef8beca6a7e2004
Submitter: Jenkins
Branch: master

commit 98d93196cddab435f7a258bc1ef8beca6a7e2004
Author: Matt Riedemann <email address hidden>
Date: Tue Jan 3 17:27:40 2017 -0500

    Add 'disabled' to WatchdogAction field

    Image property hw_watchdog_action can have a 'disabled'
    value which is actually defined in the glance metadefs so
    someone using Horizon might pick that. Also, it's the default
    behavior in the libvirt driver. However, if you try to create
    a server with that set the create fails in nova-api because
    the enum field didn't have 'disabled' as a valid value.

    This adds it, bumps the ImageMetaProps version and adds tests.

    Change-Id: I4cec3e8b8527b909cc60893db26732a19263220d
    Closes-Bug: #1633200

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

This issue was fixed in the openstack/nova 15.0.0.0rc1 release candidate.

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.