foreach my $connection_ref (@{$drbd_xml->{resource}->{$resource}->{connection}})
{
my $protocol = $connection_ref->{section}->{net}->{option}->{protocol}->{value};
@ -620,133 +623,64 @@ sub validate_storage_drbd
if (($local_hostname eq $short_hostname) or ($local_hostname =~ /^$short_hostname\./))
{
# This is us.
$local = $host;
to_log($conf, {message => "Recording the local connection details for the resource: [$resource] -> [$address:$port].", 'line' => __LINE__, level => 2});
$conf->{server}{drbd}{'local'} = {
hostname => $host,
short_hostname => $short_hostname,
address => $address,
port => $port,
};
}
else
{
# This is our peer
$peer = $host;
to_log($conf, {message => "Recording the peer's connection details for the resource: [$resource] -> [$address:$port].", 'line' => __LINE__, level => 2});
foreach my $device_path (sort {$a cmp $b} keys %{$conf->{server}{disks}})
{
'content' => '(null)',
'port' => '(null)',
'family' => '(null)'
}
]
},
'm3-a02n01.alteeve.com' => {
'volume' => {
'0' => {
'meta-disk' => [
'internal'
],
'disk' => [
'/dev/node01_vg0/srv01-c7'
],
'device' => [
{
'content' => '/dev/drbd0',
'minor' => '0'
}
]
}
},
'address' => [
to_log($conf, {message => "Checking that the DRBD device: [$device_path] is ready.", 'line' => __LINE__, level => 2});
if (not $conf->{server}{drbd}{'local'}{device}{$device_path}{lv})
{
'content' => '(null)',
'port' => '(null)',
'family' => '(null)'
}
]
}
}
}
},
'file' => '/etc/drbd.conf',
'common' => [
{
'section' => {
'disk' => {
'option' => {
'md-flushes' => {
'value' => 'no'
},
'disk-flushes' => {
'value' => 'no'
}
}
},
'options' => {
'option' => {
'auto-promote' => {
'value' => 'yes'
}
}
},
'handlers' => {
'option' => {
'fence-peer' => {
'value' => '/usr/sbin/fence_pacemaker'
}
}
},
'net' => {
'option' => {
'after-sb-2pri' => {
'value' => 'disconnect'
},
'allow-two-primaries' => {
'value' => 'no'
},
'after-sb-1pri' => {
'value' => 'discard-secondary'
},
'after-sb-0pri' => {
'value' => 'discard-zero-changes'
},
'data-integrity-alg' => {
'value' => 'md5'
},
'csums-alg' => {
'value' => 'md5'
}
}
}
# The backing LV doesn't exist.
to_log($conf, {message => "The server wants to use: [$device_path] as a hard drive, but we couldn't find the backing logical volume on this node.", 'line' => __LINE__, level => 0, priority => "err"});
to_log($conf, {message => "The server wants to use: [$device_path] as a hard drive, but the backing logical volume: [".$conf->{server}{drbd}{'local'}{device}{$device_path}{lv}."] doesn't exist on this node.", 'line' => __LINE__, level => 0, priority => "err"});
exit(5);
}
]
};
=cut
foreach my $disk (sort {$a cmp $b} keys %{$conf->{server}{disks}})
else
{
to_log($conf, {message => "Checking that the DRBD device: [$disk] is ready.", 'line' => __LINE__, level => 2});
to_log($conf, {message => "The server wants to use: [$device_path] as a hard drive, which is backed by the logical volume: [".$conf->{server}{drbd}{'local'}{device}{$device_path}{lv}."]. Checking that these are ready.", 'line' => __LINE__, level => 1});