While performing checking Nova API actions that I expected to fail when testing with the Ironic driver, I noticed in some cases a positive response is returned, but the action fails within the compute process when the action is attempted to be executed. When working with other drivers, I expect to see some time of immediate response from the initial request stating that the action isn't possible. The actions I've specifically verified this with are:
- Pause
2014-04-19 21:47:30.940 ERROR oslo.messaging._drivers.common [req-10dedfe7-9fe2-4c0d-9a4e-a85abdd137df demo demo] ['Traceback (most recent call last):\n', ' File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 133, in _dispatch_and_reply\n incoming.message))\n', ' File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 176, in _dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n', ' File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 122, in _do_dispatch\n result = getattr(endpoint, method)(ctxt, **new_args)\n', ' File "/opt/stack/nova/nova/exception.py", line 88, in wrapped\n payload)\n', ' File "/opt/stack/nova/nova/openstack/common/excutils.py", line 82, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n', ' File "/opt/stack/nova/nova/exception.py", line 71, in wrapped\n return f(self, context, *args, **kw)\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 276, in decorated_function\n pass\n', ' File "/opt/stack/nova/nova/openstack/common/excutils.py", line 82, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 262, in decorated_function\n
return function(self, context, *args, **kwargs)\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 329, in decorated_function\n
function(self, context, *args, **kwargs)\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 305, in decorated_function\n e, sys.exc_info())\n', ' File "/opt/stack/nova/nova/openstack/common/excutils.py", line 82, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 292, in decorated_function\n return function(self, context, *args, **kwargs)\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 3659, in pause_instance\n self.driver.pause(instance)\n', ' File "/opt/stack/nova/nova/virt/driver.py", line 521, in pause\n raise NotImplementedError()\n', 'NotImplementedError\n']
- Rescue
screen-n-cpu.log:2014-04-19 21:56:29.518 DEBUG ironicclient.common.http [req-d3128aae-9558-4f4b-adc4-b75b092a3acb demo demo]
screen-n-cpu.log:2014-04-19 21:56:29.523 ERROR oslo.messaging.rpc.dispatcher [req-d3128aae-9558-4f4b-adc4-b75b092a3acb demo demo] Exception during message handling: Instance 5b43d631-91e1-4384-9b87-93283b3ae958 cannot be rescued: Driver Error:
screen-n-cpu.log:2014-04-19 21:56:29.524 ERROR oslo.messaging._drivers.common [req-d3128aae-9558-4f4b-adc4-b75b092a3acb demo demo] Returning exception Instance 5b43d631-91e1-4384-9b87-93283b3ae958 cannot be rescued: Driver Error: to caller
screen-n-cpu.log:2014-04-19 21:56:29.524 ERROR oslo.messaging._drivers.common [req-d3128aae-9558-4f4b-adc4-b75b092a3acb demo demo] ['Traceback (most recent call last):\n', ' File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 133, in _dispatch_and_reply\n incoming.message))\n', ' File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 176, in _dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n', ' File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 122, in _do_dispatch\n result = getattr(endpoint, method)(ctxt, **new_args)\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 395, in decorated_function\n return function(self, context, *args, **kwargs)\n', ' File "/opt/stack/nova/nova/exception.py", line 88, in wrapped\n payload)\n', ' File "/opt/stack/nova/nova/openstack/common/excutils.py", line 82, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n', ' File "/opt/stack/nova/nova/exception.py", line 71, in wrapped\n return f(self, context, *args, **kw)\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 276, in decorated_function\n pass\n', ' File "/opt/stack/nova/nova/openstack/common/excutils.py", line 82, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 262, in decorated_function\n return function(self, context, *args, **kwargs)\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 329, in decorated_function\n function(self, context, *args, **kwargs)\n', ' File "/opt/stack/nova/nova/compute/manager.py", line 2984, in rescue_instance\n
reason=_("Driver Error: %s") % unicode(e))\n', 'InstanceNotRescuable: Instance 5b43d631-91e1-4384-9b87-93283b3ae958 cannot be rescued: Driver Error: \n'])
I'm trying to understand what the expected behavior for this should be. So currently, we see a NotImplementedError exception being thrown whenever an unsupported action is attempted.
I believe this is the proper way to handle such an exception. However, I'd suggest a message be included with the exception (ie: "pause not supported by the Ironic nova driver"). This is what vmware does for pause.
Otherwise, are you suggesting that an error message be delivered to the client? For example, when using python-novaclient:
~$ nova pause <instance-id>
Action not supported by Ironic nova driver.
If so, this would probably require a patch in novaclient. Let me know your thoughts, thanks!