Skip to content

Commit

Permalink
* Fixed a bug where Striker was calculating available system RAM usin…
Browse files Browse the repository at this point in the history
…g base10 interpretations of base2 reported capacity, causing Striker to report less than actually available RAM available.

* Upped the release version to 2.0.3.

Signed-off-by: Digimer <digimer@alteeve.ca>
  • Loading branch information
Digimer committed Jul 14, 2017
1 parent 3c5fd5d commit 5e157e5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion AN/Tools.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ sub _set_defaults
$an->data->{sys}{username} = getpwuid( $< );
# If a user wants to use spice + qxl for video in VMs, set this to '1'. NOTE: This disables web-based VNC!
$an->data->{sys}{use_spice_graphics} = 1;
$an->data->{sys}{version} = "2.0.0b";
$an->data->{sys}{version} = "2.0.3";
# Adds: [--disablerepo='*' --enablerepo='striker*'] if
# no internet connection found.
$an->data->{sys}{yum_switches} = "-y";
Expand Down
22 changes: 18 additions & 4 deletions AN/Tools/Striker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5869,6 +5869,10 @@ sub _display_free_resources

# Always knock off some RAM for the host OS.
my $real_total_ram = $an->Readable->bytes_to_hr({'bytes' => $an->data->{resources}{total_ram} });
$an->Log->entry({log_level => 3, message_key => "an_variables_0002", message_variables => {
name1 => "resources::total_ram", value1 => $an->data->{resources}{total_ram},
name2 => "real_total_ram", value2 => $real_total_ram,
}, file => $THIS_FILE, line => __LINE__});

# Reserved RAM and BIOS memory holes rarely leave us with an even GiB of total RAM. So we modulous
# off the difference, then subtract that plus the reserved RAM to get an even left-over amount of
Expand Down Expand Up @@ -11492,7 +11496,7 @@ sub _parse_dmidecode
$an->Log->entry({log_level => 3, message_key => "an_variables_0003", message_variables => {
name1 => "resources::total_cores", value1 => $an->data->{resources}{total_cores},
name2 => "resources::total_threads", value2 => $an->data->{resources}{total_threads},
name3 => "resources::total_memory", value3 => $an->data->{resources}{total_ram},
name3 => "resources::total_ram", value3 => $an->data->{resources}{total_ram},
}, file => $THIS_FILE, line => __LINE__});

foreach my $line (@{$data})
Expand Down Expand Up @@ -11667,7 +11671,7 @@ sub _parse_dmidecode
elsif ($line =~ /Form Factor: (.*)/) { $dimm_form_factor = $1; }
elsif ($line =~ /Size: (.*)/)
{
$dimm_size = $1;
$dimm_size = lc($1);
$an->Log->entry({log_level => 3, message_key => "an_variables_0002", message_variables => {
name1 => "node_name", value1 => $node_name,
name2 => "dimm_size", value2 => $dimm_size,
Expand All @@ -11684,6 +11688,11 @@ sub _parse_dmidecode
}
else
{
# The RAM is reported in 'MB', but it is actually 'MiB'.
if ($dimm_size !~ /ib$/)
{
$dimm_size =~ s/b$/ib/;
}
$dimm_size = $an->Readable->hr_to_bytes({size => $dimm_size });
$an->data->{node}{$node_name}{hardware}{total_memory} += $dimm_size;
$an->Log->entry({log_level => 3, message_key => "an_variables_0002", message_variables => {
Expand Down Expand Up @@ -12243,7 +12252,12 @@ sub _parse_meminfo
}, file => $THIS_FILE, line => __LINE__});
if ($line =~ /MemTotal:\s+(.*)/)
{
$an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} = $1;
# This is reported in KiB, though it generally shows as 'kB'.
$an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} = lc($1);
if ($an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} !~ /ib$/)
{
$an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} =~ s/b$/ib/;
}
$an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} = $an->Readable->hr_to_bytes({size => $an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} });
$an->Log->entry({log_level => 3, message_key => "an_variables_0001", message_variables => {
name1 => "node::${node_name}::hardware::meminfo::memtotal", value1 => $an->data->{node}{$node_name}{hardware}{meminfo}{memtotal},
Expand Down Expand Up @@ -15554,7 +15568,7 @@ sub _verify_server_config
my $requested_ram = $an->Readable->hr_to_bytes({size => $an->data->{cgi}{ram}, type => $an->data->{cgi}{ram_suffix} });
my $diff = $an->data->{resources}{total_ram} % (1024 ** 3);
my $available_ram = $an->data->{resources}{total_ram} - $diff - $an->data->{sys}{unusable_ram};
$an->Log->entry({log_level => 2, message_key => "an_variables_0002", message_variables => {
$an->Log->entry({log_level => 3, message_key => "an_variables_0002", message_variables => {
name1 => "requested_ram", value1 => $requested_ram,
name2 => "available_ram", value2 => $available_ram,
}, file => $THIS_FILE, line => __LINE__});
Expand Down
3 changes: 3 additions & 0 deletions ScanCore/agents/scan-storcli/scan-storcli
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
# TODO:
# - Check the cache policy and reset it to 'writeback' if the BBU/FBU is healthy and the cache changes to
# write-through.
# - When two or more drives have errors, 'drive:other_error_count' is only set to '1'. It should be the
# number of drives with errors. Also, if the error on one drive got above 100, its weight should be '2' and
# above 1000, set to '3'.
#
# NOTE:
# - LSI seems to flip between "Virtual Drive" and "Virtual Disk". We're standardizing on "Virtual Drive".
Expand Down
4 changes: 2 additions & 2 deletions tools/anvil-generate-iso
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ my $conf = {
release => "6.8",
suffix => "",
mark => "m2",
version => "2.0.2",
version => "2.0.3",
},
# This is will be set to '1' if the source ISO is not mounted.
use_isoread => 0,
Expand Down Expand Up @@ -205,7 +205,7 @@ my $conf = {
# access that file, we'll use 'striker_default'. Optionally, the user can request the latest
# master with '--master', in which case we will download the 'striker_master' URL. In all
# cases, the downloaded file will be saved as 'striker_zip_file'.
striker_default => "https://github.com/ClusterLabs/striker/archive/v2.0.2.zip",
striker_default => "https://github.com/ClusterLabs/striker/archive/v2.0.3.zip",
striker_latest => "https://www.alteeve.com/an-repo/striker_latest.txt",
striker_master => "https://codeload.github.com/ClusterLabs/striker/zip/master",
striker_zip_file => "striker.zip",
Expand Down
2 changes: 1 addition & 1 deletion tools/striker-update
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ my $an = AN::Tools->new({
# access that file, we'll use 'striker_default'. Optionally, the user can request the latest
# master with '--master', in which case we will download the 'striker_master' URL. In all
# cases, the downloaded file will be saved as 'striker_zip_file'.
striker_default => "https://github.com/ClusterLabs/striker/archive/v2.0.2.zip",
striker_default => "https://github.com/ClusterLabs/striker/archive/v2.0.3.zip",
striker_latest => "https://www.alteeve.com/an-repo/striker_latest.txt",
striker_master => "https://codeload.github.com/ClusterLabs/striker/zip/master",
support => "https://alteeve.com/w/Support",
Expand Down

0 comments on commit 5e157e5

Please sign in to comment.