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.
.SHSYNOPSIS
.SHSYNOPSIS
.Banvil-manage-server
.Banvil-manage-server
\fI\,<command> \/\fR[\fI\,options\/\fR]
\fI\,<command> \/\fR[\fI\,options\/\fR]
.SHDESCRIPTION
.SHDESCRIPTION
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
.SHOPTIONS
.SHOPTIONS
.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.
# Is 'libvirtd' running? We'll wait up to half the timeout for it to start (in case it _just_ started)
# libvirtd lists as disabled / stopped, but "starts" when called. So checking the daemon doesn't make
# before timing out.
# sense. Given virsh might fail, if we don't find the server, we'll also look for it in 'ps'.
my $wait_until = time + ($anvil->data->{environment}{OCF_RESKEY_CRM_meta_timeout} / 2000); # Devide by 2000 to convert to seconds and total second halved.
my $loop = 1;
my $look_for_pid = 0;
while($loop)
my $libvirtd_wait = 1;
my $warning_shown = 0;
while($libvirtd_wait)
{
{
my $running = $anvil->System->check_daemon({daemon => "libvirtd.service"});
$loop = 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { running => $running }});
my $found = 0;
if ($running)
my $shell_call = $anvil->data->{path}{exe}{setsid}." --wait ".$anvil->data->{path}{exe}{virsh}." list --all";
{
$libvirtd_wait = 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { libvirtd_wait => $libvirtd_wait }});
}
else
{
# On EL8 and above, libvirtd starts on demand, so this error isn't
@ -2377,10 +2377,10 @@ The file: [#!variable!file!#] needs to be updated. The difference is:
<keyname="log_0520">The server: [#!variable!server!#] is indeed running. It will be shut down now.</key>
<keyname="log_0520">The server: [#!variable!server!#] is indeed running. It will be shut down now.</key>
<keyname="log_0521">Checking the status of the server: [#!variable!server!#].</key>
<keyname="log_0521">Checking the status of the server: [#!variable!server!#].</key>
<keyname="log_0522">The 'libvirtd' daemon is not running. It may be starting up, will wait: [#!variable!wait_time!#] seconds...</key>
<keyname="log_0522">The 'libvirtd' daemon is not running. It may be starting up, will wait: [#!variable!wait_time!#] seconds...</key>
<keyname="log_0523">Found the server to be running using it's PID. The state of the server can't be determined, however. Please start the 'libvirtd' daemon!</key>
<keyname="log_0523">Found the server to be running using it's PID. The state of the server can't be determined, however. There appears to be a problem with 'virsh'!</key>
<keyname="log_0524">No PID for the server was found. It is not running on this host.</key>
<keyname="log_0524">No PID for the server was found. It is not running on this host.</key>
<keyname="log_0525">The server: [#!variable!server_name!#] is shutting down. Will wait for it to finish...</key>
<keyname="log_0525">The server: [#!variable!server_name!#] is shutting down. Will wait for it to finish...</key>
<keyname="log_0526">The server: [#!variable!server_name!#] is off.</key>
<keyname="log_0526">The server: [#!variable!server_name!#] is off (not found in virsh or by PID).</key>
<keyname="log_0527">The server: [#!variable!server_name!#] is running (state is: [#!variable!state!#]).</key>
<keyname="log_0527">The server: [#!variable!server_name!#] is running (state is: [#!variable!state!#]).</key>
<keyname="log_0528">We've been asked to migrating the server: [#!variable!server!#] to: [#!variable!target_host!#].</key>
<keyname="log_0528">We've been asked to migrating the server: [#!variable!server!#] to: [#!variable!target_host!#].</key>
<keyname="log_0529">Checking server state after: [#!variable!server!#] was migrated to this host.</key>
<keyname="log_0529">Checking server state after: [#!variable!server!#] was migrated to this host.</key>
@ -2681,7 +2681,7 @@ The file: [#!variable!file!#] needs to be updated. The difference is:
<keyname="log_0805">Getting a screenshot from: [#!variable!server_name!#] (uuid: [#!variable!server_uuid!#]) from the host: [#!variable!host_name!#].</key>
<keyname="log_0805">Getting a screenshot from: [#!variable!server_name!#] (uuid: [#!variable!server_uuid!#]) from the host: [#!variable!host_name!#].</key>
<keyname="log_0806">- Saving the screenshot: [#!variable!ppm_file!#].</key>
<keyname="log_0806">- Saving the screenshot: [#!variable!ppm_file!#].</key>
<keyname="log_0807">- Converting: [#!variable!ppm_file!#] to:
<keyname="log_0807">- Converting: [#!variable!source_file!#] to:
<keyname="log_0809">- Deleting the server: [#!variable!server_name!#]'s screenshot: [#!variable!file!#].</key>
<keyname="log_0809">- Deleting the server: [#!variable!server_name!#]'s screenshot: [#!variable!file!#].</key>
@ -4187,6 +4187,7 @@ We will try to proceed anyway.</key>
<keyname="warning_0170">[ Warning ] - The attempt to boot: [#!variable!host_name!#] appears to have failed. The return code received was: [#!variable!return_code!#] (expected '0'). The output, if any, was: [#!variable!output!#].</key>
<keyname="warning_0170">[ Warning ] - The attempt to boot: [#!variable!host_name!#] appears to have failed. The return code received was: [#!variable!return_code!#] (expected '0'). The output, if any, was: [#!variable!output!#].</key>
<keyname="warning_0171">[ Warning ] - The daemon: [#!variable!daemon!#] appears to have failed! Attempting to restart it now.</key>
<keyname="warning_0171">[ Warning ] - The daemon: [#!variable!daemon!#] appears to have failed! Attempting to restart it now.</key>
<keyname="warning_0172">[ Warning ] - The line: [#!variable!line!#] that was going to be added to the hosts file is invalid, removing it.</key>
<keyname="warning_0172">[ Warning ] - The line: [#!variable!line!#] that was going to be added to the hosts file is invalid, removing it.</key>
<keyname="warning_0173">[ Warning ] - Failed to convert: [#!variable!source_file!#] to: [#!variable!new_file!#] (format: [#!variable!format!#]! Return code was: [#!variable!return_code!#], expected '0'.</key>