* This inverts the --live logic on migrations in Server->migrate_virsh() to default to live.

* Adds a "sensitive" DB connection to ocf:alteeve:server when migrating a VM. This is needed so that migrations can be done cold or live, based on servers -> server_live_migration.
This resolves issue #284.

Signed-off-by: digimer <digimer@gravitar.alteeve.com>
main
digimer 2 years ago
parent dfa93a1837
commit c5fbf20615
  1. 2
      Anvil/Tools/Server.pm
  2. 7
      ocf/alteeve/server

@ -1115,7 +1115,7 @@ WHERE
server_uuid => $server_uuid, server_uuid => $server_uuid,
"servers::server_uuid::${server_uuid}::server_live_migration" => $anvil->data->{servers}{server_uuid}{$server_uuid}{server_live_migration}, "servers::server_uuid::${server_uuid}::server_live_migration" => $anvil->data->{servers}{server_uuid}{$server_uuid}{server_live_migration},
}}); }});
if (($server_uuid) && ($anvil->data->{servers}{server_uuid}{$server_uuid}{server_live_migration} eq "false")) if (($server_uuid) && (not $anvil->data->{servers}{server_uuid}{$server_uuid}{server_live_migration}))
{ {
$live_migrate = ""; $live_migrate = "";
} }

@ -1298,6 +1298,13 @@ sub migrate_server
{ {
my ($anvil) = @_; my ($anvil) = @_;
# Do a sensitive, quick DB connect.
$anvil->Database->connect({
check_for_resync => 0,
retry => 0,
sensitive => 1,
});
### NOTE: For now, we're not going to block if the target is not UpToDate. There are times when a ### NOTE: For now, we're not going to block if the target is not UpToDate. There are times when a
### user might want to do this (ie: sync will be done soon and the need to evacuate the node ### user might want to do this (ie: sync will be done soon and the need to evacuate the node
### ASAP is high). Maybe we'll enforce this and require a '--force' switch later? ### ASAP is high). Maybe we'll enforce this and require a '--force' switch later?

Loading…
Cancel
Save