Top
ServerView Resource Orchestrator Cloud Edition V3.1.1 Reference Guide (Command/XML)
ServerView

B.2 Script Format

Create scripts in the following format.

Storage Location of Scripts

[Windows Manager]
Installation_folder\SVROR\Manager\etc\user_script

[Linux Manager]
/etc/opt/FJSVrcvmr/user_scripts

Script Name

Execution_order_resource_name_execution_timing-arbitrary_line.extension

Script Format

Specify as follows:

Table B.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 Manager]
A format which can be directly executed from the command line.

[Linux Manager]
Privileges for execution must be given.

Example

  • Name of script for operations before cancelling an L-Platform

    00_lplatform_pre_delete.bat

  • Name of script for operations after applying for an L-Platform

    00_lplatform_post_create.bat

  • 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_stop.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 B.2 Names of Resources and Operations which are the Targets of Script Startup before and after Operations

Resource Name

Operation Name

Remarks

lplatform

Subscribe to a New L-Platform

create

-

L-Platform Reconfiguration (When L-Server is added)

create

When by one operation multiple L-Servers are added, script executes number of addition L-Servers.
Only when L-Server is added, script execute. When L-Server specs or the disk are modified, script is not executed.

L-Platform Reconfiguration (When L-Server is deleted)

delete

When by one operation multiple L-Servers are deleted, script executes number of deleted L-Servers.
Only when L-Server is deleted, script execute. When L-Server specs or the disk are modified, script is not executed.

Cancel an L-Platform

delete

-

power on for all servers in the L-Platform

start

-

power off for all servers in the L-Platform

stop

-

lserver

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

Creating an L-Server

create

When executing rcxadm lserver create, or creating an L-Server using the [Resource] tab.

Deleting an L-Server

delete

When executing rcxadm lserver create, or creating an L-Server using the [Resource] tab.

Starting an L-Server

start

The operation is not executed during start all operations.

Stopping an L-Server

stop

The operation is not executed during stop all operations.

tenant

Creating an Tenant

create

When by one operation multiple Tenants are added, script execute number of addition Tenants.

Deleting an Tenant

delete

-

Modifying an Tenant

modify

When all the tenants are chosen, script execute number of addition Tenants.

power on for all servers in the Tenant

start

When all the tenants are chosen, script execute number of addition Tenants.

power off for all servers in the Tenant

stop

-

Exit Status

This command returns the following values:

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 Manager]
Installation_folder\Manager\var\script_log

[Linux Manager]
/opt/FJSVrcvmr/var/script_log

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

Output_date is in the following format.

YYYY-MM-DD HH-MM-SS

When the same scripts are executed at the same time, the file name ends with -X.

X is a sequential number starting from "1".


Temporary Files

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

Storage Location of Temporary Files

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

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

File Name of Temporary Files

Execution timing.xx.xx

The execution timing is the values specified in "Table B.1 List of Items Specified in Scripts".

xx.xx is in the following format:

Manager_process_ID.Numbers_created_randomly_not_to_overlap

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

It is not necessary to consider the file names in the script files, if loading the file name using the argument created the above.

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 Manager]
CR+LF

[Linux Manager]
LF

The meanings and values of variables are as follows:

Table B.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: ""

  • When the executing timing is post_delete: ""

TENANT_ID

ID of the tenant which is the target of operation

Character string enclosed by double quotes (")

  • When not belonging to a tenant: "-"

  • When the executing timing is post_delete: ""

TIME

Time an event occurred

YYYY-MM-DD HH:MM:SS

CLIENT_IP

IP address of the client executing an operation using the [Resource] tab.

XX.XX.XX.XX

  • When the operation uses the [L-Platform] tab or L-Platform API: "127.0.0.1"

USER_ID

ID of the user executing an operation

Character string enclosed by double quotes (")

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

  • For create or delete for an L-Platform in the status that the application process is valid: ""

USER_NAME

Name of the user executing an operation

Character string enclosed by double quotes (")

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

  • For create or delete for an L-Platform in the status that the application process is valid: ""

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: ""

  • For create or delete for an L-Platform in the status that the application process is valid: ""

USER_GROUP_NAME

User group name which the user executed operations belongs to

Character string enclosed by double quotes (")

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

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

  • For create or delete for an L-Platform in the status that the application process is valid: ""

OWNER

The name of the user who owns the target resource

Character string enclosed by double quotes (")

  • If the resource is something other than L-Platform: ""

  • If the resource is an L-Platform deployed by a tenant administrator or dual-role administrator: ""

  • When the executing timing is post_delete: ""

FULL_NAME

Unique name of the resource which is the target of operation

Character string enclosed by double quotes (")

  • A character string of a hierarchized resource folder connected with slashes "/" before RESOURCE_NAME

  • When the executing timing is post_delete: ""

FOLDER_TYPE

Folder type is the target of operation

Character string enclosed by double quotes (")

  • When the target resource is L-Platform: "LPLATFORM"

  • When the target resource is Tenant: "TENANT"