foreach my $connection_ref (@{$drbd_xml->{resource}->{$resource}->{connection}})
foreach my $connection_ref (@{$drbd_xml->{resource}->{$resource}->{connection}})
{
{
my $protocol = $connection_ref->{section}->{net}->{option}->{protocol}->{value};
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\./))
if (($local_hostname eq $short_hostname) or ($local_hostname =~ /^$short_hostname\./))
{
{
# This is us.
# This is us.
$local = $host;
to_log($conf, {message => "Recording the local connection details for the resource: [$resource] -> [$address:$port].", 'line' => __LINE__, level => 2});
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
else
{
{
# This is our peer
# 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});
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)',
to_log($conf, {message => "Checking that the DRBD device: [$device_path] is ready.", 'line' => __LINE__, level => 2});
'port' => '(null)',
'family' => '(null)'
if (not $conf->{server}{drbd}{'local'}{device}{$device_path}{lv})
}
]
},
'm3-a02n01.alteeve.com' => {
'volume' => {
'0' => {
'meta-disk' => [
'internal'
],
'disk' => [
'/dev/node01_vg0/srv01-c7'
],
'device' => [
{
'content' => '/dev/drbd0',
'minor' => '0'
}
]
}
},
'address' => [
{
{
'content' => '(null)',
# The backing LV doesn't exist.
'port' => '(null)',
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);
}
}
]
else
};
=cut
foreach my $disk (sort {$a cmp $b} keys %{$conf->{server}{disks}})
{
{
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});