Capture bandwidth usage data before resize.
Since resize is really a migrate, we need to capture usage data before resizing. This fixes bug 925587 Change-Id: I999cb0e7c6b17beff542dddb4be09235e83313f0
This commit is contained in:
parent
af1a92f973
commit
3b741bad7a
@ -1181,6 +1181,7 @@ class ComputeManager(manager.SchedulerDependentManager):
|
||||
|
||||
instance_ref = self.db.instance_get_by_uuid(context, instance_uuid)
|
||||
|
||||
compute_utils.notify_usage_exists(instance_ref, current_period=True)
|
||||
self._notify_about_instance_usage(instance_ref, "resize.prep.start")
|
||||
|
||||
same_host = instance_ref['host'] == FLAGS.host
|
||||
|
@ -1036,11 +1036,14 @@ class ComputeTestCase(BaseTestCase):
|
||||
instance_uuid,
|
||||
'pre-migrating')
|
||||
|
||||
self.assertEquals(len(test_notifier.NOTIFICATIONS), 2)
|
||||
self.assertEquals(len(test_notifier.NOTIFICATIONS), 3)
|
||||
msg = test_notifier.NOTIFICATIONS[0]
|
||||
self.assertEquals(msg['event_type'],
|
||||
'compute.instance.resize.prep.start')
|
||||
'compute.instance.exists')
|
||||
msg = test_notifier.NOTIFICATIONS[1]
|
||||
self.assertEquals(msg['event_type'],
|
||||
'compute.instance.resize.prep.start')
|
||||
msg = test_notifier.NOTIFICATIONS[2]
|
||||
self.assertEquals(msg['event_type'],
|
||||
'compute.instance.resize.prep.end')
|
||||
self.assertEquals(msg['priority'], 'INFO')
|
||||
|
Loading…
Reference in New Issue
Block a user