vCenter logs are one thing we all end up dealing with at one point or another. Knowing where to go to view the logs is part of the hassle, but what if it didn’t have to be? at least for some of the logs…
Tell Me More
Did I pique your curiosity? Well good! PowerCLI 6.0 R1 has a new cmdlet ‘Get-DrmInfo’ which retrieves the DrmDumpInfo of each of the clusters within vCenter.
For those of you that are new to DrmDump, it is a log(s) of the actions that are both proposed and taken by the Distributed Resource Scheduler (DRS).
Now, to be fully transparent, this cmdlet only works with vSphere 6 and higher as this leverages the API version 6.0. If you try to run this in a 5.5 (or earlier) environment, you will receive an error:
How Do I Use It?
This cmdlet is quite simple to use. As a matter of fact, there are five parameters that may be used, but only one is actually required (-DestinationPath). The parameters of this cmdlet are:
- Cluster
- Start
- Finish
- NumFiles
- DestinationPath
If you do not specify a cluster, the cmdlet will run against each cluster in your vCenter. The cmdlet also accepts the cluster from the pipeline, meaning you can run a Get-Cluster | Get-DrmInfo and it will pipe the corresponding clusters to it.
The -Start and -Finish parameters allow you to specify specific dates to retrieve information from. For example, If I needed to check the DRM info and I wanted a window of 5 days ago, through today, I could specify it like this:
Get-Cluster Physical | Get-DrmInfo -Start 2015-05-30
If you want to get very specific you can add Time of Day on there as well:
Get-Cluster Physical | Get-DrmInfo -Start 2015-05-30T12:35:00
If I want between two specifc dates I would include the -Finish parameter:
Get-Cluster Physical | Get-DrmInfo -Start 2015-05-30 -Finish 2015-06-01
Using the -NumFiles parameter you can limit the number of files to the latest X number of dump files:
Get-DrmInfo -Cluster Physical -NumFiles 25
To export these files, you can add the -DestinationPath <destination folder> to the end of the command:
Get-Cluster Physical | Get-DrmInfo -Start 2015-05-30 -Finish 2015-06-01 -DestinationPath C:\Temp\
Conclusion
This cmdlet may not be the most-used but it does certainly have its set of use-cases. So next time you are needing to search through DRM logs, or need to troubleshoot the DRS actions, remember to use this cmdlet!