BladeSystem - General
1748006 Members
4207 Online
108757 Solutions
New Discussion

Re: Scripting the setup of a virtual connect

 
SOLVED
Go to solution
cursur949
Contributor

Scripting the setup of a virtual connect

This might be a stupid question but I am at a bit of a loss here. 

 

I have created basically a script that sets up my virtual connects up from bare mettle, everything from setting user name and password to assigning the newly created profiles to a server bay. 

 

That said, if I cut and paste the script in to putty or SecureCRT in small chunks all the commands work fine and my virtual connects get setup correctly. 

 

The issue comes in when I copy and paste the data in at the same time, it simply overloads the virtual connect and some stuff does not get created. I think this is because both putty and secureCRT is not waiting for an output of success or error from the VC before executing the next command

 

 

This is one of those issues I hope I feel stupid for asking because the answer is so simple.

12 REPLIES 12
Johan Guldmyr
Honored Contributor

Re: Scripting the setup of a virtual connect

Hey, maybe it's possible to put in a sleep() command somewhere? I suppose putty is not so smart that you can write a script/macro in it, but maybe SecureCRT has some kind of macro/scripting feature?

There ought to be other tools you can use for this. If you used Linux then a relatively simple bash script could accomplish this (the command name is 'sleep'). Or perl, or something like that. It should be possible to install on Windows too.

I haven't looked into powershell for Windows, maybe that can do this? Maybe kix might be worth checking out as well..
Jimmy Vance
HPE Pro

Re: Scripting the setup of a virtual connect

I use plink or ssh to send a text file of commands to setup VC.  plink is the command line version of PuTTY

 

# usage
# plink.exe -m SCRIPT_FILENAME -pw VC_TOETAG_PASSWORD Administrator@VC_IP_ADDRESS

 

No support by private messages. Please ask the forum! 
Johan Guldmyr
Honored Contributor

Re: Scripting the setup of a virtual connect

Great tip Jimmy! Forgot about those extra apps on [broken link removed on <4/12/2017> by Mod]  

Psychonaut
Respected Contributor

Re: Scripting the setup of a virtual connect

Great tip, plink is what I have been using, too.

I've been doing a hybrid as it seemed like I couldn't do everything from a script. At least as I looked through the documentation certain setup commands seemed to be missing. cursur949 - is there any chance you can share what you've got? Do you have a redundant VC config? Can you import the other VC's?

Thanks,
Tim
Jimmy Vance
HPE Pro

Re: Scripting the setup of a virtual connect

An example I've used in training labs

 

# usage
# plink.exe -m SCRIPT_FILENAME -pw VC_TOETAG_PASSWORD Administrator@VC_IP_ADDRESS

 

# import the domain, give it a name

import enclosure username=OA_User password=OA_Password

set domain name=TechForum_vc_domain

 

# create a username/password that has all privileges

add user adminuser password=password privileges=*

 

# set up VC-assigned GUIDs

set domain mactype=vc-defined macpool=46
# set domain wwntype=vc-defined wwnpool=

 

# create some networks with preferred and maximum speeds

# add network demo3 prefspeedtype=custom prefspeed=800 maxspeedtype=custom maxspeed=5000
# add network demo4 prefspeedtype=custom prefspeed=900 maxspeedtype=custom maxspeed=5000

 

add network Outside
add network Classroom
add network Classroom
add network Station_01
add network Station_02
add network Station_03
add network Station_04
add network Station_05
add network Station_06
add network Station_07
add network Station_08
add network Station_09
add network Station_10
add network Station_11
add network Station_12

 

# Add uplinks

add uplinkport enc0:1:X2 network=Outside
add uplinkport enc0:1:X4 network=Classroom

 

# profiles are created with 2 ethernet connections by default, so you'll need to
# add 6 more connections to a profile so that all 8 FlexNICs are taken care of

 

add profile Slot_01
set enet-connection Slot_01 1 network=Classroom
set enet-connection Slot_01 2 network=Station_01

 

add profile Slot_02
set enet-connection Slot_02 1 network=Classroom
set enet-connection Slot_02 2 network=Station_02

 

add profile Slot_03
set enet-connection Slot_03 1 network=Classroom
set enet-connection Slot_03 2 network=Station_03

 

add profile Slot_04
set enet-connection Slot_04 1 network=Classroom
set enet-connection Slot_04 2 network=Station_04

 

add profile Slot_05
set enet-connection Slot_05 1 network=Classroom
set enet-connection Slot_05 2 network=Station_05

 

add profile Slot_06
set enet-connection Slot_06 1 network=Classroom
set enet-connection Slot_06 2 network=Station_06

 

add profile Slot_07
set enet-connection Slot_07 1 network=Classroom
set enet-connection Slot_07 2 network=Station_07

 

add profile Slot_08
set enet-connection Slot_08 1 network=Classroom
set enet-connection Slot_08 2 network=Station_08

 

add profile Slot_09
set enet-connection Slot_09 1 network=Classroom
set enet-connection Slot_09 2 network=Station_09

 

add profile Slot_10
set enet-connection Slot_10 1 network=Classroom
set enet-connection Slot_10 2 network=Station_10

 

add profile Slot_11
set enet-connection Slot_11 1 network=Classroom
set enet-connection Slot_11 2 network=Station_11

 

add profile Slot_12
set enet-connection Slot_12 1 network=Classroom
set enet-connection Slot_12 2 network=Station_12

 

add profile Slot_13
set enet-connection Slot_13 1 network=Classroom
set enet-connection Slot_13 2 network=Station_13

 

add profile Slot_14
set enet-connection Slot_14 1 network=Classroom
set enet-connection Slot_14 2 network=Station_01
add enet-connection Slot_14 network=Station_02
add enet-connection Slot_14 network=Station_03
add enet-connection Slot_14 network=Station_04
add enet-connection Slot_14 network=Station_05
add enet-connection Slot_14 network=Station_06

 

add profile Slot_15
set enet-connection Slot_15 1 network=Classroom
set enet-connection Slot_15 2 network=Station_07
add enet-connection Slot_15 network=Station_08
add enet-connection Slot_15 network=Station_09
add enet-connection Slot_15 network=Station_10
add enet-connection Slot_15 network=Station_11
add enet-connection Slot_15 network=Station_12

 

add profile Slot_16
set enet-connection Slot_16 1 network=Outside
set enet-connection Slot_16 2 network=Classroom
add enet-connection Slot_16 network=Labnet

 

# assign the profile to a bay

assign profile Slot_01 1
assign profile Slot_02 2
assign profile Slot_03 3
assign profile Slot_04 4
assign profile Slot_05 5
assign profile Slot_06 6
assign profile Slot_07 7
assign profile Slot_08 8
assign profile Slot_09 9
assign profile Slot_10 10
assign profile Slot_11 11
assign profile Slot_12 12
assign profile Slot_13 13
assign profile Slot_14 14
assign profile Slot_15 15
assign profile Slot_16 16

 

# power on the server (optional)

 

poweron server 1

poweron server 2

poweron server 3

poweron server 4

poweron server 5

poweron server 6

poweron server 7

poweron server 8

 

 

No support by private messages. Please ask the forum! 
Ctl2011
Member

Re: Scripting the setup of a virtual connect

May I know how to generate a configuration script from the existing vc domain? What is the command? I try show all command in cli but the output format is not like the example in jimmy's post.
Jimmy Vance
HPE Pro

Re: Scripting the setup of a virtual connect

"show config" is the CLI command your looking for

No support by private messages. Please ask the forum! 
cursur949
Contributor
Solution

Re: Scripting the setup of a virtual connect

OK – so SecureCRT resolved my issue, there is a value that can be set both via command line and UI that allows to me change the delay time in relation to when it will send the next line.  I played with it a bit and found that 250 milliseconds fixed my issue though I still run it at 400 just to be safe.

 

The Plink idea is also a great idea, though I did not get around to testing it.

Ctl2011
Member

Re: Scripting the setup of a virtual connect

Hi Jimmy,

 

I am using VC3.15 and I cannot find the command show config. Is this only for the latest VC firmware?