* Changed the default trigger of live migrations to require a health score difference of 2 or higher. This can be user-adjusted using the new 'feature::scancore::threshold::preventative-live-migration' anvil.conf option.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 2 years ago
parent c1a3f8099d
commit b8bb7cc423
  1. 10
      Anvil/Tools.pm
  2. 14
      Anvil/Tools/ScanCore.pm
  3. 8
      share/words.xml

@ -1009,6 +1009,16 @@ sub _set_defaults
html => "alteeve", html => "alteeve",
}, },
}; };
$anvil->data->{feature} = {
scancore => {
disable => {
'preventative-live-migration' => 0,
},
threshold => {
'preventative-live-migration' => 2,
},
},
};
return(0); return(0);
} }

@ -2022,13 +2022,25 @@ sub post_scan_analysis_node
# Last, evaluate health if we're otherwise OK # Last, evaluate health if we're otherwise OK
if ($peer_health > $local_health) if ($peer_health > $local_health)
{ {
# The user may have set a migration threashold.
my $difference = $peer_health - $local_health;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { difference => $difference }});
if (not $anvil->data->{feature}{scancore}{threshold}{'preventative-live-migration'})
{
$anvil->data->{feature}{scancore}{threshold}{'preventative-live-migration'} = 2;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
'feature::scancore::threshold::preventative-live-migration' => $anvil->data->{feature}{scancore}{threshold}{'preventative-live-migration'},
}});
}
# A user may disable health-based preventative live migrations. # A user may disable health-based preventative live migrations.
if ($anvil->data->{feature}{scancore}{disable}{'preventative-live-migration'}) if ($anvil->data->{feature}{scancore}{disable}{'preventative-live-migration'})
{ {
# Do nothing. # Do nothing.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, key => "message_0239"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, key => "message_0239"});
} }
else elsif ($difference >= $anvil->data->{feature}{scancore}{threshold}{'preventative-live-migration'})
{ {
# How long has this been the case? # How long has this been the case?
my $age = $anvil->Alert->check_condition_age({ my $age = $anvil->Alert->check_condition_age({

@ -576,7 +576,13 @@ sys::privacy::strong = #!data!sys::privacy::strong!#
# Normally, if one node in the Anvil! is healthier than the other, it will pull the servers from the peer # Normally, if one node in the Anvil! is healthier than the other, it will pull the servers from the peer
# on to it. This is a process called "preventative live migration". If you would like to disable this # on to it. This is a process called "preventative live migration". If you would like to disable this
# feature, set this to '1'. # feature, set this to '1'.
feature::scancore::disable::preventative-live-migration = 0 #feature::scancore::disable::preventative-live-migration = 0
# If "preventative live migration" is enabled, this sets the threshold to trigger migration. The difference
# in health score has to be equal to or greater than the number below. The health scores are usually set to
# '1' per event, though scan agents are free to assign higher scores per event. The default threshold is
# '2'. To migrate on any health difference, set this to '1'. Use whole numbers only.
#feature::scancore::threshold::preventative-live-migration = 2
### Database ### Database
# Database connections; # Database connections;

Loading…
Cancel
Save