Best Practices


Automated Fix for a DRS Issue

by Steve  | August 6th, 2009

Every once in a while something goes wrong in my lab and I get to spend some quality time working out what happened and how to fix it.  Well after doing updates the other night I did encounter an error that I had not seen before and wanted to share.  The actual error message was this…

“Unable to apply DRS resource settings on host (Reason: A general system error occurred: Invalid fault). This can significantly reduce the effectiveness of DRS”

In my experience over the years, I have learned that to address HA and DRS issue the first place to start with is the vCenter agent or other words the vmware-vpxa agent (mgmt-vmware) that runs on the host and this is the agent that enables communication between the host and vCenter. For that reason it makes it the most logical place to start when troubleshooting and a restart of this service tends to fix up a lot of errors and in this case the restarting of the service resolved the error.

So now I knew the error message to look for as well as what to do to resolve the issue. Perfect for what vWire was designed to do. I needed to create an alert in vWire so I know when this event happens.

So I am going to take the exact error message from vCenter which looked like this…

Unable to apply DRS resource setting on host server in clusterb

I need to add wild cards “.*” for the actual name of the host and cluster so when all said and done the alert looked like this.

 

 

Next comes the PowerShell script to restart the service. The restart-VMHostService is the cmdlet that I need to complete the task. So using straight PowerShell the code would look like this.

 

$vpxa = Get-VMHostService -VMHost $h | where {$_.Key -eq ‘ vmware-vpxa”}

Restart-VMHostService $vpxa -Confirm

 

With that command we need to make a couple changes so it will work with vWire.  I created a foreach loop in case the script is run on more than one host and also changed the way it gets the hostname information so the script will take the piped information from vWire.

 

I was unable to repeat this issue in my lab but if it happens again I know that vWire will alert and resolve the issue for me before I even finish reading the alert email on that event.  Could an administrator ask for anything more?

 


Tags , , , ,

This entry was posted on Thursday, August 6th, 2009 at 12:23 pm and is filed under Virtual Tech. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Add a Comment

x

Subscribe to The Virtual Black Hole RSS Feed Email Notification

Enter your email address:

Delivered by FeedBurner