Hi Jhon, On Tue, May 22, 2012 at 8:44 AM, Jhon Masschelein <jhon.masschel...@sara.nl> wrote:
> > Looking at the template in the sunstone interface (tabs at the bottom), we > see both CPU and VCPU listed. However, when I look at the javascript array > object used to fill in the vm table in sunstone, CPU nor VCPU were present. > > Apparently there is a difference between getting the INFO from a VM and > the POOL_INFO from the pool of VMs. > The only difference is that the VM elements inside VM_POOL only include the last HISTORY records, whereas the individual VM info contains all of them. > Of course, in our specific case, we would also like to enforce the rule: > MEMORY = #CPU * 8GB > > But I do not see how this can be done in a nice way. > This can be easily done with a new authorization driver. You would need to create a new 'authorize' script that ignores all actions except VM CREATE or TEMPLATE USE, and check your restriction. Take a look at the quota authorization driver [1] to get started. Or you could force your users to instantiate only the VM Templates you provide. You just need to remove the CREATE right to all/some of your users, this is done with ACL rules [2] Regards [1] http://dev.opennebula.org/projects/opennebula/repository/revisions/master/show/src/authm_mad/remotes/quota [2] http://opennebula.org/documentation:rel3.4:manage_acl -- Carlos Martín, MSc Project Engineer OpenNebula - The Open-source Solution for Data Center Virtualization www.OpenNebula.org | cmar...@opennebula.org | @OpenNebula<http://twitter.com/opennebula><cmar...@opennebula.org> On Tue, May 22, 2012 at 8:44 AM, Jhon Masschelein <jhon.masschel...@sara.nl>wrote: > Hi, > > Sorry for the late reply, I wasn't in the office last week. > > > The attribute VM/TEMPLATE/CPU should exist if the user defined the CPU >> in the template. But CPU is an optional value. >> You said that you bill by resource allocation; are you taking into >> account this optional attribute? >> > > We consider 1 cpu core + 8GB of memory to be equal to 1 "cloud unit". Out > billing is based on a report that takes this into account. We use the > information from the opennebula vm_pool table. > > Looking at the template in the sunstone interface (tabs at the bottom), we > see both CPU and VCPU listed. However, when I look at the javascript array > object used to fill in the vm table in sunstone, CPU nor VCPU were present. > > Apparently there is a difference between getting the INFO from a VM and > the POOL_INFO from the pool of VMs. > > I tried to figure out where in the code this difference was made, but I > could not put to much time in this and had to leave it. > > (Please remember this is all 3.2.1. It might be solved in 3.4.) > > > If you bill users depending on the CPU and MEMORY attributes, maybe >> opennebula should provide a way to make any attribute mandatory... We >> could add a new section to oned.conf, similar to the restricted >> attributes [2] (introduced in 3.4). For example, >> >> VM_MANDATORY_ATT = "CPU" >> > > This would actually not be a bad thing. At this moment, we are making some > fields mandatory in sunstone, but when they use for example the xml-rpc, > they can work around it. In the end they still get billed since we know > from the vm_pool table what they used, but for the users, it might be a > surprise. It would be better if an "incomplete" VM template would not > instantiate. > > Of course, in our specific case, we would also like to enforce the rule: > MEMORY = #CPU * 8GB > > But I do not see how this can be done in a nice way. > > Anyway, sorry again for the late reply. > > Best regards, > > Jhon > >
_______________________________________________ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org