<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jan 29, 2014, at 3:55 AM, Vinod Kumar Boppanna <<a href="mailto:vinod.kumar.boppanna@cern.ch">vinod.kumar.boppanna@cern.ch</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div ocsi="0" fpstyle="1" style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="direction: ltr; font-family: Tahoma; font-size: 10pt;">Dear Vishvananda,<br><br>Sorry for very late reply. I was stupid not to follow your reply (i had messed it some how).<span class="Apple-converted-space"> </span><br><br>Actually, i am confused after seeing your mail. In the last two weeks, i was doing some testing (creating use cases) on Keystone and Nova.<br><br><u><b>Part 1: Delegating rights<span class="Apple-converted-space"> </span></b></u><br><br>I had made the following observations using Keystone V3<br><br>1. RBAC were not working in Keystone V2 (it was only working in V3)<br>2. In V3, I could create a role (like 'listRole') and created a user in a tenant with this role<br>3. I had changed the RBAC rules in policy.json file of keystone to allowed a user with the 'listRole' in addition to admin, to run the "list_domains", "list_projects" and "list_users" operations<br> (earlier this operations can only be run by admin or we can say super-user)<br>4. These settings were successful and working perfectly fine.<br><br>What my point is here, by playing with RBAC with V3 APIs of keystone, i could delegate rights to users.<span class="Apple-converted-space"> </span><br><br>So, i thought the same can be achieved in any other service (like nova).<span class="Apple-converted-space"> </span><br>For example, i thought in nova also i can create a role add change the policy.json file to allow him to do the necessary operations like list, update etc..<br><br>I could not do this check, because i couldn't able to run Nova with V3 successfully and also could not find the Nova V3 APIs.<br><br>But one thing i guess is missing here (even in keystone) is that, if we allow a normal user with a role to do certain operations, then he/she can do those operations in another domain or another project, in which he does not belong to.<br>So, i guess this can checked in the code. Lets use RBAC rules to check whether a person can run that query or not. Once RBAC says it is allowed, we can check whether an admin/super-user is running or a normal user is running that query.<br>If the user is admin, he can request for anything. If the user is a normal user, then we can check whether he is asking only for his domain or his project. If so, then only allow otherwise raise an error.<br></div></div></blockquote><div><br></div>This idea is great in principle, but “asking only for his domain or his project doesn’t make any sense in this case”. In nova objects are explicitly owned by a project. There is no way to determine of an object is part of a domain, so roles in that sense are non-functional. This is true across projects and is something tht needs to be addressed.</div><div><br><blockquote type="cite"><div ocsi="0" fpstyle="1" style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="direction: ltr; font-family: Tahoma; font-size: 10pt;"><br><u><b>Part 2: Quotas<br></b></u><br>I would also like to discuss with you about quotas.<span class="Apple-converted-space"> </span><br><br>As you know, the current quota system is de-centralized and the driver available in nova is "DbQuotaDriver", which allows to set quotas for a tenant and users in the tenant.<span class="Apple-converted-space"> </span><br>I could manage the quota driver to point to a new driver called "DomainQuotaDriver" (from Tiago Martins and team from HP) in nova code. I had built a test case in which i checked that a tenant quota cannot be greater than the domain quota in which the tenant is registered.Even, the sum of all tenant quotas cannot exceed their domain quota. In this, what is missing is the API's to operate the quotas for domains. I thought of creating these API's in V2 (as i could not find V3 APIs in nova). So, a new level called domain will be added to existing quota APIs. For example, the current API "<code class="code"><a class="code" href="http://docs.openstack.org/api/openstack-compute/2/content/GET_os-quota-sets-v2_showQuota_v2__tenant_id__os-quota-sets_ext-os-quota-sets.html" title="3.32.1. Show quotas">v2/{tenant_id}/os-quota-sets</a>"<span class="Apple-converted-space"> </span><font face="Tahoma">allows to see the quotas for a tenant.<span class="Apple-converted-space"> </span></font></code>Probably, this can be changed to "<code class="code"><a class="code" href="http://docs.openstack.org/api/openstack-compute/2/content/GET_os-quota-sets-v2_showQuota_v2__tenant_id__os-quota-sets_ext-os-quota-sets.html" title="3.32.1. Show quotas">v2/{domain_id}/{tenant_id}/os-quota-sets</a></code>" to see the quotas for a tenant in a domain.<span class="Apple-converted-space"> </span><br></div></div></blockquote><div><br></div>Again this makes sense in principle. We do have the domain in the request context from keystone. Unfortunately, once again there is no mapping of domain to object so there is no way to count the existing objects to determine how much has already been used.</div><div><br></div><div>If you can make the Hierarchical Ownership meeting tomorrow we will discuss adressing these and other issues so that we can at the very least have a prototype solution.</div><div><br></div><div>Vish<br><blockquote type="cite"><div ocsi="0" fpstyle="1" style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="direction: ltr; font-family: Tahoma; font-size: 10pt;"><br>I am currently trying to understand the nova-api code to see how and API mapping is done (through routes) and how an API calling is actually leading to a python function being called. Once i complete this, i am thinking of about these API's. Ideally implementation the extension of domain quotas in V3 APIs would have been good. But as i said i could not find any documentation about the Nova V3 APIs<br><br><br>I feel once we have Part 1 and Part 2, then quota delegation is not a big task. Because with RBAC rules, we can allow a user lets say with "tenant admin" role, can set the quotas for all the users in that tenant.<span class="Apple-converted-space"> </span><br><br><br>Please post your comments on this. Here at CERN we want to contribute to the quota management (earlier thought of centralized quota, but currently going with de-centralized quota with openstack services keeping the quota data).<span class="Apple-converted-space"> </span><br>I will wait for your comments to guide us or tell us how we can contribute..<br><br>Thanks & Regards,<br>Vinod Kumar Boppanna<br><br><br><br></div>_______________________________________________<br>OpenStack-dev mailing list<br><a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></div></blockquote></div><br></body></html>