summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-14 15:43:16 +0000
committerGerrit Code Review <review@openstack.org>2017-06-14 15:43:16 +0000
commitfe329029265e10296a550fc9153b7977da4aefe2 (patch)
tree1cd80110f797ac2ee327b8f181ac417becdcd1f4
parent4ace336a25b000db1c8d433011a261d8d4802105 (diff)
parent2a113159c00b51215f3506a9e9834fa7cc0d5ffb (diff)
Merge "Calculate stopped instance's disk sizes for disk_available_least" into stable/ocata15.0.6
-rw-r--r--nova/tests/unit/virt/libvirt/test_driver.py4
-rw-r--r--nova/virt/libvirt/driver.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py
index b67f9aa..d7c9b89 100644
--- a/nova/tests/unit/virt/libvirt/test_driver.py
+++ b/nova/tests/unit/virt/libvirt/test_driver.py
@@ -12350,7 +12350,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
12350 12350
12351 result = drvr._get_disk_over_committed_size_total() 12351 result = drvr._get_disk_over_committed_size_total()
12352 self.assertEqual(result, 10653532160) 12352 self.assertEqual(result, 10653532160)
12353 mock_list.assert_called_once_with() 12353 mock_list.assert_called_once_with(only_running=False)
12354 self.assertEqual(2, mock_info.call_count) 12354 self.assertEqual(2, mock_info.call_count)
12355 12355
12356 filters = {'uuid': instance_uuids} 12356 filters = {'uuid': instance_uuids}
@@ -12461,7 +12461,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
12461 12461
12462 result = drvr._get_disk_over_committed_size_total() 12462 result = drvr._get_disk_over_committed_size_total()
12463 self.assertEqual(42949672960, result) 12463 self.assertEqual(42949672960, result)
12464 mock_list.assert_called_once_with() 12464 mock_list.assert_called_once_with(only_running=False)
12465 self.assertEqual(5, get_disk_info.call_count) 12465 self.assertEqual(5, get_disk_info.call_count)
12466 filters = {'uuid': instance_uuids} 12466 filters = {'uuid': instance_uuids}
12467 mock_get.assert_called_once_with(mock.ANY, filters, use_slave=True) 12467 mock_get.assert_called_once_with(mock.ANY, filters, use_slave=True)
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index f0c1a22..303eb2e 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -7071,7 +7071,7 @@ class LibvirtDriver(driver.ComputeDriver):
7071 """Return total over committed disk size for all instances.""" 7071 """Return total over committed disk size for all instances."""
7072 # Disk size that all instance uses : virtual_size - disk_size 7072 # Disk size that all instance uses : virtual_size - disk_size
7073 disk_over_committed_size = 0 7073 disk_over_committed_size = 0
7074 instance_domains = self._host.list_instance_domains() 7074 instance_domains = self._host.list_instance_domains(only_running=False)
7075 if not instance_domains: 7075 if not instance_domains:
7076 return disk_over_committed_size 7076 return disk_over_committed_size
7077 7077