...
Method | Comments |
---|---|
expect | Requires you pass user and password to the script so that it can connect to the OPA0 console via "
This method is useful if the virtual machine has no telnet connection available. Important notes:
|
rsh | Requires:
|
ssh | Requires:
|
Info | ||
---|---|---|
| ||
If your application and server needs time to shutdown, it could be necessary to give more time in the service definition to prevent from the service stop procedure to fail due to timeout. To do so, open the " Example:
More information can be found using the " |
Options
TO BE CONTINUED
Explanation on the example file
Example with SSH, Tru64 guest
An ssh
trust between the CHARON Linux server and the Tru64 guest must have been previously configured in order to use this method. See Tips and Tricks for help to setup the trust.
...
- Options 1 to 5 are explanations on how to setup and prepare the virtual machine and the Charon Linux server (if necessary) to use the three available methods. You'll find there all the details to setup a proxy for rsh, a key pair for ssh and the necessary firewall settings if needed.
- Option 6 edits the script. This script in a form of "case in <configuration filename> do ..."
- Option 7 is used to test the script. Use with caution on production machines.
Include Page | ||||
---|---|---|---|---|
|
...
class | pagebreak |
---|
Example with SSH, OpenVMS guest
An ssh
trust between the CHARON Linux server and the OpenVMS guest must have been previously configured in order to use this method. See Tips and Tricks for help to setup the trust.
- Check the guest can be pinged (an "
ssh
" command as for the Tru64 example above can also be used), if yes, issue theshutdown
command, wait a few seconds and check if the guest can be "pinged" and repeat with an interval of 5 seconds. If the guest cannot be pinged, assume the shutdown procedure is complete - Kill the emulator process (Red Hat Enterprise Linux 6.x) or use the service kill command (RHEL 7.x and CentOS 7.x). Note: the shutdown commands does not power off nor stop the emulator process, that's why this operation is needed
- Report the stop information within the guest log file
Common stop script explanation
When using option 6, the editor defined in the Preferences is used to edit the script.
When the script is initialized or when a new virtual machine is added, the following lines are added:
|
One of the blue colored lines above has to be uncommented depending on the method chosen. Other lines can remain in the script or can be deleted.
The values between the < and > signs have to be filled manually.
Stop script execution example:
Include Page | ||||
---|---|---|---|---|
|
...
Provided shutdown scripts explanation
charon_gstop_expect
...
- Check if there's an active connection to the console on the local host, kill if any.
...
- Execute the /opt/charon/utils/guest_shutdown.exp expect script with the values provided: username (root), password, prompt, operating system (either TRU64 or VMS). This script is able to send the shutdown command depending on the returned characters on the console. This can be the SRM prompt ">>>", the "login:" or "username:" prompts or the prompt of the logged in user.
- Report all output to
/opt/charon/log/console.stop.<guest name>.log
.
...
Notes:
- With Charon-AXP, the "
power off
" command is
...
Example with Expect tool, AXP VMS guest
...
- sent at the SRM prompt
- With Charon-VAX, the "
power off
" command does not exist. To power off the virtual machine, the F6 key has to be enabled in the configuration file (set OPA0 stop_on="F6"
) - If the console is locked from an external connection or if the prompt is not detected after sending a carriage return, the expect script will fail.
...
Example with Expect tool, VAX VMS guest
...
charon_gstop_rsh
Check the guest can be reached via ping, if yes:
Issue the
shutdown
command via "rsh" (depends on the operating system),Wait for a few seconds
Check if the guest can be "pinged" and repeat with an interval of 5 seconds
If the guest cannot be pinged, assume the shutdown procedure is complete
Kill the emulator process (Red Hat Enterprise Linux 6.x) or use the
service kill
command (RHEL 7.x and CentOS 7.x). The shutdown commands does not power off nor stop the emulator process, that's why this operation is neededReport the stop information within the guest log file
charon_gstop_ssh
Check the guest can be reached via ping, if yes:
Issue the
shutdown
command via "ssh" (depends on the operating system),Wait for a few seconds
Check if the guest can be "pinged" and repeat with an interval of 5 seconds
If the guest cannot be pinged, assume the shutdown procedure is complete
Kill the emulator process (Red Hat Enterprise Linux 6.x) or use the
service kill
command (RHEL 7.x and CentOS 7.x). The shutdown commands does not power off nor stop the emulator process, that's why this operation is neededReport the stop information within the guest log file
Include Page | ||||
---|---|---|---|---|
|
...
class | pagebreak |
---|
Optional guest display status script
It is possible to create a script, "/opt/charon/utils/charon_gstart.chkrun
" (an example is provided in the 'charon_gstart.chkrun.example
' file) that will add a status line while displaying the guests list for running guests only. This script, if needed, has to be created manually and must be executable.
This status line is the result of the command you executed for that guest (known by its configuration file), for example a ping
, an ssh
command displaying uptime
(Tru64) or boottime
(OpenVMS).
Display output example from the "vmlist" command:
...
...
Script example:
In this example, we'll use "ssh
" to display the guest "uptime
" and the result of the "uname -nr
" command (name of the node + release number of the operating system)
The last 2 lines are mandatory
|
...
Example file provided (contains example for Tru64 and OpenVMS):
The example file is "/opt/charon/utils/charon_gstart.chkrun.example
".
...