Properties, Command batching, Supporting comments and blank lines in cli scripts – HP Virtual Connect 4Gb Fibre Channel Module for c-Class BladeSystem User Manual

Page 13

Advertising
background image

Introduction 13

In the example, -output is the option, and script1 is an option argument.

Properties

Properties are specific configuration attributes of a managed element. Properties are commonly used during
set operations or add operations where a managed element is being modified or created. In some limited

circumstances, properties might also be used as a part of a show or other command.

IMPORTANT:

If a property value contains embedded spaces, then the entire property value must

be contained within single or double quotes. Likewise, if a double quote is part of a property

value, it should be contained within single quotes, and if a single quote is part of a property value,

it should be contained within double quotes.

Command batching

Scripts are useful for batching many CLI commands. You can create a single CLI script to configure an entire

VC domain from scratch and use it on multiple enclosures.
When using a Linux SSH client, simply redirect the script into SSH. If the SSH keys are not configured on the
client and in the firmware, a password prompt appears. To enable script automation and better security, SSH

public/private key-pairs can be generated and uploaded to the public key to the VC firmware. For example:

>ssh [email protected] < myscript.txt

When using a Windows-based SSH client, pass the file to the client using the -m option. If the SSH keys are

not configured on the client and in the firmware, a password prompt appears. To allow script automation

and better security, SSH public/private key-pairs can be generated and uploaded to the public key to the VC
firmware. For example:

>plink [email protected] -m myscript.txt

The CLI enables you to enter multiple CLI commands in a single command-line invocation. This capability is

useful when batching several commands together and executing them in a particular sequence, within the

context of the same SSH session. This method improves the overall performance of lengthy script processing.
Example 1: Sample commands with no command batching

add profile Profile1

add network Network1

add uplinkset UplinkSet1

Example 2: Sample commands using command batching

add profile Profile1;add network Network1;add uplinkset UplinkSet1

Supporting comments and blank lines in CLI scripts

The CLI supports command scripts that contain blank lines and comments. Support for comments and blank
lines enables you to maintain descriptive notes within the configuration script.
The following sample script illustrates a CLI script that contains this type of formatting. All comment lines must

begin with "#".
#------------------------------------------------------------------------
# This is my sample Virtual Connect Domain Configuration Script
# Revision 1.0.1.2
# February 15, 2012, 2013

Advertising