Home > Blogs > VMware PowerCLI Blog


Easily Access DRS Actions Logs with PowerCLI

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:

Get-DRMInfo1

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.

Get-DRMInfo2

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

Get-DRMInfo3

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!

This entry was posted in Logs, Reporting, vCenter and tagged , , on by .
Brian Graf

About Brian Graf

Brian Graf is a well-known VMware evangelist in the IT community. Over the past 5 years, Brian has done Technical Marketing for PowerCLI Automation and ESXi Lifecycle, Product Management of vCenter Distributed Resource Management features (DRS & HA), and is currently working as a Technical Marketing Manager for VMware Cloud on AWS. Brian is a co-author of the PowerCLI Deep Dive 2nd edition book. He has helped develop VMware certification courses and exams and presents around the world at VMware User Conferences, AWS Summits, Interop, as well as other industry Conferences. Brian is also a Microsoft MVP.

Leave a Reply

Your email address will not be published. Required fields are marked *

*