BladeSystem Virtual Connect
cancel
Showing results for 
Search instead for 
Did you mean: 

Query OA to get the current active VC module?

chuckk281
Trusted Contributor

Query OA to get the current active VC module?

Dung needed to know how to determine which Virtual Connect was active or primary module:

 

*******************

 

Does anyone know how to query the Onboard Administrator (OA) using the CLI command to get the active VC Flex-10 module?

 

I have a script to connect to a VC  management console by using its IP address but sometimes, the IP address I provide points to a standby VC module

As such, I want to query OA first to get the active one.

 

******************

 

From Steven:

 

********************

 

show vcmode seems to work. I used that to query my VC and it showed this:

 

 

rack27-enc1-oa1> show vcmode

 

Virtual Connect Mode: Enabled

Virtual Connect URL: http://10.50.144.50/

Virtual Connect Domain Name: kamp_vc

 

 

I powered off the primary VC module and in a few minutes it changed to this:

 

rack27-enc1-oa1> show vcmode

 

Virtual Connect Mode: Enabled

Virtual Connect URL: http://10.50.144.51/

Virtual Connect Domain Name: kamp_vc

 

 

Should be able to use plink or something similar to yank that into PowerShell and parse out the IP. One thing to note is the IP change was not instant. It took a few minutes to update.

 

Hope this helps.

 

******************

 

And this reply from Dung:

 

****************

 

Function Run-Plink ([string]$cmd ="show -help" ,[string]$username=$OAAdminName ,

 

[string]$password=$OAPassword, [string]$Chassis =$OAIPAddress)

{

 

                        $PLink = "$SSHDIR\Plink.exe"

                        & $Plink -auto_store_key_in_cache -l $username -pw $password $Chassis $cmd

}

 

 

function Get-ActiveVCModule

{

 

                        $result = run-plink -username $OAAdminName -password $OAPassword -chassis $OAIPAddress -cmd "SHOW VCMODE"

                       

                        $URL_Line = ($result | select-string -pattern "URL").Line

                        $IPAddress = $URL_Line.Split(":")[-1]

                        $IPAddress = $IPAddress -replace "//",""

                        $IPAddress = $IPAddress -replace "/",""

                        $IPAddress =$IPAddress.Trim()

                        $IPAddress

}

 

Works great!

 

*********************

 

Any other comments or suggestions?