Skip to content

Commit 5e157e5

Browse files
author
Digimer
committed
* Fixed a bug where Striker was calculating available system RAM using 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>
1 parent 3c5fd5d commit 5e157e5

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

AN/Tools.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ sub _set_defaults
10491049
$an->data->{sys}{username} = getpwuid( $< );
10501050
# If a user wants to use spice + qxl for video in VMs, set this to '1'. NOTE: This disables web-based VNC!
10511051
$an->data->{sys}{use_spice_graphics} = 1;
1052-
$an->data->{sys}{version} = "2.0.0b";
1052+
$an->data->{sys}{version} = "2.0.3";
10531053
# Adds: [--disablerepo='*' --enablerepo='striker*'] if
10541054
# no internet connection found.
10551055
$an->data->{sys}{yum_switches} = "-y";

AN/Tools/Striker.pm

+18-4
Original file line numberDiff line numberDiff line change
@@ -5869,6 +5869,10 @@ sub _display_free_resources
58695869

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

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

1149811502
foreach my $line (@{$data})
@@ -11667,7 +11671,7 @@ sub _parse_dmidecode
1166711671
elsif ($line =~ /Form Factor: (.*)/) { $dimm_form_factor = $1; }
1166811672
elsif ($line =~ /Size: (.*)/)
1166911673
{
11670-
$dimm_size = $1;
11674+
$dimm_size = lc($1);
1167111675
$an->Log->entry({log_level => 3, message_key => "an_variables_0002", message_variables => {
1167211676
name1 => "node_name", value1 => $node_name,
1167311677
name2 => "dimm_size", value2 => $dimm_size,
@@ -11684,6 +11688,11 @@ sub _parse_dmidecode
1168411688
}
1168511689
else
1168611690
{
11691+
# The RAM is reported in 'MB', but it is actually 'MiB'.
11692+
if ($dimm_size !~ /ib$/)
11693+
{
11694+
$dimm_size =~ s/b$/ib/;
11695+
}
1168711696
$dimm_size = $an->Readable->hr_to_bytes({size => $dimm_size });
1168811697
$an->data->{node}{$node_name}{hardware}{total_memory} += $dimm_size;
1168911698
$an->Log->entry({log_level => 3, message_key => "an_variables_0002", message_variables => {
@@ -12243,7 +12252,12 @@ sub _parse_meminfo
1224312252
}, file => $THIS_FILE, line => __LINE__});
1224412253
if ($line =~ /MemTotal:\s+(.*)/)
1224512254
{
12246-
$an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} = $1;
12255+
# This is reported in KiB, though it generally shows as 'kB'.
12256+
$an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} = lc($1);
12257+
if ($an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} !~ /ib$/)
12258+
{
12259+
$an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} =~ s/b$/ib/;
12260+
}
1224712261
$an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} = $an->Readable->hr_to_bytes({size => $an->data->{node}{$node_name}{hardware}{meminfo}{memtotal} });
1224812262
$an->Log->entry({log_level => 3, message_key => "an_variables_0001", message_variables => {
1224912263
name1 => "node::${node_name}::hardware::meminfo::memtotal", value1 => $an->data->{node}{$node_name}{hardware}{meminfo}{memtotal},
@@ -15554,7 +15568,7 @@ sub _verify_server_config
1555415568
my $requested_ram = $an->Readable->hr_to_bytes({size => $an->data->{cgi}{ram}, type => $an->data->{cgi}{ram_suffix} });
1555515569
my $diff = $an->data->{resources}{total_ram} % (1024 ** 3);
1555615570
my $available_ram = $an->data->{resources}{total_ram} - $diff - $an->data->{sys}{unusable_ram};
15557-
$an->Log->entry({log_level => 2, message_key => "an_variables_0002", message_variables => {
15571+
$an->Log->entry({log_level => 3, message_key => "an_variables_0002", message_variables => {
1555815572
name1 => "requested_ram", value1 => $requested_ram,
1555915573
name2 => "available_ram", value2 => $available_ram,
1556015574
}, file => $THIS_FILE, line => __LINE__});

ScanCore/agents/scan-storcli/scan-storcli

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
# TODO:
3232
# - Check the cache policy and reset it to 'writeback' if the BBU/FBU is healthy and the cache changes to
3333
# write-through.
34+
# - When two or more drives have errors, 'drive:other_error_count' is only set to '1'. It should be the
35+
# number of drives with errors. Also, if the error on one drive got above 100, its weight should be '2' and
36+
# above 1000, set to '3'.
3437
#
3538
# NOTE:
3639
# - LSI seems to flip between "Virtual Drive" and "Virtual Disk". We're standardizing on "Virtual Drive".

tools/anvil-generate-iso

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ my $conf = {
151151
release => "6.8",
152152
suffix => "",
153153
mark => "m2",
154-
version => "2.0.2",
154+
version => "2.0.3",
155155
},
156156
# This is will be set to '1' if the source ISO is not mounted.
157157
use_isoread => 0,
@@ -205,7 +205,7 @@ my $conf = {
205205
# access that file, we'll use 'striker_default'. Optionally, the user can request the latest
206206
# master with '--master', in which case we will download the 'striker_master' URL. In all
207207
# cases, the downloaded file will be saved as 'striker_zip_file'.
208-
striker_default => "https://github.com/ClusterLabs/striker/archive/v2.0.2.zip",
208+
striker_default => "https://github.com/ClusterLabs/striker/archive/v2.0.3.zip",
209209
striker_latest => "https://www.alteeve.com/an-repo/striker_latest.txt",
210210
striker_master => "https://codeload.github.com/ClusterLabs/striker/zip/master",
211211
striker_zip_file => "striker.zip",

tools/striker-update

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ my $an = AN::Tools->new({
138138
# access that file, we'll use 'striker_default'. Optionally, the user can request the latest
139139
# master with '--master', in which case we will download the 'striker_master' URL. In all
140140
# cases, the downloaded file will be saved as 'striker_zip_file'.
141-
striker_default => "https://github.com/ClusterLabs/striker/archive/v2.0.2.zip",
141+
striker_default => "https://github.com/ClusterLabs/striker/archive/v2.0.3.zip",
142142
striker_latest => "https://www.alteeve.com/an-repo/striker_latest.txt",
143143
striker_master => "https://codeload.github.com/ClusterLabs/striker/zip/master",
144144
support => "https://alteeve.com/w/Support",

0 commit comments

Comments
 (0)