07-17-2018 07:06 AM - edited 03-01-2019 01:38 PM
I want to get the CIMC & BIOS settings and compare it across a large number of servers.
I can get the BIOS data with ucscfg which is fine. However getting CIMC data seems impossible. Realistically I am looking for Networking and Storage primarily. We have multiple 10GB adapters on different vLANs etc, and other things like storage need to be identical.
Say we have 50 DB servers, all UCS C220 M4s with Adapter1 and MLOM, and 6 disks. How can I ensure all are the same and there is no drift?
Does anyone have a way to do this?
07-17-2018 10:00 AM - edited 07-17-2018 10:29 AM
Greetings.
You might want to try the IMC power tools.
https://communities.cisco.com/docs/DOC-37154
Once installed you can run a lot of get-imc... commands and pipe to csv
A few samples from my lab below:
C:\Users\kirk> get-imcmgmtif
AdminDuplex : NA
AdminNetSpeed : NA
AutoNeg : disabled
DdnsDomain :
DdnsEnable : yes
DdnsRefreshInterval : 0
Description : Management Interface Network Settings
DhcpEnable : no
DnsAlternate : 0.0.0.0
DnsPreferred : 0.0.0.0
DnsUsingDhcp : no
ExtEnabled : yes
ExtGw : 192.168.1.254
ExtIp : 192.168.1.55
ExtMask : 255.255.255.0
Hostname : C220-xxxxx
Id : 1
IfType : physical
Mac : 88:F0:31:27:55:7B
NicMode : shared_lom
NicRedundancy : active-active
OperDuplex : NA
OperNetSpeed : NA
PortProfile :
Subject : blade
V4IPAddr :
V4IPAddrBmc1 :
V4IPAddrBmc2 :
V4IPAddrCmc1 :
V4IPAddrCmc2 :
V6IPAddr :
V6IPAddrBmc1 :
V6IPAddrBmc2 :
V6IPAddrCmc1 :
V6IPAddrCmc2 :
V6SlaacIp : ::
V6dhcpEnable : no
V6dnsAlternate : ::
V6dnsPreferred : ::
V6dnsUsingDhcp : no
V6extEnabled : no
V6extGw : ::
V6extIp : ::
V6linkLocal : ::
V6prefix : 64
VHostname :
VicSlot : 0
VlanEnable : no
VlanId : 1
VlanPriority : 0
Imc : C220-xxxxx
Dn : sys/rack-unit-1/mgmt/if-1
Rn : if-1
Status :
XtraProperty : {}
PS C:\Users\kirk> Get-ImcStorageController
AdminAction : no-op
Id : SLOT-MEZZ
Model : Cisco UCSC RAID SAS 2008M-8i
PciSlot : SLOT-MEZZ
Presence : equipped
RaidSupport : yes
SelfEncryptEnabled : no
Serial :
Type : SAS
Vendor : LSI Logic
Imc : C220-xxxxx
Dn : sys/rack-unit-1/board/storage-SAS-SLOT-MEZZ
Rn : storage-SAS-SLOT-MEZZ
Status :
XtraProperty : {}
PS C:\Users\kirk> get-imcstoragevirtualdrive
AccessPolicy : read-write
AdminAction : no-op
AllowBackgroundInit : true
AutoDeleteOldest : true
AutoSnapshot : false
BootDrive : true
CachePolicy : direct-io
CurrentWriteCachePolicy : write-through
DiskCachePolicy : unchanged
DriveState : Optimal
DrivesPerSpan : 2
FdeCapable : no
FdeEnabled : no
Health : Good
HotspareAction : no-op
Id : 0
Name : RAID1_23
PhysicalDrivesList : Physical drives to be used for virtual drive reconstruction. pd_id1,pd_id2,...pd_idN
RaidLevel : RAID 1
ReadAheadPolicy :
ReadPolicy : no-read-ahead
RequestedWriteCachePolicy : write-through
Size : 952720 MB
SpanDepth : 1
StripSize : 64k
TargetId : 0
VdStatus : Optimal
VirtualDriveName :
WriteCachePolicy :
Imc : C220-xxxxxx
Dn : sys/rack-unit-1/board/storage-SAS-SLOT-MEZZ/vd-0
Rn : vd-0
Status :
XtraProperty : {}
AccessPolicy : read-write
AdminAction : no-op
AllowBackgroundInit : true
AutoDeleteOldest : true
AutoSnapshot : false
BootDrive : false
CachePolicy : direct-io
CurrentWriteCachePolicy : write-through
DiskCachePolicy : unchanged
DriveState : Optimal
DrivesPerSpan : 1
FdeCapable : no
FdeEnabled : no
Health : Good
HotspareAction : no-op
Id : 1
Name : RAID0_1
PhysicalDrivesList : Physical drives to be used for virtual drive reconstruction. pd_id1,pd_id2,...pd_idN
RaidLevel : RAID 0
ReadAheadPolicy :
ReadPolicy : no-read-ahead
RequestedWriteCachePolicy : write-through
Size : 94413 MB
SpanDepth : 1
StripSize : 64k
TargetId : 1
VdStatus : Optimal
VirtualDriveName :
WriteCachePolicy :
Imc : C220-xxxxx
Dn : sys/rack-unit-1/board/storage-SAS-SLOT-MEZZ/vd-1
Rn : vd-1
PS C:\Users\kirk> get-imcstoragevirtualdrive | select IMC,RN,Size,raidlevel,CurrentWriteCachePolicy,health
Imc : C220-xxxxx
Rn : vd-0
Size : 952720 MB
RaidLevel : RAID 1
CurrentWriteCachePolicy : write-through
Health : Good
Imc : C220-xxxxxx
Rn : vd-1
Size : 94413 MB
RaidLevel : RAID 0
CurrentWriteCachePolicy : write-through
Health : Good
get-imcstoragevirtualdrive | select IMC,RN,Size,raidlevel,CurrentWriteCachePolicy,health | export-csv c:\temp\imcreport.csv
The imc powershell tool allows you to login to multiple IMCs.
It's pretty easy to see the available IMC applet commands with the windows ISE powertool interface.
Check out the sample script that inventories the server to csv: https://communities.cisco.com/docs/DOC-57125
With that many standalone rack servers, you might want to consider the IMC supervisor product.
Thanks,
Kirk...
07-18-2018 12:38 AM
If you prefer Perl you might try this: https://communities.cisco.com/docs/DOC-52108
The UCS Manager MIT Snapshot tool is built on Perl and includes a custom Perl module (UcsSimple-CommMgr). The snapshot tool can be configured to connect to the UCS Manager XML API to query/collect the information contained in the MIT. A second script can be run against a captured snapshot to produce an HTML formatted report of the MIT data. The UcsSimple-CommMgr Perl module package also contains sample scripts to interact with the XML API (Authentication, DN query, Class query, etc..)
The Perl module (UcsSimple-CommMgr) contains a script named "ucs-diff" to compare two ucs XML document elements. I have not tried it for myself but it sounds useful.
07-18-2018 05:55 AM
That requires the UCS Manager MIT Snapshot Tool though, which itself requires UCS Manager?
07-24-2018 02:21 AM
Yes, you are right. You indeed need a UCS Manager to use the Snapshot Tool and also the other Perl moduls. Sorry, I missed this.
Therfore this would be no solution for comparing CIMC settings.
07-24-2018 05:45 AM
Thanks for that! I am going to look at the UCS PowerTool first when I get a chance. I had issues when I tried it last week, but was under pressure so reneged on getting it working [seemed to be an issue with versioning and SSL certs/logins. I am going to try a docker image next time in a week or two]
If that doesnt work Ill definately have a look at the script, thanks.
07-24-2018 03:31 AM
This is easily doable with imcsdk, ansible and a yaml file. We've created a yaml file that defines what we want set at the cimc level. We then feed that yaml into a simple python script that reads the yaml and verifies if the object is set as it should be and either reports back what its set to or actually makes the change if its not what its supposed to be set to.
The script runs on one server but you can very easily pump it through an ansible playbook and run it against many servers at once.
Keep in mind this is based of some older versions of the IMCsdk and things have changed a bit since I wrote this, so it might require some minor tweaks to work. The Readme describes how to use it.
https://github.com/lwatta/UCS-API-Tools/tree/master/CIMC/API_generic_script
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide