Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
TOC
TOC
Include Page
KBCOMMON:KB-CSSstyle
KBCOMMON:KB-CSSstyle

Contents

Table of Contents
excludeContents
stylesquare

Required parameters

ParameterValueExample
logfilefull path to the logfile that will be used to log the script outputlogfile=C:\Charon\myds20vms_shutdown.log
waitbeforestopnumber of seconds to wait once the virtual machine is not responding to 'ping' before stopping the service. If not set, default value = 60waitbeforestop=10
servicenameCHARON virtual machine service nameservicename=myds20vms
servernameServer name or IP addressservername=10.0.0.3
osVMS or Tru64os=VMS
modershmode=rsh
rshbinDefines the location of the "rsh.exe"rshbin=C:\bin\rsh.exe
usernameDefines the remote username that will be used to connect to the virtual machine via rsh

username=system

Include Page
KBCOMMON:KB-GoToTop
KBCOMMON:KB-GoToTop

Enabling remote connection on Tru64

To allow passwordless connection from the Windows server to the Tru64 system, the Tru64 local account's .rhosts file has to be updated by specifying the Windows server name and account used.

The .rhosts file contains a list of remote users who are not required to supply a login password when they use the local user account and execute the rcp, rlogin, and rsh commands (see "# man rhosts" for more)

(info) In the example below, a proxy will be created between the Windows 'administrator' account (Windows system IP address is 10.0.0.1) and the Tru64 'root' account (Tru64 system IP address is 10.0.0.2)

Div
classcommandline

# vi $HOME/.rhosts

10.0.0.1 Administrator

Include Page
KBCOMMON:KB-GoToTop
KBCOMMON:KB-GoToTop

Enabling remote connection on OpenVMS

Enable the REXEC and RSH service on OpenVMS by executing the TCPIP$CONFIG script (depending on OpenVMS version, the script could be UCX$CONFIG) :

Div
classcommandline

VMS084> @sys$manager:tcpip$config

 

        Checking TCP/IP Services for OpenVMS configuration database files.

 

 

        HP TCP/IP Services for OpenVMS Configuration Menu

 

        Configuration options:

 

                 1  -  Core environment

                 2  -  Client components

                 3  -  Server components

                 4  -  Optional components

 

                 5  -  Shutdown HP TCP/IP Services for OpenVMS

                 6  -  Startup HP TCP/IP Services for OpenVMS

                 7  -  Run tests

 

                 A  -  Configure options 1 - 4

                [E] -  Exit configuration procedure

 

Enter configuration option: 2

 

        HP TCP/IP Services for OpenVMS Client Components Configuration Menu

 

        Configuration options:

 

                 1  -  DHCP Client      Disabled Stopped

                 2  -  FTP Client       Disabled Stopped

                 3  -  NFS Client       Disabled Stopped

                 4  -  REXEC and RSH    Disabled Stopped

                 5  -  RLOGIN           Disabled Stopped

                 6  -  SMTP             Disabled Stopped

                 7  -  SSH Client       Disabled Stopped

                 8  -  TELNET           Enabled  Started

                 9  -  TELNETSYM        Disabled Stopped

 

                 A  -  Configure options 1 - 9

                [E] -  Exit menu

 

Enter configuration option: 4

 

RSH Configuration

 

Service is defined in the SYSUAF.

Service is defined in the TCPIP$SERVICE database.

Service is not enabled.

Service is stopped.

 

        RSH configuration options:

 

                 1 - Enable service on this node

 

                 2 - Enable & Start service on this node

 

                [E] - Exit RSH configuration

 

Enter configuration option: 2

%TCPIP-I-INFO, image SYS$SYSTEM:TCPIP$RSH.EXE installed

%TCPIP-I-INFO, image SYS$SYSTEM:TCPIP$RCP.EXE installed

%TCPIP-I-INFO, logical names created

%%%%%%%%%%%  OPCOM   8-JUL-2016 01:28:23.22  %%%%%%%%%%%

Message from user INTERnet on VMS084

INTERnet ACP Activate RSH Server

 

%TCPIP-I-INFO, service enabled

%TCPIP-S-STARTDONE, TCPIP$RSH startup completed

Press <ENTER> key to continue ...

 

REXEC Configuration

 

Service is not defined in the SYSUAF.

Service is not defined in the TCPIP$SERVICE database.

Service is not enabled.

Service is stopped.

 

        REXEC configuration options:

 

                 1 - Enable service on this node

 

                 2 - Enable & Start service on this node

 

                [E] - Exit REXEC configuration

Enter configuration option: 2

...

        HP TCP/IP Services for OpenVMS Client Components Configuration Menu

 

        Configuration options:

 

                 1  -  DHCP Client      Disabled Stopped

                 2  -  FTP Client       Disabled Stopped

                 3  -  NFS Client       Disabled Stopped

                 4  -  REXEC and RSH    Enabled  Started

                 5  -  RLOGIN           Disabled Stopped

                 6  -  SMTP             Disabled Stopped

                 7  -  SSH Client       Disabled Stopped

                 8  -  TELNET           Enabled  Started

                 9  -  TELNETSYM        Disabled Stopped

 

                 A  -  Configure options 1 - 9

                [E] -  Exit menu

 

Enter configuration option: E

Check the service is enabled:

Div
classcommandline

VMS084> tcpip show service

 

Service             Port  Proto    Process          Address            State

 

RSH                  514  TCP      TCPIP$RSH        0.0.0.0             Enabled

SSH                   22  TCP      TCPIP$SSH        0.0.0.0             Enabled

TELNET                23  TCP      not defined      0.0.0.0             Enabled

To allow passwordless connection from the Windows server to the OpenVMS system, a proxy must be created between the Windows user that will execute the 'rsh' command and the OpenVMS user account:

(info) In the example below, a proxy will be created between the Windows 'administrator' account (Windows system IP address is 10.0.0.1) and the OpenVMS 'system' account (OpenVMS system IP address is 10.0.0.3)

Div
classcommandline

VMS084> tcpip

TCPIP> add proxy system /remote=administrator /host=10.0.0.1

TCPIP> show proxy

 

VMS User_name     Type      User_ID    Group_ID   Host_name

 

SYSTEM            CD     ADMINISTRATOR            10.0.0.1

Include Page
KBCOMMON:KB-GoToTop
KBCOMMON:KB-GoToTop

 

Example

Configuration file

Div
classcommandline

#-----------------------------------------

# myds20 OpenVMS 8.4 machine

#-----------------------------------------

logfile=C:\Charon\myds20vms_shutdown.log

waitbeforestop=10

servername=10.0.0.3

servicename=myds20vms

os=VMS

mode=rsh

rshbin=C:\bin\rsh.exe

username=system

Include Page
KBCOMMON:KB-GoToTop
KBCOMMON:KB-GoToTop

Script execution

Check mode

Div
classcommandline

c:\Charon>powershell -file charon_vmshutdowncleanshutdown.ps1 -config myds20vms.ini -check

 

Name                           Value

----                           -----

mode                           rsh

servicename                    myds20vms

servername                     10.0.0.3

waitbeforestop                 10

os                             VMS

username                       system

rshbin                         C:\bin\rsh.exe

logfile                        C:\Charon\myds20vms_shutdown.log

 

20160808:132716:INFO :0: Using 'C:\Charon\myds20vms_shutdown.log' as log file / append

20160808:132716:INFO :0: Check mode enabled.

20160808:132716:INFO :0: 'rsh' will be used

20160808:132716:INFO :0: Service 'myds20vms' is Running (Display name: myds20vms)

20160808:132716:INFO :0: Testing server '10.0.0.3' response

20160808:132719:INFO :0: Invoking 'rsh' command and executing check command...

20160808:132719:INFO :0: Output results:

20160808:132719:INFO :0: RSH was successful

20160808:132719:INFO :0:

20160808:132719:INFO :0:

20160808:132719:INFO :0: Command successfully completed.

20160808:132719:INFO :0: Check mode, no connection test to be performed.

20160808:132719:INFO :0: Check mode, no wait / stop service.

20160808:132719:INFO :0: Check mode, the service myds20vms will not be stopped

20160808:132719:INFO :0: Service is Running

20160808:132719:INFO :0: Done.

Include Page
KBCOMMON:KB-GoToTop
KBCOMMON:KB-GoToTop

Shutdown execution

Div
classcommandline

c:\Charon>powershell -file charon_vmshutdowncleanshutdown.ps1 -config myds20vms.ini

 

Name                           Value

----                           -----

mode                           rsh

servicename                    myds20vms

servername                     10.0.0.3

waitbeforestop                 10

os                             VMS

username                       system

rshbin                         C:\bin\rsh.exe

logfile                        C:\Charon\myds20vms_shutdown.log

 

20160808:134256:INFO :0: Using 'C:\Charon\myds20vms_shutdown.log' as log file / append

20160808:134256:INFO :0: 'rsh' will be used

20160808:134256:INFO :0: Service 'myds20vms' is Running (Display name: myds20vms)

20160808:134256:INFO :0: Testing server '10.0.0.3' response

20160808:134259:INFO :0: Invoking 'rsh' command and executing shutdown...

20160808:134259:INFO :0: Output results:

20160808:134259:INFO :0: $   PURGE /KEEP=20 SYS$MANAGER:CHARON_SHUTDOWN.LOG

20160808:134259:INFO :0:

20160808:134259:INFO :0: $   RUN /DETACH SYS$SYSTEM:LOGINOUT.EXE /INPUT=SYS$MANAGER:CHARON_SHUTDOWN -

20160808:134259:INFO :0:

20160808:134259:INFO :0:         /OUTPUT=SYS$MANAGER:CHARON_SHUTDOWN.LOG /UIC=[1,4]

20160808:134259:INFO :0:

20160808:134259:INFO :0: %RUN-S-PROC_ID, identification of created process is 0000014A

20160808:134259:INFO :0:

20160808:134259:INFO :0: $ ENDIF

20160808:134259:INFO :0:

20160808:134259:INFO :0: $ EXIT

20160808:134259:INFO :0:

20160808:134259:INFO :0: $

20160808:134259:INFO :0:

20160808:134259:INFO :0: $ !

20160808:134259:INFO :0:

20160808:134259:INFO :0: $ ! Force any output to the standard output socket.

20160808:134259:INFO :0:

20160808:134259:INFO :0: $ ! Most useful when client is Un*x.

20160808:134259:INFO :0:

20160808:134259:INFO :0: $ !

20160808:134259:INFO :0:

20160808:134259:INFO :0: $    WRITE SYS$OUTPUT ""

20160808:134259:INFO :0:

20160808:134259:INFO :0:

20160808:134259:INFO :0:

20160808:134259:INFO :0: $

20160808:134259:INFO :0:

20160808:134259:INFO :0: $    IF (RSHD$ERROR .NES. RSHD$INPUT_OUTPUT)

20160808:134259:INFO :0:

20160808:134259:INFO :0: $    ENDIF

20160808:134259:INFO :0:

20160808:134259:INFO :0: $

20160808:134259:INFO :0:

20160808:134259:INFO :0: $ ! SS_NORMAL, RSH was succcessful, command should send its error over net.

20160808:134259:INFO :0:

20160808:134259:INFO :0: $    EXIT 1

20160808:134259:INFO :0: Command successfully completed.

20160808:134302:INFO :0: Testing connection to '10.0.0.3' = True

20160808:134325:INFO :0: Testing connection to '10.0.0.3' = False

20160808:134335:INFO :0: Sleeping for 10 seconds...

20160808:134345:INFO :0: Stopping service myds20vms

20160808:134345:INFO :0: Service is Stopped

20160808:134345:INFO :0: Done.

 

Include Page
KBCOMMON:KB-GoToTop
KBCOMMON:KB-GoToTop