Limiting number of VMs on Amazon with a control policy

Hi,

I’m trying to implement something that will safeguard a user from spending too much money on Amazon. Initially I want to set a MAX number of VMs that can run on Amazon. If the user provisions more (be it via ManageIQ or directly via the Amazon APIs), I want to send a warning via email (or shut the VMs down).

What I was thinking is this:

  1. Create a new control policy.
  2. Connect it to the “VM Discovered” event
  3. Condition: ProviderType = Amazon AND Total Amazon VMs > SomeValue
  4. Action: send an email (or shut it down…)

I’m currently stuck at point 2, as I don’t see the “VM Discovered” event anymore on CloudForms 4.2. We found it in the docs but i can’t find it in the product anymore.

Also I would like to understand if a condition like the one I described above is possible.

Thanks!

The VM Discovery event has been removed by this PR and the new document will be updated correspondingly.

VM Create Complete can be used as the event for your policy.

@lfu thank you!

Does the “VM Create Complete” also fire when a VM that was created outside of CloudForms is discovered? If so, then the event name may be a slight misnomer.

Think of “VM Create Complete” as “a VM object has just been created in the VMDB”, then it applies to all occurrences of discovery or provision by MIQ.

pemcg

why not check at provisioning time “pre” VM Create?

@dthornton I want this to work also when VMs are created outside of CloudForms, which is useful when some users have direct API access to the cloud.