baremetal-node-show command shows missing table in db

Bug #1379373 reported by Dafna Ron
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned
python-novaclient
Invalid
Undecided
Unassigned

Bug Description

I ran nova baremetal-node-show and am getting missing table error:
2014-10-09 17:27:13.897 22211 TRACE nova.api.openstack File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/default.py", line 324, in do_execute
2014-10-09 17:27:13.897 22211 TRACE nova.api.openstack cursor.execute(statement, parameters)
2014-10-09 17:27:13.897 22211 TRACE nova.api.openstack OperationalError: (OperationalError) no such table: bm_nodes u'SELECT bm_nodes.created_at AS bm_nodes_created_at, bm_nodes.updated_at AS bm_nodes_updated_at, bm_nodes.deleted_at AS bm_nodes_deleted_at, bm_nodes.id AS bm_nodes_id, bm_nodes.deleted AS bm_nodes_deleted, bm_nodes.uuid AS bm_nodes_uuid, bm_nodes.service_host AS bm_nodes_service_host, bm_nodes.instance_uuid AS bm_nodes_instance_uuid, bm_nodes.instance_name AS bm_nodes_instance_name, bm_nodes.cpus AS bm_nodes_cpus, bm_nodes.memory_mb AS bm_nodes_memory_mb, bm_nodes.local_gb AS bm_nodes_local_gb, bm_nodes.preserve_ephemeral AS bm_nodes_preserve_ephemeral, bm_nodes.pm_address AS bm_nodes_pm_address, bm_nodes.pm_user AS bm_nodes_pm_user, bm_nodes.pm_password AS bm_nodes_pm_password, bm_nodes.task_state AS bm_nodes_task_state, bm_nodes.terminal_port AS bm_nodes_terminal_port, bm_nodes.image_path AS bm_nodes_image_path, bm_nodes.pxe_config_path AS bm_nodes_pxe_config_path, bm_nodes.deploy_key AS bm_nodes_deploy_key, bm_nodes.root_mb AS bm_nodes_root_mb, bm_nodes.swap_mb AS bm_nodes_swap_mb, bm_nodes.ephemeral_mb AS bm_nodes_ephemeral_mb \nFROM bm_nodes \nWHERE bm_nodes.deleted = 0' ()
2014-10-09 17:27:13.897 22211 TRACE nova.api.openstack

to reproduce:

nova baremetal-node-show <node>

Tags: api baremetal
Revision history for this message
melanie witt (melwitt) wrote :

It looks like this is expected as the baremetal virt driver was removed from nova recently:

https://review.openstack.org/#/c/126560/

So the baremetal-node* commands should be removed from novaclient.

Changed in python-novaclient:
importance: Undecided → High
status: New → Triaged
moorryan (moorryan)
Changed in python-novaclient:
assignee: nobody → moorryan (moorryan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

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

Changed in python-novaclient:
status: Triaged → In Progress
Revision history for this message
Paul Murray (pmurray) wrote :

Nova client has to maintain backward compatibility, so the commands should remain.

I think the problem here is that the implementation of bare metal has been removed, but the API extensions are still there in Nova. This is an oversight that should be fixed. So the API extensions should be removed.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-novaclient (master)

Change abandoned by Ryan Moore (<email address hidden>) on branch: master
Review: https://review.openstack.org/128658
Reason: so this is not required at this moment - and it will be some time until it is required.

moorryan (moorryan)
Changed in python-novaclient:
assignee: moorryan (moorryan) → nobody
Revision history for this message
melanie witt (melwitt) wrote :

Paul is right, novaclient can't remove commands because of backward compatibility. Similarly, I'm not sure nova api can remove the baremetal nodes api extensions.

So I'm going to file this under nova api, the extensions should work by proxying requests to ironic. We could have better handling for scenarios when the user hasn't set up ironic (good error message) or maybe disable the baremetal nodes extensions by default.

no longer affects: python-novaclient
tags: added: api baremetal
Revision history for this message
Joe Gordon (jogo) wrote :

not sure if still need "nova/api/openstack/compute/contrib/baremetal_nodes.py" around, we may be able to just delete that extension all together.

Revision history for this message
Chris Krelle (nobodycam) wrote :

As I recall nova should proxy some commands (like baremetal-node-show) to ironic. In my testing I am unable to reproduce the exact error on this bug. Can I get more details about the setup and configuration. Is nova setup to use the old deprecated bare metal driver or is it using Ironic. Here is an example of what I am seeing: http://paste.openstack.org/show/0F6DTes7zu0cOiblvj8I

Thank you in advance.
Chris
(NobodyCam)

aeva black (tenbrae)
Changed in nova:
status: New → Incomplete
Revision history for this message
aeva black (tenbrae) wrote :

There is a proxy API in place currently to route certain API commands (such as baremetal-node-show) to Ironic, as Chris has pointed out. I can not find any reference to the "bm_nodes" table in the current codebase, and so I don't see how the reported error is possible on trunk.

@Joe, yes, we need to keep baremetal_api.py around as this contains the proxy code, which was deemed a requirement at the time that the baremetal driver was removed. I am unclear as to how long it is intented to be kept around -- at least the Kilo cycle, to be sure.

@Dafna, what version of the Nova service are you running? If a previous version of Nova which contained the baremetal driver, you must initialize the "nova_bm" database schema if you wish to use it.

Please provide more detail so that we can reproduce this error.

Thanks,
Devananda

Revision history for this message
Dafna Ron (dron-3) wrote :
Download full text (4.1 KiB)

I'm a tester and my setup basically changes twice a week :) I cannot give any further info.
However, I ran baremetal-node-show and baremetal-node-list on my new setup and still getting an error.

i am working with rhel7 on an AIO controller with 2 computes.

these are the packages installed for nova:

[root@gizmo ~(keystone_admin)]# rpm -qa |grep nova
openstack-nova-conductor-2014.2-2.el7ost.noarch
openstack-nova-scheduler-2014.2-2.el7ost.noarch
python-nova-2014.2-2.el7ost.noarch
openstack-nova-novncproxy-2014.2-2.el7ost.noarch
openstack-nova-api-2014.2-2.el7ost.noarch
python-novaclient-2.20.0-1.el7ost.noarch
openstack-nova-common-2014.2-2.el7ost.noarch
openstack-nova-cert-2014.2-2.el7ost.noarch
openstack-nova-console-2014.2-2.el7ost.noarch

[root@XXXX ~(keystone_admin)]# nova baremetal-node-show xx.xx.xx.redhat.com
ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-383cb867-4de4-480d-910f-e74776c16a56)
[root@XXXX~(keystone_admin)]# nova baremetal-node-show xxx.xxx.xxtlv.redhat.com
ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-d3304ec5-cc0e-4df6-9eca-3bf6eda3c5a0)
[root@XXXX ~(keystone_admin)]# nova baremetal-node-list
ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-32488d29-71a3-4edb-9cbd-be9097b11f7f)

[root@gizmo ~(keystone_admin)]# egrep req-32488d29-71a3-4edb-9cbd-be9097b11f7f /var/log/*/*
egrep: /var/log/nagios/archives: Is a directory
egrep: /var/log/nagios/spool: Is a directory
/var/log/nova/nova-api.log:2014-12-04 11:37:50.505 6190 DEBUG nova.api.openstack.wsgi [req-32488d29-71a3-4edb-9cbd-be9097b11f7f None] Calling method '<bound method BareMetalNodeController.index of <nova.api.openstack.compute.contrib.baremetal_nodes.BareMetalNodeController object at 0x3374d50>>' _process_stack /usr/lib/python2.7/site-packages/nova/api/openstack/wsgi.py:935
/var/log/nova/nova-api.log:2014-12-04 11:37:50.522 6190 ERROR nova.api.openstack [req-32488d29-71a3-4edb-9cbd-be9097b11f7f None] Caught error: (OperationalError) no such table: bm_nodes u'SELECT bm_nodes.deleted_at AS bm_nodes_deleted_at, bm_nodes.created_at AS bm_nodes_created_at, bm_nodes.updated_at AS bm_nodes_updated_at, bm_nodes.id AS bm_nodes_id, bm_nodes.deleted AS bm_nodes_deleted, bm_nodes.uuid AS bm_nodes_uuid, bm_nodes.service_host AS bm_nodes_service_host, bm_nodes.instance_uuid AS bm_nodes_instance_uuid, bm_nodes.instance_name AS bm_nodes_instance_name, bm_nodes.cpus AS bm_nodes_cpus, bm_nodes.memory_mb AS bm_nodes_memory_mb, bm_nodes.local_gb AS bm_nodes_local_gb, bm_nodes.preserve_ephemeral AS bm_nodes_preserve_ephemeral, bm_nodes.pm_address AS bm_nodes_pm_address, bm_nodes.pm_user AS bm_nodes_pm_user, bm_nodes.pm_password AS bm_nodes_pm_password, bm_nodes.task_state AS bm_nodes_task_state, bm_nodes.terminal_port AS bm_nodes_terminal_port, bm_nodes.image_path AS bm_nodes_image_path, bm_nodes.pxe_config_path AS bm_nodes_pxe_config_path, bm_nodes.deploy_key AS bm_nodes_deploy_key, bm_nodes.root_mb AS bm_nodes_root_m...

Read more...

Revision history for this message
Chris Krelle (nobodycam) wrote :

Hi Dafna,
It appears that you have configured Nova to use the (deprecated) bare metal driver, but nova is unable to find the database. Have you run the "nova-baremetal-manage db sync" command to create the databases? Has this setup worked in the past? Have you looked into Ironic as an option to the nova bare metal driver?

Chris

Revision history for this message
Dafna Ron (dron-3) wrote :

I am running a red hat packages and have not tried to change anything and no, have not installed ironic.

If bare-metal commands are deprecated, than perhaps they should be marked as such? or removed from the api completely?

Revision history for this message
Chris Krelle (nobodycam) wrote :

Dafna,
are you attempting to setup a nova bare metal system? If so have you run the "nova-baremetal-manage db sync" command to create the bare metal databases?

Chris

Revision history for this message
Dafna Ron (dron-3) wrote :

actually, "nova-baremetal-manage db sync" command does not exist.

[root@gizmo ~(keystone_admin)]# nova-baremetal-manage db sync
-bash: nova-baremetal-manage: command not found

I am not looking to create anything - just testing the system abilities and noticed that bare-metal gives a db does not exist error :)
I am not currently interested in Ironic as a solution for testing a command that does not work.
If the project is taking a new direction than I just think that bare-metal should be marked as deprecated.
btw, what id someone configured the bare-metal before it was deprecated? would upgrading packages cause any issues?

Revision history for this message
Sean Dague (sdague) wrote :

This needs a service catalog redirect in the client like was done with cinder.

Changed in nova:
status: Incomplete → Invalid
Revision history for this message
melanie witt (melwitt) wrote :

It appears no work is needed in novaclient for this, as the nova baremetal nodes api extensions are proxying to ironic.

This is output from a devstack setup without ironic installed:

vagrant@vagrant-ubuntu-trusty-64:~/python-novaclient$ nova baremetal-node-list
ERROR (HTTPNotImplemented): Ironic client unavailable, cannot access Ironic. (HTTP 501) (Request-ID: req-bc950818-bfcb-426d-bea1-2af7eaa5c5a9)

Changed in python-novaclient:
status: New → Invalid
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.