Skip to content

Commit

Permalink
F #2427: Default to different vnets for VM NICS. Add new configuratio…
Browse files Browse the repository at this point in the history
…n attributes to sched.conf
  • Loading branch information
Ruben S. Montero committed Oct 25, 2018
1 parent e9805a7 commit 9a99332
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
27 changes: 23 additions & 4 deletions src/scheduler/etc/sched.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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:
Expand Down Expand Up @@ -87,6 +100,8 @@ LIVE_RESCHEDS = 0

MEMORY_SYSTEM_DS_SCALE = 0

DIFFERENT_VNETS = YES

DEFAULT_SCHED = [
policy = 1
]
Expand All @@ -95,6 +110,10 @@ DEFAULT_DS_SCHED = [
policy = 1
]

DEFAULT_NIC_SCHED = [
policy = 1
]

#DEFAULT_SCHED = [
# policy = 3,
# rank = "- (RUNNING_VMS * 50 + FREE_CPU)"
Expand Down
17 changes: 1 addition & 16 deletions src/scheduler/src/sched/Scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ void Scheduler::start()
ostringstream oss;

string etc_path;
string diff_vnets_str;

unsigned int live_rescheds;

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/scheduler/src/sched/SchedulerTemplate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 9a99332

Please sign in to comment.