You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Sangeetha Hariharan (JIRA)" <ji...@apache.org> on 2013/06/27 00:26:19 UTC

[jira] [Closed] (CLOUDSTACK-2365) Anti-Affinity - As admin , we are allowed to deploy a Vm in an affinity group that belongs to different user.

     [ https://issues.apache.org/jira/browse/CLOUDSTACK-2365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sangeetha Hariharan closed CLOUDSTACK-2365.
-------------------------------------------


Tested with latest build:

As admin user , deploy a Vm for user "sangee" with the admin's affnity group.

This operation fails with following exception.
 

2013-06-26 15:13:31,296 INFO  [cloud.api.ApiServer] (catalina-exec-11:null) (userId=2 accountId=2 sessionId=3BCE1E27574D9BDC422B7E715F1F42FC) 10.217.252.50 -- GET comm
and=deployVirtualMachine&zoneId=c6fe9dd8-6b3f-4f4e-8f5c-1030b93208a6&templateId=59846444-d907-11e2-b5ac-06cba2000705&hypervisor=XenServer&serviceOfferingId=867cbef8-41
2c-47aa-88c7-b31b839422c6&affinitygroupids=098b2aa6-8178-46d5-83de-4dfd599e2757&networkIds=c8430423-4c16-4044-b4af-a913c498b62a&displayname=san-123&name=san-123&respon
se=json&sessionkey=DamJJwSfDWtv9pakJe5XUZochiw%3D&_=1372284460667&account=sangee&domainid=597abf5c-d907-11e2-b5ac-06cba2000705 531 Affinity Group AffinityGroup[098b2aa
6-8178-46d5-83de-4dfd599e2757] does not belong to the VM's account


As admin user , deploy a Vm another regular user's affinity group.

This operation fails with following exception.


2013-06-26 15:23:27,785 INFO  [cloud.api.ApiServer] (catalina-exec-13:null) (userId=2 accountId=2 sessionId=3BCE1E27574D9BDC422B7E715F1F42FC) 10.217.252.50 -- GET comm
and=deployVirtualMachine&zoneId=c6fe9dd8-6b3f-4f4e-8f5c-1030b93208a6&templateId=59846444-d907-11e2-b5ac-06cba2000705&hypervisor=XenServer&serviceOfferingId=867cbef8-41
2c-47aa-88c7-b31b839422c6&affinitygroupids=b88b81d8-f2e3-453e-b577-f34cbf7a3cbf&networkIds=41237015-183c-4e6b-846d-092abe2455ac&displayname=adm-123&name=adm-123&respon
se=json&sessionkey=DamJJwSfDWtv9pakJe5XUZochiw%3D&_=1372284460667 531 Affinity Group AffinityGroup[b88b81d8-f2e3-453e-b577-f34cbf7a3cbf] does not belong to the VM's ac
count


Closing this issue.
                
> Anti-Affinity - As admin , we are allowed   to deploy a Vm in an affinity group that belongs to different user. 
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-2365
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-2365
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Management Server
>    Affects Versions: 4.2.0
>         Environment: Build from master
>            Reporter: Sangeetha Hariharan
>            Assignee: Prachi Damle
>             Fix For: 4.2.0
>
>
> As admin , we are allowed   to deploy a Vm in an affinity group that belongs to different user. 
> Steps:
> As regular user , create affinity group ag1.
> As admin user ,  deploy a Vm using this  affinity group ag1.
> Vm deployment succeeds.
> Expected Behavior:
> Vm deployment should fail.
> 013-05-07 11:44:26,304 INFO  [cloud.api.ApiServer] (catalina-exec-12:null) (userId=2 accountId=2 sessionId=6F3F48589105D3E1EA2548B29C0CFC04) 10.217.252.128 -- GET command=deployVirtualMachine&zoneId=2b7cb385-5828-4945-a22b-6f0765620d05&templateId=360f4dbf-a4be-4879-8d58-ec123627dca9&hypervisor=KVM&serviceOfferingId=ad7d3b7c-0867-4987-a8e4-f3b6b3fa9a16&affinitygroupids=7376097f-1e14-4053-b448-5948b3bd47e3&networkIds=b38b80c4-76eb-4f92-8083-dc8b54913117&displayname=san-from-adm&name=san-from-adm&response=json&sessionkey=jSnZwpkO1OSiOiXsMXLMg43%2BFqg%3D 200 { "deployvirtualmachineresponse" : {"id":"97217fe1-a235-4130-87b4-a33f0141fce6","jobid":"ba337b91-0ed6-4780-a5ba-44310a6cd220"} }
> mysql> select name,id,uuid,account_id,domain_id,state from vm_instance where state !="Expunging" and type="User";
> +--------------+----+--------------------------------------+------------+-----------+---------+
> | name         | id | uuid                                 | account_id | domain_id | state   |
> +--------------+----+--------------------------------------+------------+-----------+---------+
> | sangee-af-1  | 48 | f694eeaf-d333-4799-b4d1-768fc3cd0541 |          2 |         1 | Running |
> | san-123      | 54 | 9dd4c65e-86d7-4afb-9260-110bd9d0901d |          4 |         1 | Running |
> | san-from-adm | 55 | 97217fe1-a235-4130-87b4-a33f0141fce6 |          2 |         1 | Running |
> +--------------+----+--------------------------------------+------------+-----------+---------+
> mysql> select * from affinity_group;
> +----+-------------+--------------------+--------------------------------------+-------------+-----------+------------+
> | id | name        | type               | uuid                                 | description | domain_id | account_id |
> +----+-------------+--------------------+--------------------------------------+-------------+-----------+------------+
> |  2 | webvms      | host anti-affinity | e167a488-693a-41a4-be30-d24545416e95 | NULL        |         1 |        196 |
> |  3 | test        | host anti-affinity | d7412237-300c-4d07-99f4-ed3b97909e86 | test        |         1 |          2 |
> |  5 | test3       | host anti-affinity | e88a5039-91f2-4539-a180-df9b8ba880e9 | test3       |         1 |          2 |
> |  9 | test-test1  | host anti-affinity | b91b96c4-545a-4c01-aa08-f1721f2b45cc | test-test1  |         1 |         91 |
> | 10 | test4       | host anti-affinity | 4b61e827-8901-42c1-8048-276fc3dbca35 | test4       |         1 |          2 |
> | 12 | testsangee  | host anti-affinity | 8ba39582-5004-4e77-a872-a5a4788c1371 | testsangee  |         1 |          4 |
> | 13 | testsangee1 | host anti-affinity | 6e1d3815-2783-4ae0-b567-50185cff2dac | testsangee1 |         1 |          4 |
> | 14 | testsan3    | host anti-affinity | 7376097f-1e14-4053-b448-5948b3bd47e3 | testsan3    |         1 |          4 |
> +----+-------------+--------------------+--------------------------------------+-------------+-----------+------------+
> 8 rows in set (0.00 sec)
> mysql> select * from affinity_group_vm_map;
> +----+-------------------+-------------+
> | id | affinity_group_id | instance_id |
> +----+-------------------+-------------+
> |  4 |                 5 |          48 |
> |  5 |                 3 |          48 |
> | 33 |                13 |          54 |
> | 34 |                12 |          54 |
> | 35 |                14 |          55 |
> +----+-------------------+-------------+
> 5 rows in set (0.00 sec)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira