my $server = $anvil->data->{environment}{OCF_RESKEY_name};
my $server = $anvil->data->{environment}{OCF_RESKEY_name};
my $host = $anvil->Get->short_host_name;
my $host = $anvil->Get->short_host_name;
my $peer = $anvil->data->{drbd}{config}{$host}{peer};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
server => $server,
server => $server,
host => $host,
host => $host,
peer => $peer,
}});
}});
# Do we need startup?
# Do we need startup?
my $startup_needed = 0;
my $local_startup_needed = 0;
$anvil->DRBD->get_status({debug => 3});
$anvil->DRBD->get_status({debug => 3});
foreach my $resource (sort {$a cmp $b} keys %{$anvil->data->{server}{$local_host}{$server}{resource}})
foreach my $resource (sort {$a cmp $b} keys %{$anvil->data->{server}{$local_host}{$server}{resource}})
{
{
# Is the current resource up locally already? If it is, we're done.
# Is the current resource up locally already?
my $role = defined $anvil->data->{drbd}{status}{$host}{resource}{$resource}{role} ? $anvil->data->{drbd}{status}{$host}{resource}{$resource}{role} : "";
my $role = defined $anvil->data->{drbd}{status}{$host}{resource}{$resource}{role} ? $anvil->data->{drbd}{status}{$host}{resource}{$resource}{role} : "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
resource => $resource,
's1:resource' => $resource,
role => $role,
's2:role' => $role,
}});
}});
if ((lc($role) ne "secondary") && (lc($role) ne "primary"))
if ((lc($role) ne "secondary") && (lc($role) ne "primary"))
{
{
$startup_needed = 1;
$local_startup_needed = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { startup_needed => $startup_needed }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { local_startup_needed => $local_startup_needed }});
last;
last;
}
}
else
else
@ -826,95 +824,219 @@ sub start_drbd_resource
}
}
}
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { startup_needed => $startup_needed }});
# Do I need to start the DRBD resource locally? If so, do so.
if (not $startup_needed)
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { local_startup_needed => $local_startup_needed }});
my $role = defined $anvil->data->{drbd}{status}{$host}{resource}{$resource}{role} ? $anvil->data->{drbd}{status}{$host}{resource}{$resource}{role} : "";
server => $server,
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
peer => $peer,
's1:resource' => $resource,
peer_ip => $peer_ip,
's2:role' => $role,
resource => $resource,
}});
}});
# Bring the local resource up
# Check all volumes.
$anvil->DRBD->manage_resource({
foreach my $volume (sort {$a cmp $b} keys %{$anvil->data->{drbd}{status}{$host}{resource}{$resource}{devices}{volume}})
resource => $resource,
{
task => "up",
my $disk_state = defined $anvil->data->{drbd}{status}{$host}{resource}{$resource}{devices}{volume}{$volume}{'disk-state'} ? $anvil->data->{drbd}{status}{$host}{resource}{$resource}{devices}{volume}{$volume}{'disk-state'} : "";
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { disk_state => $disk_state }});
# Bring the peer's resource up.
if ((lc($disk_state) eq "consistent") or
$anvil->DRBD->manage_resource({
(lc($disk_state) eq "outdated") or
resource => $resource,
(lc($disk_state) eq "failed") or
task => "up",
(not $disk_state))
target => $peer_ip,
{
});
# This will trigger trying to ssh into peer(s) and up'ing their resource.
$peer_startup_needed = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { peer_startup_needed => $peer_startup_needed }});
last;
}
}
}
# Now wait for it to be connected or UpToDate...
# Do we need to start the resource on our peers?
my $waiting = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { peer_startup_needed => $peer_startup_needed }});
<keyname="log_0691">Requested to power-off as part of the anvil-safe-stop job.</key>
<keyname="log_0691">Requested to power-off as part of the anvil-safe-stop job.</key>
<keyname="log_0692">The anvil-safe-stop job has completed and will now power off.</key>
<keyname="log_0692">The anvil-safe-stop job has completed and will now power off.</key>
<keyname="log_0693">The anvil-configure-host tool is requesting a reboot.</key>
<keyname="log_0694">The connection to: [#!variable!host!#] for the resource: [#!variable!resource!#] is in the connection state: [#!variable!connection_state!#]. Will try to connect to the peer and up the resource now.</key>
<keyname="log_0695">About to request the start of the resource: [#variable!resource!#] on: [#!variable!host!#].</key>
<keyname="log_0696">The peer: [#!variable!peer!#] is defined in the resource: [#!variable!resource!#] but we don't connect to it, ignoring it.</key>
<!-- Messages for users (less technical than log entries), though sometimes used for logs, too. -->
<!-- Messages for users (less technical than log entries), though sometimes used for logs, too. -->
<keyname="message_0001">The host name: [#!variable!target!#] does not resolve to an IP address.</key>
<keyname="message_0001">The host name: [#!variable!target!#] does not resolve to an IP address.</key>
@ -3116,6 +3120,9 @@ We will sleep a bit and try again.
<keyname="warning_0133">[ Warning ] - Table: [history.#!variable!table!#] not found.</key>
<keyname="warning_0133">[ Warning ] - Table: [history.#!variable!table!#] not found.</key>
<keyname="warning_0134">[ Warning ] - Holding off starting the cluster. Tested access to ourself, and failed. Is '/etc/hosts' populated? Will try again in ten seconds.</key>
<keyname="warning_0134">[ Warning ] - Holding off starting the cluster. Tested access to ourself, and failed. Is '/etc/hosts' populated? Will try again in ten seconds.</key>
<keyname="warning_0135">[ Warning ] - The program: [#!variable!program!#] was not found to be running.</key>
<keyname="warning_0135">[ Warning ] - The program: [#!variable!program!#] was not found to be running.</key>
<keyname="warning_0136">[ Warning ] - Failed to connect to the host: [#!variable!host!#]! Unable to up the resource, so the server may not start. If the peer can't be recovered, manually forcing the local resource(s) to UpToDate may be required.</key>
<keyname="warning_0137">[ Warning ] - Timed out waiting for the connections to the peers, and the local resource(s) is not in 'UpToDate' state. Booting the server will likely fail.</key>
<keyname="warning_0138">[ Warning ] - Timed out waiting for the connections to the peers.</key>
<!-- The entries below here are not sequential, but use a key to find the entry. -->
<!-- The entries below here are not sequential, but use a key to find the entry. -->
<!-- Run 'striker-parse-os-list to find new entries. -->
<!-- Run 'striker-parse-os-list to find new entries. -->