node-validate breaks when invalid image_source is supplied in instance_info

Bug #1355428 reported by Ramakrishnan G (rameshg87)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Invalid
Undecided
Unassigned

Bug Description

I committed a mistake while adding instance_info/image_source for a node, but noticed that ironic node-validate threw irrelevant message.

stack@ramesh-dev-machine:~/ironic$ ironic node-show 687452e4-c7b1-47e2-a45d-bd10dcf9f158
+------------------------+---------------------------------------------------------------------+
| Property | Value |
+------------------------+---------------------------------------------------------------------+
| instance_uuid | None |
| target_power_state | None |
| properties | {} |
| maintenance | False |
| driver_info | {u'pxe_deploy_ramdisk': u'97f0bf44-a8c5-4a18-a4fc-6b36f2aadfbe', |
| | u'pxe_deploy_kernel': u'57e6a947-3c9e-42e9-97f1-431e798c32ae', |
| | u'ipmi_address': u'10.10.1.57', u'ipmi_username': u'Administrator', |
| | u'ipmi_password': u'password'} |
| extra | {} |
| last_error | None |
| created_at | 2014-05-09T13:50:11+00:00 |
| target_provision_state | None |
| driver | pxe_ipmitool |
| updated_at | 2014-05-09T13:52:51+00:00 |
| instance_info | {u'root_gb': u'5', u'image_source': u'cirros-0.3.2-x86_64-uec'} |
| chassis_uuid | None |
| provision_state | None |
| reservation | None |
| power_state | power off |
| console_enabled | False |
| uuid | 687452e4-c7b1-47e2-a45d-bd10dcf9f158 |
+------------------------+---------------------------------------------------------------------+

stack@ramesh-dev-machine:~/ironic$ ironic node-validate 687452e4-c7b1-47e2-a45d-bd10dcf9f158
Remote error: HTTPNotFound HTTPNotFound (HTTP 404)
[u' (HTTP 500)
stack@ramesh-dev-machine:~/ironic$

The problem was that I gave image name instead of image uuid in image_source, but node-validate broke because of that.

description: updated
description: updated
summary: - node-validate breaks invalid image_source was supplied in instance_info
+ node-validate breaks when invalid image_source was supplied in
+ instance_info
summary: - node-validate breaks when invalid image_source was supplied in
+ node-validate breaks when invalid image_source is supplied in
instance_info
Revision history for this message
Dmitry Tantsur (divius) wrote :

How exactly can I reproduce it. This does not cause the error:

$ ironic node-update 41995aad-ac5b-4e01-88d1-1b676565f8ee add instance_info/image_source="cirros-0.3.2-x86_64-uec"
$ ironic node-validate 41995aad-ac5b-4e01-88d1-1b676565f8ee
+------------+--------+----------------------------------------------------------------------------------------------------+
| interface | result | reason |
+------------+--------+----------------------------------------------------------------------------------------------------+
| console | None | not supported |
| deploy | False | Can not validate PXE bootloader. The following parameters were not passed to ironic: ['root_gb'] |
| management | False | SSHPowerDriver requires the following to be set: ['ssh_username', 'ssh_virt_type', 'ssh_address']. |
| power | False | SSHPowerDriver requires the following to be set: ['ssh_username', 'ssh_virt_type', 'ssh_address']. |
+------------+--------+----------------------------------------------------------------------------------------------------+

Changed in ironic:
status: New → Incomplete
Revision history for this message
Ramakrishnan G (rameshg87) (rameshg87) wrote :
Download full text (6.5 KiB)

The above didn't cause the error because root_gb was missing. If you would have provided the root_gb, it would have gone ahead and tried to validate the image which will cause glance to throw an "HTTPNotFound" exception.

2014-08-25 12:41:13.529 ERROR glanceclient.common.http [-] Request returned failure status 404.
2014-08-25 12:41:13.530 ERROR oslo.messaging.rpc.dispatcher [-] Exception during message handling: HTTPNotFound (HTTP 404)
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher incoming.message))
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher return self._do_dispatch(endpoint, method, ctxt, args)
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher result = getattr(endpoint, method)(ctxt, **new_args)
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/server.py", line 138, in inner
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher return func(*args, **kwargs)
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/ironic/ironic/conductor/manager.py", line 860, in validate_driver_interfaces
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher iface.validate(task)
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/ironic/ironic/drivers/modules/pxe.py", line 512, in validate
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher _validate_glance_image(task.context, d_info)
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/ironic/ironic/drivers/modules/pxe.py", line 452, in _validate_glance_image
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher image_props = glance_service.show(image_id)['properties']
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/ironic/ironic/common/glance_service/v1/image_service.py", line 28, in show
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher return self._show(image_id, method='get')
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/ironic/ironic/common/glance_service/base_image_service.py", line 87, in wrapper
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher return func(self, *args, **kwargs)
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/ironic/ironic/common/glance_service/base_image_service.py", line 189, in _show
2014-08-25 12:41:13.530 TRACE oslo.messaging.rpc.dispatcher image = self.call(method, image_id)
2014-08-25 12:41:13.530 TRACE oslo.messaging...

Read more...

Revision history for this message
Ramakrishnan G (rameshg87) (rameshg87) wrote :

After looking at the code, it looks like it might be a defect in glanceclient. Ironic is doing what it can to find if image exists.

https://github.com/openstack/ironic/blob/master/ironic/common/glance_service/base_image_service.py#L191-L192

Changed in ironic:
status: Incomplete → 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.