<div dir="ltr"><div>Hi all.</div><div><br></div><div>I have a question on icehouse release version of nova.</div><div><br></div><div>_reclaim_queued_deletes() method in /nova/compute/manager.py is a periodic task.</div><div>
And if I set cinder up in my openstack system, the method uses cinderclient to call terminate_connection().</div><div><br></div><div>But sadly a context object used by the periodic task is blank context. no tenant_id, no user_id, no auth_token...</div>
<div>So cinderclient returns error like this.</div><div><br></div><div><br></div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/nova/openstack/common/periodic_task.py", line 182, in run_periodic_tasks</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task task(self, context)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 5395, in _reclaim_queued_deletes</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task self._delete_instance(context, instance, bdms)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/nova/hooks.py", line 103, in inner</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task rv = f(*args, **kwargs)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2220, in _delete_instance</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task user_id=user_id)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/nova/openstack/common/excutils.py", line 68, in __exit__</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task six.reraise(self.type_, self.value, self.tb)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2190, in _delete_instance</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task self._shutdown_instance(context, db_inst, bdms)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2136, in _shutdown_instance</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task connector)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/nova/volume/cinder.py", line 179, in wrapper</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task res = method(self, ctx, volume_id, *args, **kwargs)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/nova/volume/cinder.py", line 282, in terminate_connection</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task connector)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/cinderclient/v1/volumes.py", line 331, in terminate_connection</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task {'connector': connector})</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/cinderclient/v1/volumes.py", line 250, in _action</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task return self.api.client.post(url, body=body)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/cinderclient/client.py", line 209, in post</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task return self._cs_request(url, 'POST', **kwargs)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/cinderclient/client.py", line 167, in _cs_request</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task self.authenticate()</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/cinderclient/client.py", line 312, in authenticate</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task auth_url = self._v1_auth(auth_url)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/cinderclient/client.py", line 330, in _v1_auth</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task resp, body = self.request(url, 'GET', headers=headers)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.7/dist-packages/cinderclient/client.py", line 156, in request</div>
<div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task raise exceptions.from_response(resp, body)</div><div>2014-05-14 18:28:17.527 24605 TRACE nova.openstack.common.periodic_task Unauthorized: Unauthorized (HTTP 401)</div>
<div><br></div><div><br></div><div>Could you let me know how the method run well? or the way to fill the context up?</div><div><br></div><div>Thanks</div></div>