Cisco UCS memory inventory by PowerShell

We upgraded our Cisco UCS environment, every host got extra memory from 128 to 256GB. Before we did it we had mesured CPU usage by VMware vRealize Operation Manager. It was a great help to this process. We ware able to proof the CPU performance will be ok with this memory size. We would have liked to incrase our VMware environment density.

We had to coolect every memory module serial numbers, and information about that witch chassis consist of witch memory modul.

We used to Cisco PowerShell for this task. Yes, exist PowerShell tool for Cisco UCS 🙂

You can download Cisco UCS Power Too pack (click link) and install your computer.
(You must restart your computer after install process)

Collect memory serial numbers, and UCS chassis information:

Get-UcsMemoryUnit | Export-Csv c:\tmp\UCS_Memory.csv -Encoding utf8

Get UCS chassis serials:

Get-UcsBlade | Export-Csv c:\tmp\UCS_Serials.csv -Encoding utf8

Whit this two Excel you are able to determine witch memory modul are witch chassis.

Who created a VM

I know, this is not a nice solution, but working and simple, when you want to know who created a VM, or any Event information from a VM.
I found lots of other script witch solve this problem, but i have to know one indivudal vm creation day, and information about creator.

PowerCLI C:\WINDOWS\system32> $DATE = Get-Date
PowerCLI C:\WINDOWS\system32> Get-VM -Name VMNAME | Get-VIEvent -Types Info -Start $DATE.AddDays(-700) -Finish $DATE | Export-Csv c:\tmp\events.csv -Encoding utf8

In exported Excel file will store information about who created the VM. You will see like this: “Created virtual machine vmname.domain.loc on 192.168.x.x in clustername” and in this row find the account name who created that.

When you think, the vm is older then 700 days, you can change this value in command.

I hope this short article will help for you!

VMware PowerCLI – Adding RDM Disk’s

David Ring

See also: VMware PowerCLI – Adding VMFS Datastore’s

After creating the required LUN’s on your storage array and mapped the LUN’s to your ESXi hosts then you may use PowerCLI to add these new LUNs as RDM Disk’s to a Virtual Machine.

The first four steps outline how to use PowerCLI to add an individual RDM to a Virtual Machine and the second section provides the script to add multiple RDM volumes to a Virtual Machine(s).

1. Connect to vCenter:
Connect-VIServer -Server “vCenter_IP” -User UserName -Password Password

If you need to retreive the Cluster and Host names:
look up the Cluster Name:
look up the Host names in the cluster:
Get-Cluster ‘Cluster Name’ | Get-VMHost | Select Name

2. Retrieve the ConsoleDeviceName(s):
In order to use the New-HardDisk cmdlet we require the ‘ConsoleDeviceName’ parameter associated with each LUN. In this example we will use the Get-SCSILun cmd to return…

View original post 620 more words