Updated ocf:akteeve:server to see in the target for a migration has a '<shortname>.mn1' host name, and if so, and if the target can be reached on that address, it will be used for the live migration. This is to allow for inexpensive 10 Gbps live migration speeds.

Removed the stub Server->provision method that was never used.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 3 years ago
parent ea368a942b
commit 0fc394b294
  1. 35
      Anvil/Tools/Server.pm
  2. 31
      ocf/alteeve/server
  3. 1
      share/words.xml
  4. 17
      tools/anvil-manage-dr

@ -864,37 +864,6 @@ sub map_network
return(0);
}
=head2 provision
This method creates a new (virtual) server on an Anvil! system.
Parameters;
=cut
sub provision
{
my $self = shift;
my $parameter = shift;
my $anvil = $self->parent;
my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "Server->provision()" }});
=cut
Provision order:
1. Create LVs and register the storage.
- NOTE: If the LV is already in the DB (from a past install) and the peer is not available and the local
DRBD resource doesn't show Consistent, abort. If the peer is alive but we can't contact it, it's
possible the peer is UpToDate.
2. Create the DRBD resource. If "Inconsistent" on both nodes, force up to date
3. Wait for install media/image to be ready
4. Provision VM and add to Pacemaker.
=cut
return(0);
}
=head2 migrate_virsh
@ -918,9 +887,9 @@ This is the host name (or IP) of the host that we're pulling the server from.
If set, the server will be pulled.
=head3 target (optional, defaukt is the full local host name)
=head3 target (optional, default is the full local host name)
This is the host name (or IP) Of the host that the server will be pushed to, if C<< source >> is not set. When this is not passed, the local full host name is used as default.
This is the host name (or IP) of the host that the server will be pushed to, if C<< source >> is not set. When this is not passed, the local full host name is used as default.
=cut
sub migrate_virsh

@ -1260,6 +1260,35 @@ sub migrate_server
target_host => $target,
}});
# If there is a '<target>.mnX' (migration network X) entry that can be resolved, we'll change the
# target to use that. This is a dedicated, usually back-to-back network used in nodes specifically
# for migration.
my $test_target = $target;
$test_target =~ s/\..*$//;
$test_target .= "mn1"; # Might want to make this a loop to support MN2+ later
my $test_ip = $anvil->Convert->host_name_to_ip({debug => 2, host_name => $test_target});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
test_target => $test_target,
test_ip => $test_ip,
}});
if ($test_ip)
{
# Can we access the peer with this?
my ($access) = $anvil->Remote->test_access({debug => 3, target => $test_ip});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { access => $access }});
# Did we get access?
if ($access)
{
# Yup! Switch the target.
$target = $test_ip;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0663", variables => {
target => $test_target,
ip => $target,
}});
}
}
# Before migrating, make sure the daemons are running on the peer.
check_daemons($anvil, "start");
@ -1422,7 +1451,7 @@ sub migrate_server
debug => 2,
server => $server,
source => $source,
target => $target
target => $target,
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { migrated => $migrated }});
}

@ -2053,6 +2053,7 @@ The file: [#!variable!file!#] needs to be updated. The difference is:
<key name="log_0660">Stopped the postgresql daemon as a peer is currently primary.</key>
<key name="log_0661">Our most recent database dump is newer than any from our peers. As such, we'll just start the database without a load.</key>
<key name="log_0662">Retrying to connect to the database.</key>
<key name="log_0663">The target can be reached on the dedicated migration network: [#!variable!target!#] via the IP address: [#!variable!ip!#], switching to use that for the RAM copy.</key>
<!-- Messages for users (less technical than log entries), though sometimes used for logs, too. -->
<key name="message_0001">The host name: [#!variable!target!#] does not resolve to an IP address.</key>

@ -5,6 +5,8 @@
# NOTE: Unlike most jobs, this one will directly work on the peer node and the DR host using SSH connections.
# This behaviour is likely to change later as it's not ideal.
#
# TODO: --remove is not yet implemented, this needs to be done. Use anvil-delete-server for methods to delete.
#
# Exit codes;
# 0 = Normal exit.
# 1 = Any problem that causes an early exit.
@ -85,8 +87,6 @@ if (not $anvil->data->{switches}{'job-uuid'})
sanity_check($anvil, $terminal);
do_task($anvil, $terminal);
$anvil->nice_exit({exit_code => 0});
@ -95,19 +95,6 @@ $anvil->nice_exit({exit_code => 0});
# Functions #
#############################################################################################################
sub do_task
{
my ($anvil, $terminal) = @_;
# What task am I doing?
if ($anvil->data->{switches}{protect})
{
}
return(0);
}
sub sanity_check
{
my ($anvil, $terminal) = @_;

Loading…
Cancel
Save