nova-api returns empty block-device-mapping in metadata queries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Balazs Gibizer | ||
Train |
Fix Released
|
Medium
|
Balazs Gibizer | ||
Ussuri |
Fix Released
|
Medium
|
Balazs Gibizer | ||
Victoria |
Fix Released
|
Medium
|
Balazs Gibizer |
Bug Description
Description
===========
currently in a single cell deployment with nova-api acting as metadata server, queries for block-device-
This results in an empty response, even though the devices are mapped and present in the appropriate table.
Steps to reproduce
==================
1. Use nova train or greater (tested on stable/train current HEAD)
2. curl 169.254.
3. receive only root and ami, no entries for volumes
Expected result
===============
There should be entries in block-device-
Actual result
=============
There are no entries other than root/ami in the block-device-
Notes
===========
This is "fixed" by pointing nova-api at the nova database instead of nova_cell0
This bug affects Train+, but likely any deployment with multiple cells.
I confirm that the bug still exists on current master.
The root cause is that we are not passing the cell targeted context to the InstanceMetadata class and therefore the BDM query runs without a targeted context. See https:/ /github. com/openstack/ nova/blob/ f72c9e59fb6bea8 81c16e710df7bd6 76fafe18f7/ nova/api/ metadata/ base.py# L693-L695