Getting Started

This chapter contains the following sections:

Connecting to Cisco UCS Central

Procedure


Step 1

Launch Cisco UCS Central PowerTool from the desktop shortcut

Step 2

View all cmdlets, functions, and aliases supported by the Cisco UCS Central PowerTool.


Get-Command -Module Cisco.UCSCentral
Get-Command -Module Cisco.UCSCentral | group CommandType
Get-Command -Module Cisco.UCSCentral | measure
Step 3

Connect to UCS Central system.

$handle = Connect-UcsCentral <ip or hostname> -NotDefault

Note 

If sign-in is successful Connect-UcsCentral, by default, the UCS Central handle is added to the Default UCS Central list, unless the -NotDefault option is specified. Every cmdlet that operates on UCS Central takes the -UcsCentral parameter, where the handle can be specified.

Step 4

Use the following cmdlets:

  1. Get org objects.

    Get-UcsCentralOrg -UcsCentral $handle
Step 5

Disconnect.

Disconnect-UcsCentral -UcsCentral $handle

Default UCS Central

If no handle or name is specified, the UCS Central handle is added to a Default UCS Central list. Unless the-UcsCentral parameter is specified, the first cmdlet in the pipeline operates on the default UCS Central list.

Connect-UcsCentral <ip or hostname>

Get the Default UCS Central list.

Get-UcsPSSession

Get the set of all chassis objects.

Get-UcsCentralChassis

Get the object pertaining to chassis 1.

Get-UcsCentralChassis -Id 1

Get the set of blades, pertaining to chassis 1.

Get-UcsCentralChassis -Id 1 | Get-UcsCentralBlade

Disconnect.

Disconnect-UcsCentral

Default UCS Central List with Multiple UCS Central Systems

PowerTool cmdlets can work with multiple UCS Central systems by specifying multiple handles.

Connect to a Cisco UCS Central system.

$handle1 = Connect-UcsCentral <ip1> -NotDefault

$handle2 = Connect-UcsCentral <ip2> -NotDefault

Disconnect-UcsCentral-UcsCentral $handle1,$handle2

By default, multiple Cisco UCS Central handles are not allowed in Default UCS Central. You can be override using the Set-UcsPowerToolConfiguration cmdlet.

Get-UcsPowerToolConfiguration

Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs $true

Connect-UcsCentral <ip1>

Connect-UcsCentral <ip2>

Get-UcsPSSession

Disconnect-UcsCentral

Connect to multiple Cisco UCS Central systems using the same login credentials.

$user = "<username>"

$password = "<password>" | ConvertTo-SecureString -AsPlainText -Force

$cred = New-Object System.Management.Automation.PSCredential($user, $password)

$servers = @("<ucsc1>", "<ucsc2>", "<ucsc3>")

Connect-UcsCentral $servers -Credential $cred

Credentials To and From a File

Connect-UcsCentral <ip1>

Connect-UcsCentral <ip2>

Credentials can be stored to a file. The stored credentials are encrypted with a specified Key.

Export-UcsPSSession -LiteralPath C:\work\labs.xml

Disconnect-UcsCentral

Login can be initiated from credentials stored in a file.

Connect-UcsCentral -LiteralPath C:\work\labs.xml

Log in to an extra system and add the credentials to the file.

Connect-UcsCentral <ip3>

Export-UcsPSSession -Path C:\work\lab?.xml -Merge

SSL Handling

When connected to Cisco UCS Central server, the server does not recognize any valid certificates. The, the connection depends on InvalidCertificateAction. InvalidCertificateAction is set to Ignore by default. By default PowerTool is configured to establish the connection without considering the validity of the certificate.

You can override this using the Set-UcsPowerToolConfiguration cmdlet.

Get-UcsPowerToolConfiguration

Set-UcsPowerToolConfiguration -InvalidCertificateAction Fail

Status Description
Fail The cmdlet does not establish a connection if the certificate is not valid.
Ignore The cmdlet establishes the connection without considering the validity of the certificate.
Default (Windows default) The cmdlet establishes a connection if the certificate is valid.

Aliases

Aliases are the simplified cmdlets which can be used to perform Cisco UCS Central operations.

gal | ? {$_.Name -like "*-UcsCentral*" } | select Name

Aliases Cmdlets
Acknowledge-UcsCentralBlade Set-UcsCentralComputePhysicalOperation -Lc rediscover
Acknowledge-UcsCentralChassis Set-UcsCentralEquipmentChassisOperation -AdminState re-acknowledge
Acknowledge-UcsCentralFault Confirm-UcsCentralFault
Acknowledge-UcsCentralFex Set-UcsCentralEquipmentFexOperation -AdminState re-acknowledge
Acknowledge-UcsCentralRackUnit Set-UcsCentralComputePhysicalOperation -Lc rediscover
Acknowledge-UcsCentralServerUnit Set-UcsCentralComputePhysicalOperation -Lc rediscover
Acknowledge-UcsCentralSlot Set-UcsCentralFabricComputeSlotEpOperation -AdminState reacknowledge
Add-UcsCentralMo Add-UcsCentralManagedObject
Associate-UcsCentralServiceProfile Connect-UcsCentralServiceProfile
Compare-UcsCentralMo Compare-UcsCentralManagedObject
Decommission-UcsCentralBlade Set-UcsCentralComputePhysicalOperation -Lc decommission
Decommission-UcsCentralChassis Set-UcsCentralEquipmentChassisOperation -AdminState decommission
Decommission-UcsCentralFex Set-UcsCentralEquipmentFexOperation -AdminState decommission
Decommission-UcsCentralRackUnit Set-UcsCentralComputePhysicalOperation -Lc decommission
Decommission-UcsCentralServerUnit Set-UcsCentralComputePhysicalOperation -Lc decommission
Disassociate-UcsCentralServiceProfile Disconnect-UcsCentralServiceProfile
Get-UcsCentralMo Get-UcsCentralManagedObject
Get-UcsCentralUcsDomain Get-UcsCentralExtpolClient
Recommission-UcsCentralBlade Set-UcsCentralFabricComputePhEpOperation -AdminState enabled
Recommission-UcsCentralChassis Set-UcsCentralFabricSwChPhEpOperation -AdminState enabled
Recommission-UcsCentralFex Set-UcsCentralFabricSwChPhEpOperation -AdminState enabled
Recommission-UcsCentralRackUnit Set-UcsCentralFabricComputePhEpOperation -AdminState enabled
Recommission-UcsCentralServerUnit Set-UcsCentralFabricComputePhEpOperation -AdminState enabled
Remove-UcsCentralBlade Set-UcsCentralComputePhysicalOperation -Lc remove
Remove-UcsCentralCartridge Set-UcsCentralComputeCartridgeOperation -Lc remove
Remove-UcsCentralFex Set-UcsCentralEquipmentFexOperation -AdminState remove
Remove-UcsCentralMo Remove-UcsCentralManagedObject
Remove-UcsCentralRackUnit Set-UcsCentralComputePhysicalOperation -Lc remove
Set-UcsCentralMo Set-UcsCentralManagedObject
Sync-UcsCentralMo Sync-UcsCentralManagedObject