Cisco IMC Powertool is a PowerShell module which helps automate aspects of Cisco UCS C-Series Rack servers and Cisco UCS E-Series servers using XML APIs. Cisco IMC Powertool enables easy integration with existing IT management processes and tools.
The Cisco IMC Powertool cmdlets work on the Cisco IMC Management Information Tree (MIT). The cmdlets allow you to create, modify, or delete actions on the Managed Objects (MOs) in the tree.
Management Information Model
All the physical and logical components that comprise a Cisco C-Series and E-Series servers are represented in a hierarchical Management Information Model (MIM), which is referred to as the Management Information Tree (MIT). Each node in the tree represents a Managed Object (MO), which is uniquely identified by its distinguished name (DN). See Figure 1.
Figure 1 Management Information Model
Managed Objects (MOs) (see Figure 2) are abstractions of Cisco IMC MIT resources, such as CPUs, DIMMs, adapter cards, fans, and power supply units. Managed Objects represent any physical or logical entity that is configured or managed in the Cisco IMC MIT For example, physical entities such as CPUs, DIMMs, adapter cards and fans and logical entities such as users, communication services like HTTP, SSH are represented as MOs.
Figure 2 Managed Objects
Each MO is uniquely identified in the tree with its distinguished name (DN) and can be uniquely identified within the context of its parent with its relative name (RN). The DN identifies the place of the MO in the MIT. A DN is a concatenation of all the relative names that start from the root to the MO itself. Essentially, DN = [RN]/[RN]/[RN]/…/[RN].
In the following example, DN provides a fully qualified name for adapter-1 in the model.
< dn = “sys/rack-unit-1/adaptor-1” />
The above written DN is composed of the following RN:
A relative name (RN) might have a value of one or more of the MO properties embedded in it. This allows you to differentiate multiple MOs of the same type within the context of the parent. Any properties that form part of the RN as described earlier are referred to as naming properties.
For instance, adaptor MOs reside under a rack unit MO. The adaptor MO contains the adaptor identifier as part of its Rn(adaptor-[Id]), which uniquely identifies each adaptor MO in the context of a rack unit.
Methods are Cisco UCS XML APIs used to manage and monitor the system. The following methods are supported:
aaaLogin—Initial method for logging in.
aaaRefresh—Refreshes the current authentication cookie.
aaaLogout—Exits the current session and deactivates the corresponding authentication cookie.
configResolveDn—Retrieves objects by DN.
configResolveClass—Retrieves objects of a given class.
configResolveChildren—Retrieves the child objects of an object.
configResolveParent—Retrieves the parent object of an object.
configConfMo—Affects a single managed object (for example, a DN).
eventSubscribe—To register for events
Cisco IMC Powertool Mapping
All but about 10 of the Cisco IMC Powertool cmdlets are generated from the MO specification. A noun is used in place of the type (Fan instead of EquipmentFan and so on). Get, Add, Set, Remove cmdlets or a subset is generated for the various MO types. All cmdlets support the XML parameter, which dumps the XML request and response on the screen.
Add Cmdlet —Uses the ConfigConfMo method with the MO status “created” with the specified property values. If the Force parameter is specified, there is no prompt for confirmation.
Get Cmdlet —Uses the ConfigResolveClass method to retrieve MOs. XML API of Cisco UCS C-Series Rack Mount servers do not support any filters. So if any property parameters are specified, PowerTool gets all the instances of the specified class and filters them on the client side using the property values.
Set Cmdlet —Uses the ConfigConfMo method with MO status “modified” with the specified property values. If the Force parameter is specified, there is no prompt for confirmation.
Remove Cmdlet —Uses the ConfigConfMo method with the MO status “deleted”. If the Force parameter is specified, there is no prompt for confirmation.
This table lists the properties that can be specified for a given verb:
This table lists the types that can come down the pipeline for corresponding cmdlets:
Singleton—none non-singleton—Parent Type
Singleton—none non-singleton—Parent Type
MO has naming property—Same type MO has no naming property—Same or Parent Type
This table lists the methods invoked to generate the required XML requests:
ConfigResolveClass (The output is then filtered for the matching Dns)
1.This is not a cmdlet. It is a background service.
Get-ImcCmdletMeta is a useful cmdlet to explore the MO types, the corresponding nouns, supported verbs, properties of the MOs, the details of properties including the type (Naming, Read/Write and so on), and the version of Cisco IMC that the property was introduced in.
Supports Cisco IMC Version 1.5 or later for C-Series and Cisco IMC version 2.1(1) or later for E-Series.
Before You Begin
Ensure that you have PowerShell v2.0 or above installed in your system.
Close any instances of PowerShell running with the Cisco IMC Powertool module loaded.
Download and launch the installer.
Step 2 (Optional) Choose Create Shortcut to add a shortcut on the desktop.
From the desktop shortcut, launch
IMC PowerTool .
Step 2 View all cmdlets, functions, and aliases supported by Cisco IMC Powertool.
Get-Command -Module CiscoImcPs
Get-Command -Module CiscoImcPs | group CommandType
Get-Command -Module CiscoImcPs | measure
Step 3 Connect to a Cisco UCS C-Series and E-Series Server.
$handle = Connect-Imc <ip or hostname> -NotDefault
Note After logging on, by default, the Cisco UCS handle is added to the default Cisco UCS C-Series and E-Series Server list, unless the -NotDefault option is specified. Every cmdlet that operates on a Cisco UCS C-Series and E-Series Server takes the –Imc parameter, where the handle can be specified.
Step 4 Connect to a Cisco UCS C-Series and E-Series Server using a proxy.
$handle = Connect-Imc <ip or hostname> -Proxy $proxy
Step 5 Use the following cmdlets:
a. Get the consolidated status information from the Cisco C-Series and E-Series Server.
Get-ImcStatus -Imc $handle
b. Get the inventory summary of the C-Series Unit.
Get-ImcRackUnit -Imc $handle
Disconnect-Imc –Imc $handle
Default Cisco UCS
If no handle or name is specified, the Cisco UCS C-Series and E-Series Server handle is added to a DefaultImc server list unless the –Imc parameter is specified. The first cmdlet in the pipeline operates on the default UCS list.
Connect to UCS C-Series rack server
Connect-Imc <ip or hostname>
Get the default rack server.
Get the status information and CIMC version of the rack server.
Get information about the physical unit of the rack server.
Enable HTTP on the rack server.
Get-ImcHttp | Set-ImcHttp -AdminState enabled
Disable HTTP on the rack server.
Get-ImcHttp | Set-ImcHttp -AdminState disabled
Disconnect the rack server.
Default UCS List with Multiple UCS
Cisco IMC Powertool cmdlets can work with multiple Cisco UCS C-Series Rack Servers if you specify multiple handles.
Connect to a Cisco UCS C-Series and E-Series Server.
$handle1 = Connect-Imc <ip1> -NotDefault
$handle2 = Connect-Imc <ip2> -NotDefault
Get-ImcStatus -Imc $handle1,$handle2
Disconnect-Imc -Imc $handle1,$handle2
By default, multiple Cisco UCS C-Series handles are not allowed in DefaultImc. You can override this restriction by using the Set-UcsPowerToolConfiguration cmdlet.
Log in to an additional system and add the credentials to the file.
Export-ImcPSSession -Path C:\work\lab.xml -Merge
When a user connects to a Cisco UCS C-Series and E-Series Server and the server cannot recognize any valid certificates, the connection establishment depends on InvalidCertificateAction. InvalidCertificateAction is set to Ignore by default. By default Cisco IMC Powertool is configured to establish the connection without taking into account if the certificate is invalid.
You can override this setting by using the Set-ImcPowerToolConfiguration cmdlet.
Subscribe to What’s New in Cisco Product Documentation , which lists all new and revised Cisco technical documentation, as an RSS feed and deliver content directly to your desktop using a reader application. The RSS feeds are a free service.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)
Any Internet Protocol (IP) addresses used in this document are not intended to be actual addresses. Any examples, command display output, and figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses in illustrative content is unintentional and coincidental.