Merge pull request #616 from ClusterLabs/upgrade-tools

Upgrade tools
main
Digimer 9 months ago committed by GitHub
commit 8faeb10422
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      Anvil/Tools/Network.pm
  2. 52
      man/anvil-manage-server.8
  3. 13
      scancore-agents/scan-drbd/scan-drbd
  4. 4
      scancore-agents/scan-network/scan-network
  5. 2345
      tools/anvil-manage-server

@ -4445,6 +4445,9 @@ sub read_nmcli
} }
} }
# If I still don't have a device, ignore this.
next if not $device;
# Make it easy to look up a device's UUID by device or name. # Make it easy to look up a device's UUID by device or name.
$anvil->data->{nmcli}{$host}{name_to_uuid}{$name} = $uuid; $anvil->data->{nmcli}{$host}{name_to_uuid}{$name} = $uuid;
$anvil->data->{nmcli}{$host}{device_to_uuid}{$device} = $uuid; $anvil->data->{nmcli}{$host}{device_to_uuid}{$device} = $uuid;
@ -4704,7 +4707,7 @@ sub wait_for_network
next if $anvil->data->{network}{watch}{$interface_name}{ready}; next if $anvil->data->{network}{watch}{$interface_name}{ready};
my $uuid = $anvil->data->{network}{watch}{$interface_name}{uuid}; my $uuid = $anvil->data->{network}{watch}{$interface_name}{uuid};
my $type = $anvil->data->{network}{watch}{$interface_name}{type}; my $type = $anvil->data->{network}{watch}{$interface_name}{type};
my $state = $anvil->data->{nmcli}{$short_host_name}{uuid}{$uuid}{'state'}; my $state = defined $anvil->data->{nmcli}{$short_host_name}{uuid}{$uuid}{'state'} ? $anvil->data->{nmcli}{$short_host_name}{uuid}{$uuid}{'state'} : 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:interface_name' => $interface_name, 's1:interface_name' => $interface_name,
's2:type' => $type, 's2:type' => $type,

@ -1,13 +1,13 @@
.\" Manpage for the Alteeve! anvil-manage-server tool .\" Manpage for the Alteeve! anvil-manage-server tool
.\" Contact mkelly@alteeve.com to report issues, concerns or suggestions. .\" Contact mkelly@alteeve.com to report issues, concerns or suggestions.
.TH anvil-manage-server "8" "October 19 2022" "Anvil! Intelligent Availability™ Platform" .TH anvil-manage-server "8" "Mar 21 2024" "Anvil! Intelligent Availability™ Platform"
.SH NAME .SH NAME
anvil-manage-server \- Tool used to manage a server running on an Anvil! cluster. anvil-manage-server \- Tool used to manage a server, like resync'ing servers on a rebuilt host.
.SH SYNOPSIS .SH SYNOPSIS
.B anvil-manage-server .B anvil-manage-server
\fI\,<command> \/\fR[\fI\,options\/\fR] \fI\,<command> \/\fR[\fI\,options\/\fR]
.SH DESCRIPTION .SH DESCRIPTION
anvil-manage-server \- This tool allow the management of a server's hardware. anvil-manage-server \- This tool allow the management of a server.
.TP .TP
.SH OPTIONS .SH OPTIONS
.TP .TP
@ -25,49 +25,11 @@ Set the log level for this run to 1, 2 or 3 (higher == more verbose).
.TP .TP
.SS "Commands:" .SS "Commands:"
.TP .TP
\-k, \fB\-\-anvil\fR <name or uuid> \fB\-\-server\fR all, or <name or uuid>
If specified, and \fBserver\fR is not specified, this will list the servers running on the Anvil! system currently. If, in the unlikely event that two servers exist on different Anvil! systems but with the same name, this will help identify which server you want to work on. This is the server to work on.
.TP .TP
\-k, \fB\-\-server\fR <name or uuid> \fB\-\-resync\fR
This will check to see if the server is sync'ing on this host. If it is not, and if there are sufficient free resources, the server will be configured locally. This will create a local logical volume, which will be used to connect to the peer's replicated storage. The definition file will be written out, if needed. If '\fB\-\-server\fR' isn't used, all servers will be sync'ed (alphatically, stopping if there are insufficient resources).
.TP
\-k, \fB\-\-\fR <uuid>
.TP
\-k, \fB\-\-\fR <uuid>
.TP
\-k, \fB\-\-\fR <uuid>
.TP
\-k, \fB\-\-\fR <uuid>
.TP
\-k, \fB\-\-\fR <uuid>
.TP
\-k, \fB\-\-\fR <uuid>
.TP
\-k, \fB\-\-\fR <uuid>
.TP
\-k, \fB\-\-\fR <uuid>
.TP
\-k, \fB\-\-\fR <uuid>
$anvil->data->{switches}{boot} = ""; # This is a comma-separated list of ordered boot devices
$anvil->data->{switches}{cores} = ""; # This sets the server to use this number of CPU cores.
$anvil->data->{switches}{drive} = ""; # drive being modified (insert/eject ISO, growing drive)
$anvil->data->{switches}{eject} = ""; # This will eject whatever ISO (if any) in the '--drive'.
$anvil->data->{switches}{'expand-to'} = ""; # When the drive is a disk (backed by a DRBD resource), this is the new desired size to grow to.
$anvil->data->{switches}{insert} = ""; # This is the ISO to insert into the --drive
$anvil->data->{switches}{'job-uuid'} = "";
$anvil->data->{switches}{ram} = ""; # This is the amount of RAM to set the server to use.
$anvil->data->{switches}{server} = ""; # server name or uuid
$anvil->data->{switches}{y} = ""; # Don't prompt for confirmation. Only useful when there isn't a job UUID.
.IP .IP
.SH AUTHOR .SH AUTHOR
Written by Madison Kelly, Alteeve staff and the Anvil! project contributors. Written by Madison Kelly, Alteeve staff and the Anvil! project contributors.

@ -100,6 +100,8 @@ find_changes($anvil);
check_config($anvil); check_config($anvil);
find_missing_resources($anvil);
fix_things($anvil); fix_things($anvil);
# Shut down. # Shut down.
@ -110,6 +112,17 @@ $anvil->ScanCore->agent_shutdown({agent => $THIS_FILE});
# Functions # # Functions #
############################################################################################################# #############################################################################################################
# If this node has been rebuilt, we'll need to add missing DRBD resources. This isn't done in
# anvil-join-anvil as the backing VG may not show free space if the user simply deleted the '/home'
# partition.
sub find_missing_resources
{
my ($anvil) = @_;
return(0);
}
# This looks for issues that we can fix, and if any are found, we try to fix them. # This looks for issues that we can fix, and if any are found, we try to fix them.
sub fix_things sub fix_things
{ {

@ -3162,6 +3162,10 @@ sub check_interfaces
network_interface_name => $network_interface_name, network_interface_name => $network_interface_name,
new_nm_device => $new_nm_device, new_nm_device => $new_nm_device,
}}); }});
# If there's no device and no interface name, ignore it.
next if ((not $new_nm_name) && (not $new_nm_device));
my $network_interface_uuid = $anvil->Database->insert_or_update_network_interfaces({ my $network_interface_uuid = $anvil->Database->insert_or_update_network_interfaces({
debug => 2, debug => 2,
network_interface_nm_uuid => $new_nm_uuid, network_interface_nm_uuid => $new_nm_uuid,

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save