@ -140,6 +140,9 @@ sub load_storage
# Load LVM and Storage Group data
$anvil->Database->get_lvm_data({debug => 2});
# Load DRBD data from the database.
$anvil->Database->get_drbd_data({debug => 2});
# Load DRBD resource data so that we can map DRBD resources / volumes to volume groups.
my $drbd_resource = "";
foreach my $device_path (sort {$a cmp $b} keys %{$anvil->data->{server}{$short_host_name}{$server_name}{device}})
@ -601,20 +604,28 @@ sub show_server_details
my $on_lv = $anvil->data->{server}{$short_host_name}{$server_name}{device}{$device_path}{on_lv};
my $drbd_resource = $anvil->data->{server}{$short_host_name}{$server_name}{device}{$device_path}{resource};
my $drbd_volume = $anvil->data->{lvm}{host_name}{$short_host_name}{lv_path}{$on_lv}{drbd}{volume};
my $volume_size = $anvil->data->{lvm}{host_name}{$short_host_name}{lv_path}{$on_lv}{drbd}{volume};
my $resource_size = $anvil->data->{drbd}{host_name}{$short_host_name}{resource_name}{$drbd_resource}{volume}{$drbd_volume}{volume_size};
my $lv_name = $anvil->data->{lvm}{host_name}{$short_host_name}{lv_path}{$on_lv}{scan_lvm_lv_name};
my $lv_size = $anvil->data->{lvm}{host_name}{$short_host_name}{lv}{$lv_name}{scan_lvm_lv_size};
my $metadata_size = $lv_size - $resource_size;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
's1:address_domain' => $address_domain,
's2:address_slot' => $address_slot,
's3:address_function' => $address_function,
's4:device_path' => $device_path,
's5:driver_io' => $driver_io,
's6:driver_cache' => $driver_cache,
's7:on_lv' => $on_lv,
's8:drbd_resource' => $drbd_resource,
's9:drbd_volume' => $drbd_volume,
's01:address_domain' => $address_domain,
's02:address_slot' => $address_slot,
's03:address_function' => $address_function,
's04:device_path' => $device_path,
's05:driver_io' => $driver_io,
's06:driver_cache' => $driver_cache,
's07:on_lv' => $on_lv,
's08:lv_name' => $lv_name,
's09:drbd_resource' => $drbd_resource,
's10:drbd_volume' => $drbd_volume,
's11:resource_size' => $anvil->Convert->bytes_to_human_readable({'bytes' => $resource_size})." (".$anvil->Convert->add_commas({number => $resource_size}).")",
's12:lv_size' => $anvil->Convert->bytes_to_human_readable({'bytes' => $lv_size})."] (".$anvil->Convert->add_commas({number => $lv_size}).")",
's13:metadata_size' => $anvil->Convert->bytes_to_human_readable({'bytes' => $metadata_size})."] (".$anvil->Convert->add_commas({number => $metadata_size}).")",
}});
print "- Target: [".$device_target."], boot: [".$say_boot."], replication resource: [".$drbd_resource."/".$drbd_volume."], size: [".$anvil->Convert->bytes_to_human_readable({'bytes' => $volume_size})."] (".$anvil->Convert->add_commas({number => $volume_size})." Bytes)\n";
print " - Replcation path: [".$device_path."], backed by: [".$on_lv."], cache: [".$driver_cache."]\n";
print "- Target: [".$device_target."], boot: [".$say_boot."], Replication Volume: [".$drbd_resource."/".$drbd_volume."]\n";
print " - Resource / LV / Metadata sizes: [".$anvil->Convert->bytes_to_human_readable({'bytes' => $resource_size})." / ".$anvil->Convert->bytes_to_human_readable({'bytes' => $lv_size})." / ".$anvil->Convert->bytes_to_human_readable({'bytes' => $metadata_size})."], cache: [".$driver_cache."], IO Policy: [".$driver_io."]\n";
# Get the backing LV from the DRBD resource.