Top
ServerView Resource Orchestrator Cloud Edition V3.0.0 Reference Guide for Infrastructure Administrators (Resource Management)

5.2 Script Format

Create scripts in the following format.

Storage Location of Scripts

[Windows]
Installation_folder\Manager\etc\user_scripts

[Linux]
/etc/opt/FJSVrcvmr/user_scripts

Script Name

Execution_order_resource_name_execution_timing-arbitrary_line.extension

Script Format

Specify as follows:

Table 5.1 List of Items Specified in Scripts

Items

Content of Description

Execution order

Describe the script execution order. Specify a two-digit integer.

When specifying the same execution order in multiple scripts, the order is not guaranteed.

Resource name

For details on resource names, refer to "Names of Resources and Operations which are the Targets of Script Startup before and after Operations".

Execution timing

When executing scripts either before or after operations start, specify as follows:

  • Before operations

    pre_operation name

  • After operations

    post_operation name

For details on operation names, refer to "Names of Resources and Operations which are the Targets of Script Startup before and after Operations".

Arbitrary character string (optional)

Specify the arbitrary character string without using blank spaces.

Any characters except blank spaces can be used for the filename, and its length can be up to the maximum character string length supported by the OS.

When deploying multiple scripts for the same operation, users can specify a character string to distinguish the usage of the script.

Extension

[Windows]
A format which can be directly executed from the command line.

[Linux]
Privileges for execution must be given.

Example

  • Name of script for operations after creating an L-Server

    01_lserver_post_create-sample.bat

  • Name of script for operations before stopping an L-Server

    00_lserver_pre_start.sh


Names of Resources and Operations which are the Targets of Script Startup before and after Operations

The names of resources and operations which are the targets of script startup before and after operations are as follows:

Table 5.2 Names of Resources and Operations which are the Targets of Script Startup before and after Operations

Resource Name

Operation Name

lserver

(common to physical L-Servers and virtual L-Servers)

Creating an L-Server

create

Deleting an L-Server

delete

Starting an L-Server

start

Stopping an L-Server

stop


Exit Status

This command returns the following statuses:

0

The command executed successfully.

non-zero

An error has occurred.


Standard Output and Errors

Standard output and errors are output in the following folders:

[Windows]
Installation_folder\Manager\var\script_log

[Linux]
/opt/FJSVrcvmr/var/script_log

Standard output and errors are output in the folders with the following names:

Temporary Files

Scripts are used to output information as temporary files when events occur.
For details on output data, refer to "Table 5.3 Meanings and Values of Variables".

Storage Location of Temporary Files

[Windows]
Installation_folder\Manager\var\tmp\rcxtempfile

[Linux]
/opt/FJSVrcvmr/var/tmp/rcxtempfile

File Name of Temporary Files

Execution timing.tmp.xx.xx

The file name above with the full path name is created as the first argument.

The scripts created by users are executed at the timing when a file name is described.

Temporary File Format

The information which user scripts will receive is as follows:

Format

Temporary files are output in the following format.

Variable name= Value

Line break codes are as follows:

[Windows]
CR+LF

[Linux]
LF

The meanings and values of variables are as follows:

Table 5.3 Meanings and Values of Variables

Variable

Meaning

Value

EVENT

Character string displayed in the event column of ROR console when an event occurs

Character string enclosed by double quotes (")

PROGRESS

Timing at which an event occurs

  • Before operations

    "Started"

  • After operations

    "Completed"

  • When a task ends in an error

    "Error"

TASK_ID

Task ID which is the target of operation

Character string enclosed by double quotes (")

When the operation target is not a task: ""

RESOURCE_NAME

Name of the resource which is the target of operation

Character string enclosed by double quotes (")

RESOURCE_TYPE

Type of the resource which is the target of operation

Character string enclosed by double quotes (")

RESOURCE_ID

ID of the resource which is the target of operation

Character string enclosed by double quotes (")

TENANT_NAME

Name of the tenant which is the target of operation

Character string enclosed by double quotes (")

When not belonging to a tenant: ""

TENANT_ID

ID of the tenant which is the target of operation

Character string enclosed by double quotes (")

When not belonging to a tenant: "-"

TIME

Time an event occurred

YYYY-MM-DD HH:MM:SS

CLIENT_IP

IP address of the client executing an operation

XX.XX.XX.XX

USER_ID

ID of the user executing an operation

Character string enclosed by double quotes (")

When the command is executed by the special administrator: ""

USER_NAME

Name of the user executing an operation

Character string enclosed by double quotes (")

When the command is executed by the special administrator: ""

USER_GROUP_ID

User group ID

Character string enclosed by double quotes (")

When the operation target is not a task: ""
The user does not belong to a group: ""

USER_GROUP_NAME

User group name

Character string enclosed by double quotes (")

  • When the operation target is not a task: ""

  • When the user does not belong to a group: ""