GSoC/GCI Archive
Google Code-in 2010 Oregon State University Open Source Lab

Ganeti Web Manager: RAM/CPU Quota should be based off running virtualmachines

completed by: CryptWizard

mentors: Peter Krenesky

Please make sure to submit your patch for this task and to take required notes for it in the OSUOSL issue tracker at Required notes would include letting the community know you are working on the issue with a note in the tracker, any notes on progress or difficulties implementing, etc.

For help with this task, contact kreneskyp or ramereth in #ganeti-webmgr on Freenode.

Task description:

All quota values are currently based off of total virtual machines owned. This does not make sense as a load management standpoint since it's very likely that VMs will be created, but not running. E.g. someone doing support testing will be bringing up VMs of different distros and shutting them down afterwards.

h3. required changes

* update *ClusterUser.used_resources()* to filter on *status='running'* This likely means that two queries must be used to generate this value as disk_space requires checking all vms.
* add a CPU/RAM quota check to *VirtualMachine.startup()*
* modify the quota check in ** to:
** check running CPU/RAM only if start_immediately is enabled, depends on #909
** The error message for CPU/RAM should indicate that they can lower the resource amount or toggle the start vm option.