From 3dee15089470fcefcd07e2f59696b61a9e221a78 Mon Sep 17 00:00:00 2001 From: Sam Morrison Date: Thu, 13 Jun 2013 16:34:11 +1000 Subject: [PATCH] Don't advertise mute cells capabilities upwards Fixes bug 1190473 Change-Id: Ic61b549869b1434df81407e499ec8b00ba8f328f --- nova/cells/opts.py | 9 +++++++-- nova/cells/state.py | 4 ++++ nova/cells/weights/mute_child.py | 6 +----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/nova/cells/opts.py b/nova/cells/opts.py index 4e3d75de4f4e..5ab16f377fbb 100644 --- a/nova/cells/opts.py +++ b/nova/cells/opts.py @@ -44,8 +44,13 @@ cells_opts = [ help='Percentage of cell capacity to hold in reserve. ' 'Affects both memory and disk utilization'), cfg.StrOpt('cell_type', - default=None, - help='Type of cell: api or compute'), + default=None, + help='Type of cell: api or compute'), + cfg.IntOpt("mute_child_interval", + default=300, + help='Number of seconds after which a lack of capability and ' + 'capacity updates signals the child cell is to be ' + 'treated as a mute.'), ] cfg.CONF.register_opts(cells_opts, group='cells') diff --git a/nova/cells/state.py b/nova/cells/state.py index 37813d581b37..14fa97507a3c 100644 --- a/nova/cells/state.py +++ b/nova/cells/state.py @@ -42,6 +42,7 @@ LOG = logging.getLogger(__name__) CONF = cfg.CONF CONF.import_opt('name', 'nova.cells.opts', group='cells') CONF.import_opt('reserve_percent', 'nova.cells.opts', group='cells') +CONF.import_opt('mute_child_interval', 'nova.cells.opts', group='cells') #CONF.import_opt('capabilities', 'nova.cells.opts', group='cells') CONF.register_opts(cell_state_manager_opts, group='cells') @@ -340,6 +341,9 @@ class CellStateManager(base.Base): capabs = copy.deepcopy(self.my_cell_state.capabilities) if include_children: for cell in self.child_cells.values(): + if timeutils.is_older_than(cell.last_seen, + CONF.cells.mute_child_interval): + continue for capab_name, values in cell.capabilities.items(): if capab_name not in capabs: capabs[capab_name] = set([]) diff --git a/nova/cells/weights/mute_child.py b/nova/cells/weights/mute_child.py index 0f6fb0bbbb3c..82139d4f300e 100644 --- a/nova/cells/weights/mute_child.py +++ b/nova/cells/weights/mute_child.py @@ -35,14 +35,10 @@ mute_weigher_opts = [ default=1000.0, help='Weight value assigned to mute children. (The value ' 'should be positive.)'), - cfg.IntOpt("mute_child_interval", - default=300, - help='Number of seconds after which a lack of capability and ' - 'capacity updates signals the child cell is to be ' - 'treated as a mute.') ] CONF = cfg.CONF +CONF.import_opt('mute_child_interval', 'nova.cells.opts', group='cells') CONF.register_opts(mute_weigher_opts, group='cells')