From 4b2dd5ab02458c953e3958202645552bf4b98083 Mon Sep 17 00:00:00 2001 From: Anton Beloglazov Date: Mon, 1 Oct 2012 18:46:18 +1000 Subject: [PATCH] Added a network_migration_bandwidth config option --- neat.conf | 3 +++ neat/config.py | 1 + neat/locals/manager.py | 8 ++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/neat.conf b/neat.conf index 5445f21..d5f62d8 100644 --- a/neat.conf +++ b/neat.conf @@ -76,6 +76,9 @@ compute_user = neat # hosts to switch them into the sleep mode compute_password = neatpassword +# The network bandwidth in MB/s available for VM migration +network_migration_bandwidth = 10 + # A shell command used to switch a host into the sleep mode, the # compute_user must have permissions to execute this command sleep_command = pm-suspend diff --git a/neat/config.py b/neat/config.py index d5e6d36..d0700af 100644 --- a/neat/config.py +++ b/neat/config.py @@ -55,6 +55,7 @@ REQUIRED_FIELDS = [ 'compute_user', 'compute_password', 'sleep_command', + 'network_migration_bandwidth', 'algorithm_underload_detection_factory', 'algorithm_underload_detection_parameters', 'algorithm_overload_detection_factory', diff --git a/neat/locals/manager.py b/neat/locals/manager.py index d1df558..bfa4684 100644 --- a/neat/locals/manager.py +++ b/neat/locals/manager.py @@ -210,7 +210,7 @@ def execute(config, state): if not vm_cpu_mhz: return - physical_cpu_mhz_total = int(config['physical_cpu_mhz_total']) + physical_cpu_mhz_total = int(state['physical_cpu_mhz_total']) host_cpu_utilization = vm_mhz_to_percentage( vm_cpu_mhz, physical_cpu_mhz_total) time_step = int(config['data_collector_interval']) @@ -219,7 +219,7 @@ def execute(config, state): if 'underload_detection' not in state: underload_detection_params = json.loads( - config['algorithm_underload_detection_params']) + config['algorithm_underload_detection_parameters']) underload_detection_state = None underload_detection = \ config['algorithm_underload_detection_factory']( @@ -229,7 +229,7 @@ def execute(config, state): state['underload_detection'] = underload_detection overload_detection_params = json.loads( - config['algorithm_overload_detection_params']) + config['algorithm_overload_detection_parameters']) overload_detection_state = None overload_detection = \ config['algorithm_overload_detection_factory']( @@ -239,7 +239,7 @@ def execute(config, state): state['overload_detection'] = overload_detection vm_selection_params = json.loads( - config['algorithm_vm_selection_params']) + config['algorithm_vm_selection_parameters']) vm_selection_state = None vm_selection = \ config['algorithm_vm_selection_factory'](