cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

496
Views
2
Helpful
3
Replies
Highlighted
Beginner

UCS Powertool code snippet to resolve Product Name instead of PID in Model field

Hello All,

I forgotten the code snippet that I need to add to the following line of code so that when I display the model field, it actually display the product name verses the PID.

Get-UcsBlade -Ucs $handleArray | Sort-Object -Property Ucs,ChassisID,SlotID | Select-Object Ucs,ServerId,Name,UsrLbl,Model,AvailableMemory,NumOfCpus,NumOfCores,NumOfCoresEnabled,NumOfThreads,NumOfAdaptors,NumOfEthHostIfs,NumOfFcHostIfs,AssignedToDn,Presence,OperState,Operability,OperPower,Serial

Example of output:

Ucs               : AHC-UCS1

ServerId          : 1/1

Name              : AMGS5260

UsrLbl            : CliniCare dB 10.18.113.108

Model             : N20-B6740-2

AvailableMemory   : 262144

NumOfCpus         : 4

NumOfCores        : 32

NumOfCoresEnabled : 32

NumOfThreads      : 64

NumOfAdaptors     : 2

NumOfEthHostIfs   : 2

NumOfFcHostIfs    : 4

AssignedToDn      : org-root/ls-AllScriptsDatabase1-440

Presence          : equipped

OperState         : ok

Operability       : operable

OperPower         : on

Serial            : FCH161374L6

In the GUI for UCSM, it actually displays Cisco UCS B440 M1, but from the above example, the Model displays the PID.

Thank you,

Jim

Everyone's tags (4)
3 REPLIES 3
Highlighted
Cisco Employee

Re: UCS Powertool code snippet to resolve Product Name instead of PID in Model field

You can pipeline that output into get-ucscapability to get the item out of the UCS Capability Catalog via the API.  That's what the GUI does to give you the friendly name.

Highlighted
Beginner

Re: UCS Powertool code snippet to resolve Product Name instead of PID in Model field

Eric,

I tried that, but just get erros.  I guess I'm stil not sure of the syntax.  I tired:

Get-UcsBlade -Ucs $handleArray | Sort-Object -Property Ucs,ChassisID,SlotID | Select-Object Ucs,ServerId,Name,UsrLbl,Model,AvailableMemory,NumOfCpus,NumOfCores,NumOfCoresEnabled,NumOfThreads,NumOfAdaptors,NumOfEthHostIfs,NumOfFcHostIfs,AssignedToDn,Presence,OperState,Operability,OperPower,Serial | get-ucscapability

Thanks again,

Jim

Highlighted
Cisco Employee

Re: UCS Powertool code snippet to resolve Product Name instead of PID in Model field

The problem on this James is that you are not pipelining an object that the get-ucscapability understands.  When you pipeline into sort or select, it's creating a different object than pipelined in.  You need to pipeline the blade object in this case right into the get-ucscapability.    

CreatePlease to create content
Content for Community-Ad

Cisco COVID-19 Survey