Anchor | ||||
---|---|---|---|---|
|
Include Page | ||||
---|---|---|---|---|
|
...
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 and cannot handle " Important notes:
|
rsh | Requires:
|
ssh | Requires:
|
Div | ||
---|---|---|
| ||
Info | title | Note for Red Hat Enterprise Linux/CentOS 7 and 8
---|---|
If your application and server need 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 " |
...
When the script is initialized using option 6 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.
...
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 Use the
service kill
command (RHEL/CentOS 7 and 8). 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
Div | ||
---|---|---|
| ||
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 Use the
service kill
command (RHEL/CentOS 7 and 8). 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
...
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:
...
In this example, we use "ssh
" to display the guest "uptime
".
The last 2 lines containing the RETVAL variable are mandatory
To create the script, the following commands were executed to copy the provided example to the one that will be used:
...
# cp /opt/charon/utils/charon_gstart.chkrun.example
/opt/charon/utils/charon_gstart.chkrun
# chmod 744 /opt/charon/utils/charon_gstart.chkrun
# vim /opt/charon/utils/charon_gstart.chkrun
Example:
...
#!/bin/sh
#
case "$1"
in
/charon/pluto.cfg)
ssh -o ConnectTimeout=2 pluto5 "uptime|cut -f1 -d','" 2>/dev/null
RETVAL=$?
;;
*)
echo "Invalid parameter '$1'"
RETVAL=1
;;
esac
echo "==RETVAL=${RETVAL}=="
exit ${RETVAL}
Example file provided (contains example for Tru64/pluto.cfg and OpenVMS/vms.cfg):
...
class | small |
---|
...
Forcing service status to INACTIVE without shutdown script
If a shutdown script is not defined, stopping the service will let it in a FAILED state. In case your perform the legacy OS shutdown manually and then stops the virtual machine, you can use the following method to force the service state to INACTIVE.
Example provided for uranus virtual machine (lines to add in blue color):
... /charon/uranus.cfg) PID=`ps -ef|grep "$2 -d $1"|grep -v grep|awk '{print $2}'`
... |
A clean shutdown of the legacy OS is highly recommended.
Include Page | ||||
---|---|---|---|---|
|