VMware Cloud Community
sirus569
Contributor
Contributor

Create an alarm to turn off a VM on host performance

Hi,

I would like to create an alarm that monitors the HOST cpu/memory/datastore usage and triggers an alarm if say the cpu usage hits 95% for 5 minutes. I want the host to then turn off a specific VM(least used VM) if this alarm is triggered.

Is that possible? How can I go about doing this?

Tags (4)
0 Kudos
4 Replies
admin
Immortal
Immortal

AFAIK, Creating an alarm for the condition specified is possible. But powering off least used VM will be difficult.

The approach would be to create an alarm, say memory max usage 90%.

As an action run a command, which can be a PowerCLI oneliner/Script which would get the least used VM and turns it off.

JagadeeshDev
Hot Shot
Hot Shot

You can create an alarm for triggers. And you can shutdown a specific VM by issuing the run commands ( if you are good in scripting)

VMware vSphere 4 - ESX and vCenter Server

http://www.myitblog.in/
sirus569
Contributor
Contributor

I am going to try scripting it; but it does look like it is the only way.

I have 2 other questions related to alarms but not about shutting down a VM.

Question 1: When I create an alarm on a VM's memory usage(%), is vCenter monitoring the guest OS's memory usage % or how much memory is granted to the VM, i.e how much of the host's memory is being given to the VM?

Question 2: I have assigned 4 GBs of RAM to a VM. On this VM I ran a memory stress tester and maxed out the memory usage at 99%. I started a second memory stress test on the very same machine (to push it over 100% memory usage just to see what happens) and I got a alarm that the HOST this VM is running on is at 90% usage.

Does ESXi grant more memory to a VM if it sees that the guest OS is using up all its RAM?

0 Kudos
admin
Immortal
Immortal

Question 1: When I create an alarm on a VM's memory usage(%), is vCenter monitoring the guest OS's memory usage % or how much memory is granted to the VM, i.e how much of the host's memory is being given to the VM?

It will be VM's memory usage.

Does ESXi grant more memory to a VM if it sees that the guest OS is using up all its RAM?

No. It wont.

~dGeorgey

0 Kudos