[openstack-dev] [Openstack][Nova] Questions about '_update_usage_from_instances'

hzguanqiang hzguanqiang at corp.netease.com
Wed Nov 14 09:03:15 UTC 2012


Hi, guys.

I found something confused when I studied resource tracking in Nova. In resource_tracker.py, the function '_update_usage_from_instances()' made a clear reset to 'self.traced_instaces' and 'resources'. And then for each instance, function '_update_usage_from_instance()' is called to update resources stats .

There is the question:
Because  function '_update_usage_from_instances()' has made a clear reset, every instance passed to '_update_usage_from_instance()' must be a new instance(is_new_instance=True). And to a new instance, 'sign' is set to 1. This's just ok. But there are a special situation that instance may be deleted here. Other words, a instance may be meanwhile new and deleted. In my understanding, for deleted instance, We should do nothing in resources stats. But for deleted instance, 'sign' is set to -1, not my expected 0. 
Why? Is this a bug or something? 

Any help is appreciated. Thanks.

2012-11-14



hzguanqiang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121114/2998ffd8/attachment.html>


More information about the OpenStack-dev mailing list