summaryrefslogtreecommitdiff
path: root/nova/cells
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-02-22 22:30:00 +0000
committerGerrit Code Review <review@openstack.org>2016-02-22 22:30:01 +0000
commit7790dafc924ce66665240779c4723146eaf43120 (patch)
tree8a8fb9a2a1c0dc4d7d3960a9e00f53de19400bd0 /nova/cells
parent0a0d9627c1ec26d239bc30784d8403aca6c8418c (diff)
parent2d03bb97a309341c5a2bcc978220cd5af5f32179 (diff)
downloadnova-7790dafc924ce66665240779c4723146eaf43120.tar.gz
Merge "Fix cell capacity when compute nodes are down"
Diffstat (limited to 'nova/cells')
-rw-r--r--nova/cells/state.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/nova/cells/state.py b/nova/cells/state.py
index 4a5af8f472..a61989fed9 100644
--- a/nova/cells/state.py
+++ b/nova/cells/state.py
@@ -38,6 +38,7 @@ from nova import exception
from nova.i18n import _LE
from nova import objects
from nova import rpc
+from nova import servicegroup
from nova import utils
@@ -153,6 +154,7 @@ class CellStateManager(base.Base):
self.parent_cells = {}
self.child_cells = {}
self.last_cell_db_check = datetime.datetime.min
+ self.servicegroup_api = servicegroup.API()
attempts = 0
while True:
@@ -263,6 +265,15 @@ class CellStateManager(base.Base):
if not service or service['disabled']:
continue
+ # NOTE: This works because it is only used for computes found
+ # in the cell this is run in. It can not be used to check on
+ # computes in a child cell from the api cell. If this is run
+ # in the api cell objects.ComputeNodeList.get_all() above will
+ # return an empty list.
+ alive = self.servicegroup_api.service_is_up(service)
+ if not alive:
+ continue
+
chost = compute_hosts[host]
chost['free_ram_mb'] += compute['free_ram_mb']
free_disk = compute['free_disk_gb'] * 1024