cleanup_running_deleted_instances peroidic task failed with instance not found
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
wangpan | ||
Havana |
Fix Released
|
Undecided
|
wangpan |
Bug Description
this is because the db query is not including the deleted instance while
_delete_
I can reproduce this bug both in master and stable havana.
reproduce steps:
1. create an instance
2. stop nova-compute
3. wait for nova-manage serivce list display xxx of nova-compute
4. modify the running_
running_
and start nova-compute and wait for this clean up peroidic task
5. a warnning will be given in the compute log:
2014-02-14 16:22:25.917 WARNING nova.compute.
the debug trace is:
ipdb> n
> /opt/stack/
1005 block_device_
-> 1006 block_device_info)
1007 for vol in block_device_
ipdb> n
> /opt/stack/
1006 block_device_info)
-> 1007 for vol in block_device_
1008 connection_info = vol['connection
ipdb> n
> /opt/stack/
1040
-> 1041 if destroy_disks:
1042 self._delete_
ipdb> n
> /opt/stack/
1041 if destroy_disks:
-> 1042 self._delete_
1043
ipdb> s
--Call--
> /opt/stack/
4949
-> 4950 def _delete_
4951 # NOTE(mikal): a shim to handle this file not using instance objects
ipdb> n
> /opt/stack/
4952 # everywhere. Remove this when that conversion happens.
-> 4953 context = nova_context.
4954 inst_obj = instance_
ipdb> n
> /opt/stack/
4953 context = nova_context.
-> 4954 inst_obj = instance_
4955
ipdb> n
InstanceNotFound: Instance.
> /opt/stack/
4953 context = nova_context.
-> 4954 inst_obj = instance_
4955
ipdb> n
--Return--
None
> /opt/stack/
4953 context = nova_context.
-> 4954 inst_obj = instance_
4955
ipdb> n
InstanceNotFound: Instance.
> /opt/stack/
1041 if destroy_disks:
-> 1042 self._delete_
1043
ipdb> n
--Return--
None
> /opt/stack/
1041 if destroy_disks:
-> 1042 self._delete_
1043
ipdb> n
InstanceNotFound: Instance.
> /opt/stack/
930 self.cleanup(
--> 931 destroy_disks)
932
ipdb> n
--Return--
None
> /opt/stack/
930 self.cleanup(
--> 931 destroy_disks)
932
ipdb> n
InstanceNotFound: Instance.
> /opt/stack/
1904 self.driver.
-> 1905 block_device_info)
1906 except exception.
ipdb> n
> /opt/stack/
1905 block_device_info)
-> 1906 except exception.
1907 # if the instance can't power off, don't release the ip
ipdb> n
> /opt/stack/
1909 pass
-> 1910 except Exception:
1911 with excutils.
ipdb> n
> /opt/stack/
1910 except Exception:
-> 1911 with excutils.
1912 # deallocate ip and fail without proceeding to
ipdb> n
> /opt/stack/
1913 # volume api calls, preserving current behavior
-> 1914 self._try_
1915 requested_networks)
ipdb> n
> /opt/stack/
1914 self._try_
-> 1915 requested_networks)
1916
ipdb> n
2014-02-14 16:22:02.701 DEBUG nova.compute.
2014-02-14 16:22:02.704 DEBUG oslo.messaging.
2014-02-14 16:22:02.705 DEBUG oslo.messaging.
2014-02-14 16:22:02.718 WARNING nova.openstack.
InstanceNotFound: Instance.
> /opt/stack/
1914 self._try_
-> 1915 requested_networks)
1916
ipdb> n
--Return--
None
> /opt/stack/
1914 self._try_
-> 1915 requested_networks)
1916
ipdb> l
1910 except Exception:
1911 with excutils.
1912 # deallocate ip and fail without proceeding to
1913 # volume api calls, preserving current behavior
1914 self._try_
-> 1915 requested_networks)
1916
1917 self._try_
1918
1919 for bdm in vol_bdms:
1920 try:
ipdb> n
InstanceNotFound: Instance.
> /opt/stack/
5224 self._shutdown_
-> 5225 notify=False)
5226 self._cleanup_
ipdb> n
> /opt/stack/
5226 self._cleanup_
-> 5227 except Exception as e:
5228 LOG.warning(
ipdb> n
> /opt/stack/
5227 except Exception as e:
-> 5228 LOG.warning(
5229 "instance: %s"),
ipdb> n
> /opt/stack/
5229 "instance: %s"),
-> 5230 unicode(e), instance=instance)
5231 else:
ipdb> n
2014-02-14 16:22:25.917 WARNING nova.compute.
Changed in nova: | |
assignee: | nobody → wangpan (hzwangpan) |
Changed in nova: | |
milestone: | none → icehouse-3 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | icehouse-3 → 2014.1 |
Fix proposed to branch: master /review. openstack. org/73540
Review: https:/