From 9a99332aec0b76673f94c6cab620fca980345252 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 25 Oct 2018 10:56:48 +0200 Subject: [PATCH] F #2427: Default to different vnets for VM NICS. Add new configuration attributes to sched.conf --- src/scheduler/etc/sched.conf | 27 +++++++++++++++++--- src/scheduler/src/sched/Scheduler.cc | 17 +----------- src/scheduler/src/sched/SchedulerTemplate.cc | 2 +- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/scheduler/etc/sched.conf b/src/scheduler/etc/sched.conf index 9bbc074590..a7d97656a8 100644 --- a/src/scheduler/etc/sched.conf +++ b/src/scheduler/etc/sched.conf @@ -33,8 +33,8 @@ # 2 = Load-aware. Heuristic that tries to maximize resources available for # the VMs by using those nodes with less load # 3 = Custom. -# - rank: Custom arithmetic expression to rank suitable hosts based in their -# attributes +# - rank: Custom arithmetic expression to rank suitable hosts based in +# their attributes # 4 = Fixed. Hosts will be ranked according to the PRIORITY attribute found # in the Host or Cluster template. # @@ -45,11 +45,24 @@ # 1 = Striping. Tries to optimize I/O by distributing the VMs across # datastores. # 2 = Custom. -# - rank: Custom arithmetic exprission to rank suitable datastores based on -# their attributes +# - rank: Custom arithmetic exprission to rank suitable datastores based +# on their attributes # 3 = Fixed. Datastores will be ranked according to the PRIORITY attribute # found in the Datastore template. # +# DEFAULT_NIC_SCHED: Definition of the default virtual network scheduler +# - policy: +# 0 = Packing. Tries to pack address usage by selecting the VNET with +# less free leases +# 1 = Striping. Tries to distribute address usage across VNETs. +# 2 = Custom. +# - rank: Custom arithmetic exprission to rank suitable datastores based +# on their attributes +# 3 = Fixed. Virtual Networks will be ranked according to the PRIORITY +# attribute found in the Virtual Network template. +# +# DIFFERENT_VNETS: When set (YES) the NICs of a VM will be forced to be in +# different Virtual Networks. # # LOG: Configuration for the logging system # - system: defines the logging system: @@ -87,6 +100,8 @@ LIVE_RESCHEDS = 0 MEMORY_SYSTEM_DS_SCALE = 0 +DIFFERENT_VNETS = YES + DEFAULT_SCHED = [ policy = 1 ] @@ -95,6 +110,10 @@ DEFAULT_DS_SCHED = [ policy = 1 ] +DEFAULT_NIC_SCHED = [ + policy = 1 +] + #DEFAULT_SCHED = [ # policy = 3, # rank = "- (RUNNING_VMS * 50 + FREE_CPU)" diff --git a/src/scheduler/src/sched/Scheduler.cc b/src/scheduler/src/sched/Scheduler.cc index 805468a849..354bbea1ba 100644 --- a/src/scheduler/src/sched/Scheduler.cc +++ b/src/scheduler/src/sched/Scheduler.cc @@ -108,7 +108,6 @@ void Scheduler::start() ostringstream oss; string etc_path; - string diff_vnets_str; unsigned int live_rescheds; @@ -158,21 +157,7 @@ void Scheduler::start() conf.get("MEMORY_SYSTEM_DS_SCALE", mem_ds_scale); - conf.get("DIFFERENT_VNETS", diff_vnets_str); - - one_util::toupper(diff_vnets_str); - - if (diff_vnets_str != "" ) - { - if ( diff_vnets_str == "NO" ) - { - diff_vnets = false; - } - else if ( diff_vnets_str == "YES" ) - { - diff_vnets = true; - } - } + conf.get("DIFFERENT_VNETS", diff_vnets); // ----------------------------------------------------------- // Log system & Configuration File diff --git a/src/scheduler/src/sched/SchedulerTemplate.cc b/src/scheduler/src/sched/SchedulerTemplate.cc index eca98cb8b5..04659ece83 100644 --- a/src/scheduler/src/sched/SchedulerTemplate.cc +++ b/src/scheduler/src/sched/SchedulerTemplate.cc @@ -123,7 +123,7 @@ void SchedulerTemplate::set_conf_default() conf_default.insert(make_pair(attribute->name(),attribute)); //DIFFERENT_VNETS - value = "NO"; + value = "YES"; attribute = new SingleAttribute("DIFFERENT_VNETS",value); conf_default.insert(make_pair(attribute->name(),attribute));