Quota on CPU-hours/memory-hours


One of the intended use-cases for my OpenNebula cloud is to provide resources for students, so that they can play with VMs and test their code in parallel on a bigger number of VMs. It means I would like to set up quotas so that they will be able to use, say, one or two long-lived VMs, or tens of small-sized short-lived VMs. Is it possible to do that with the current system of quotas in OpenNebula?

If it is not possible, I will probably have to program it outside OpenNebula - can showback provide data on hourly or daily basis instead of monthly data? I am thinking about evaluating the per-user hourly/daily/weekly resource usage, and lower the quota and undeploy user’s VMs when the user’s “soft quota” on memory or CPU is exceeded for more than several hours.

Which approach would you use?


That use case has been discussed before, and it is something we want to implement eventually, but currently is not supported.

To get the number of hours a VM has been running you need to use accounting instead of showback. You will find that the history records contain the start and end time.

To process the information, the oneacct command support the following options: --xml, --json, --csv.

OK, thanks! I will try to use oneacct.