How capacity works in EC2?

We are setting different capacities for one EC2 host in ONE. For example, M1_SMALL with value 3, T2_SMALL with value 1… The problem is when we instantiate several VMs. So when we try to start 4 m1.small they boot and turn on although the limit is set to 3 in that host. We only have one host and no priority or anything like that set. We have also checked the DB and those values are correctly saved although it seems that ONE ignores them completely.

Versions of the related components and OS (frontend, hypervisors, VMs):
CentOS 7 with OpenNebula 5.4.5.

Steps to reproduce:
Create an EC2 host and set capacity for M1_SMALL with value 3. Then, start 4 VMs on that host with type m1.small.

Current results:
4 VMs running.

Expected results:
3 VMs running.

Hi oriol,

The behaviour that u are describing is normal.
The capacity attribute let you to create a limit for memory and cpu allocation.

That means for example that if you are creating a capacity with 3 M1_SMALL (cpu 1, memory 1.7) instances and 1 T2_Small instance (cpu: 1, memory: 2)
you could allocate:

  • 3 * 1 (m1small) + 1 * 1 (t2small) = 4 cpu
  • 3 * 1.7 (m1small) + 1 * 2 (t2small) = 7.1 mem

In your example you are running 4 m1small so:

4 * 1 (m1small) = 4cpu <= 4(previous example) OK
4 * 1.7(m1small) = 6.8mem <= 7.1(prev example) OK

That means that you are allowed to deploy those vms.


1 Like

That seems more reasonable, thank-you so much!