-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] CLOUDSTACK-6276: project support in affinitygroups #508
Conversation
cloudstack-pull-requests #623 FAILURE |
cloudstack-pull-requests #624 FAILURE |
cloudstack-pull-requests #625 FAILURE |
cloudstack-pull-requests #626 FAILURE |
cloudstack-pull-requests #627 FAILURE |
cloudstack-pull-requests #645 FAILURE |
ping, any update on this? still WIP? |
hey @bhaisaab, still WIP. I ask for some help to finish it on the ML, because I will not have time to work on it the next months. |
I will check with @remibergsma / @DaanHoogland / @snuf if that's something we could get involved in. I'm okay with helping, as long as I have some time dedicated in our sprints. Would you have some more details on how far you are, @resmo ? Will it break existing functionality if we merge? If not and if I get the time, we can get it merge and I will continue from where you left. Cheers, |
Hi @wilderrodrigues that would be awesome! It is not supposed to break backward compatibility. In my opinion the functionality is implemented and should work, but I hadn't a change to really test it and the current tests are not green as well. So adding unit tests and looking at the current unit tests is needed. As it is my first serious work in cloudstack, don't hesitate to correct any mistake I made. :) |
Hi @resmo Can I then get your changes, from your PR, work on it and push via another PR? Would that be okay with you? If so, I think we could close this PR. What do you think? @bhaisaab @DaanHoogland your thoughts on that...? Cheers, |
@wilderrodrigues as long as you don't squash them and keep the attribution intact, i'm fine with that. otherwise you can also make pull requests to resmo's fork and let him add it to his PR |
@wilderrodrigues yes, please. Feel free. |
@wilderrodrigues did you take it over? can I close this PR? |
I will start on it this week, hopefully! Just keep the PR open, I will get it and create a PR on top of your with the tests. In this way we keep track of everything Cheers, |
@wilderrodrigues ok. thx! |
This closes apache#577 This closes apache#566 This closes apache#562 This closes apache#561 This closes apache#556 This closes apache#555 This closes apache#554 This closes apache#548 This closes apache#544 This closes apache#540 This closes apache#508 This closes apache#384 This closes apache#372
Hey @wilderrodrigues @resmo, I was looking to fixing this as well. Is there any way I can contribute? What is the status of this? Thanks, |
@pdube you can create a pull request on github when you finish the coding and testing. |
@ustcweizhou I have checked it out into another branch. I am working on it. And will create a PR when I am done. |
@ustcweizhou Also if you have a fix for it, why not port it forward? |
@pdube If you are almost done, I will wait for your PR. Otherwise, I can work on porting it. |
@ustcweizhou I am working on it now, but have a few questions about resource ownership |
try this change:
|
@ustcweizhou Is that actually necessary? |
Why is that access control done differently? |
@pdube normally it will check I guess you have modified the account of ag (when create an affinity group from project view) from account to project account of project, If not, the (3) will fail, sure. Do you need my help to fix the issues or test the changes ? |
@ustcweizhou Thanks for the response. I understand the code. I was wondering why there was a need for a special access checker for AffinityGroups. After more investigation, it seems like the DomainChecker explicitly fails for affinity groups, which seems a bit strange. |
@pdube By design, the AffinityGroupAccessChecked check the access for affinity groups. only the owner of the affinity group can use the ag, others (like domain admin) cannot. |
@ustcweizhou Does this mean that the root admin account cannot create a vm with an affinity group owned by a user? |
@pdube Affinity Group AffinityGroup[6f164261-99b7-4333-a9b4-0103888e9d94] does not belong to the VM's account |
CLOUDSTACK-6276 Fixing affinity groups for projectsWith some contributions from @resmo and @ustcweizhou. This closes apache/cloudstack#508 To test manually (need at least 2 hosts): Create a project Create an affinity group in that project Deploy a vm with that affinity group Deploy a second vm with that affinity group They should be on different hosts Ran old and new tests for affinity groups on the simulator Test create affinity group as admin in project ... === TestName: test_01_admin_create_aff_grp_for_project | Status : SUCCESS === ok Test create affinity group as domain admin for projects ... === TestName: test_02_doadmin_create_aff_grp_for_project | Status : SUCCESS === ok Test create affinity group as user for projects ... === TestName: test_03_user_create_aff_grp_for_project | Status : SUCCESS === ok Test create affinity group that exists (same name) for projects ... === TestName: test_4_user_create_aff_grp_existing_name_for_project | Status : SUCCESS === ok #Delete Affinity Group by id. ... === TestName: test_01_delete_aff_grp_by_id | Status : SUCCESS === ok #Delete Affinity Group by id should fail for user not in project ... === TestName: test_02_delete_aff_grp_by_id_another_user | Status : SUCCESS === ok test DeployVM in anti-affinity groups ... === TestName: test_01_deploy_vm_anti_affinity_group | Status : SUCCESS === ok test DeployVM in anti-affinity groups with more vms than hosts. ... === TestName: test_02_deploy_vm_anti_affinity_group_fail_on_not_enough_hosts | Status : SUCCESS === ok List affinity group for a vm for projects ... === TestName: test_01_list_aff_grps_for_vm | Status : SUCCESS === ok List multiple affinity groups associated with a vm for projects ... === TestName: test_02_list_multiple_aff_grps_for_vm | Status : SUCCESS === ok List affinity groups by id for projects ... === TestName: test_03_list_aff_grps_by_id | Status : SUCCESS === ok List Affinity Groups by name for projects ... === TestName: test_04_list_aff_grps_by_name | Status : SUCCESS === ok List Affinity Groups by non-existing id for projects ... === TestName: test_05_list_aff_grps_by_non_existing_id | Status : SUCCESS === ok List Affinity Groups by non-existing name for projects ... === TestName: test_06_list_aff_grps_by_non_existing_name | Status : SUCCESS === ok List affinity group should list all for a vms associated with that group for projects ... === TestName: test_07_list_all_vms_in_aff_grp | Status : SUCCESS === ok Update the list of affinityGroups by using affinity groupids ... === TestName: test_01_update_aff_grp_by_ids | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 16 tests in 581.706s OK Deploy vm as Admin in Affinity Group belonging to regular user (should fail) ... === TestName: test_01_deploy_vm_another_user | Status : SUCCESS === ok Create Affinity Group as admin for regular user ... === TestName: test_02_create_aff_grp_user | Status : SUCCESS === ok List Affinity Groups as admin for all the users ... === TestName: test_03_list_aff_grp_all_users | Status : SUCCESS === ok List Affinity Groups belonging to admin user ... === TestName: test_04_list_all_admin_aff_grp | Status : SUCCESS === ok List Affinity Groups belonging to regular user passing account id and domain id ... === TestName: test_05_list_all_users_aff_grp | Status : SUCCESS === ok List Affinity Groups belonging to regular user passing group id ... === TestName: test_06_list_all_users_aff_grp_by_id | Status : SUCCESS === ok Delete Affinity Group belonging to regular user ... === TestName: test_07_delete_aff_grp_of_other_user | Status : SUCCESS === ok Test create affinity group as admin ... === TestName: test_01_admin_create_aff_grp | Status : SUCCESS === ok Test create affinity group as domain admin ... === TestName: test_02_doadmin_create_aff_grp | Status : SUCCESS === ok Test create affinity group as user ... === TestName: test_03_user_create_aff_grp | Status : SUCCESS === ok Test create affinity group that exists (same name) ... === TestName: test_04_user_create_aff_grp_existing_name | Status : SUCCESS === ok Test create affinity group with existing name but within different account ... === TestName: test_05_create_aff_grp_same_name_diff_acc | Status : SUCCESS === ok Test create affinity group of non-existing type ... === TestName: test_06_create_aff_grp_nonexisting_type | Status : SUCCESS === ok Delete Affinity Group by name ... === TestName: test_01_delete_aff_grp_by_name | Status : SUCCESS === ok Delete Affinity Group as admin for an account ... === TestName: test_02_delete_aff_grp_for_acc | Status : SUCCESS === ok Delete Affinity Group which has vms in it ... === TestName: test_03_delete_aff_grp_with_vms | Status : SUCCESS === ok Delete Affinity Group with id which does not belong to this user ... === TestName: test_05_delete_aff_grp_id | Status : SUCCESS === ok Delete Affinity Group by name which does not belong to this user ... === TestName: test_06_delete_aff_grp_name | Status : SUCCESS === ok Delete Affinity Group by id. ... === TestName: test_08_delete_aff_grp_by_id | Status : SUCCESS === ok Root admin should be able to delete affinity group of other users ... === TestName: test_09_delete_aff_grp_root_admin | Status : SUCCESS === ok Deploy VM without affinity group ... === TestName: test_01_deploy_vm_without_aff_grp | Status : SUCCESS === ok Deploy VM by aff grp name ... === TestName: test_02_deploy_vm_by_aff_grp_name | Status : SUCCESS === ok Deploy VM by aff grp id ... === TestName: test_03_deploy_vm_by_aff_grp_id | Status : SUCCESS === ok test DeployVM in anti-affinity groups ... === TestName: test_04_deploy_vm_anti_affinity_group | Status : SUCCESS === ok Deploy vms by affinity group id ... === TestName: test_05_deploy_vm_by_id | Status : SUCCESS === ok Deploy vm in affinity group of another user by name ... === TestName: test_06_deploy_vm_aff_grp_of_other_user_by_name | Status : SUCCESS === ok Deploy vm in affinity group of another user by id ... === TestName: test_07_deploy_vm_aff_grp_of_other_user_by_id | Status : SUCCESS === ok Deploy vm in multiple affinity groups ... === TestName: test_08_deploy_vm_multiple_aff_grps | Status : SUCCESS === ok Deploy multiple vms in multiple affinity groups ... === TestName: test_09_deploy_vm_multiple_aff_grps | Status : SUCCESS === ok Deploy VM by aff grp name and id ... === TestName: test_10_deploy_vm_by_aff_grp_name_and_id | Status : SUCCESS === ok List affinity group for a vm ... === TestName: test_01_list_aff_grps_for_vm | Status : SUCCESS === ok List multiple affinity groups associated with a vm ... === TestName: test_02_list_multiple_aff_grps_for_vm | Status : SUCCESS === ok List affinity groups by id ... === TestName: test_03_list_aff_grps_by_id | Status : SUCCESS === ok List Affinity Groups by name ... === TestName: test_04_list_aff_grps_by_name | Status : SUCCESS === ok List Affinity Groups by non-existing id ... === TestName: test_05_list_aff_grps_by_non_existing_id | Status : SUCCESS === ok List Affinity Groups by non-existing name ... === TestName: test_06_list_aff_grps_by_non_existing_name | Status : SUCCESS === ok List affinity group should list all for a vms associated with that group ... === TestName: test_07_list_all_vms_in_aff_grp | Status : SUCCESS === ok Update the list of affinityGroups by using affinity groupids ... === TestName: test_01_update_aff_grp_by_ids | Status : SUCCESS === ok Update the list of affinityGroups by using affinity groupnames ... === TestName: test_02_update_aff_grp_by_names | Status : SUCCESS === ok Update the list of affinityGroups for vm which is not associated ... === TestName: test_03_update_aff_grp_for_vm_with_no_aff_grp | Status : SUCCESS === ok Update the list of Affinity Groups to empty list ... SKIP: Skip - Failing - work in progress Update the list of Affinity Groups on running vm ... === TestName: test_05_update_aff_grp_on_running_vm | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 42 tests in 976.432s OK (SKIP=1) * pr/1134: CLOUDSTACK-6276 Removing unused parameter in integration test for projects CLOUDSTACK-6276 Removing unused parameter in integration test CLOUDSTACK-6276 Fixing affinity groups for projects Signed-off-by: Remi Bergsma <github@remi.nl>
CLOUDSTACK-6276 Fixing affinity groups for projectsWith some contributions from @resmo and @ustcweizhou. This closes apache/cloudstack#508 To test manually (need at least 2 hosts): Create a project Create an affinity group in that project Deploy a vm with that affinity group Deploy a second vm with that affinity group They should be on different hosts Ran old and new tests for affinity groups on the simulator Test create affinity group as admin in project ... === TestName: test_01_admin_create_aff_grp_for_project | Status : SUCCESS === ok Test create affinity group as domain admin for projects ... === TestName: test_02_doadmin_create_aff_grp_for_project | Status : SUCCESS === ok Test create affinity group as user for projects ... === TestName: test_03_user_create_aff_grp_for_project | Status : SUCCESS === ok Test create affinity group that exists (same name) for projects ... === TestName: test_4_user_create_aff_grp_existing_name_for_project | Status : SUCCESS === ok #Delete Affinity Group by id. ... === TestName: test_01_delete_aff_grp_by_id | Status : SUCCESS === ok #Delete Affinity Group by id should fail for user not in project ... === TestName: test_02_delete_aff_grp_by_id_another_user | Status : SUCCESS === ok test DeployVM in anti-affinity groups ... === TestName: test_01_deploy_vm_anti_affinity_group | Status : SUCCESS === ok test DeployVM in anti-affinity groups with more vms than hosts. ... === TestName: test_02_deploy_vm_anti_affinity_group_fail_on_not_enough_hosts | Status : SUCCESS === ok List affinity group for a vm for projects ... === TestName: test_01_list_aff_grps_for_vm | Status : SUCCESS === ok List multiple affinity groups associated with a vm for projects ... === TestName: test_02_list_multiple_aff_grps_for_vm | Status : SUCCESS === ok List affinity groups by id for projects ... === TestName: test_03_list_aff_grps_by_id | Status : SUCCESS === ok List Affinity Groups by name for projects ... === TestName: test_04_list_aff_grps_by_name | Status : SUCCESS === ok List Affinity Groups by non-existing id for projects ... === TestName: test_05_list_aff_grps_by_non_existing_id | Status : SUCCESS === ok List Affinity Groups by non-existing name for projects ... === TestName: test_06_list_aff_grps_by_non_existing_name | Status : SUCCESS === ok List affinity group should list all for a vms associated with that group for projects ... === TestName: test_07_list_all_vms_in_aff_grp | Status : SUCCESS === ok Update the list of affinityGroups by using affinity groupids ... === TestName: test_01_update_aff_grp_by_ids | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 16 tests in 581.706s OK Deploy vm as Admin in Affinity Group belonging to regular user (should fail) ... === TestName: test_01_deploy_vm_another_user | Status : SUCCESS === ok Create Affinity Group as admin for regular user ... === TestName: test_02_create_aff_grp_user | Status : SUCCESS === ok List Affinity Groups as admin for all the users ... === TestName: test_03_list_aff_grp_all_users | Status : SUCCESS === ok List Affinity Groups belonging to admin user ... === TestName: test_04_list_all_admin_aff_grp | Status : SUCCESS === ok List Affinity Groups belonging to regular user passing account id and domain id ... === TestName: test_05_list_all_users_aff_grp | Status : SUCCESS === ok List Affinity Groups belonging to regular user passing group id ... === TestName: test_06_list_all_users_aff_grp_by_id | Status : SUCCESS === ok Delete Affinity Group belonging to regular user ... === TestName: test_07_delete_aff_grp_of_other_user | Status : SUCCESS === ok Test create affinity group as admin ... === TestName: test_01_admin_create_aff_grp | Status : SUCCESS === ok Test create affinity group as domain admin ... === TestName: test_02_doadmin_create_aff_grp | Status : SUCCESS === ok Test create affinity group as user ... === TestName: test_03_user_create_aff_grp | Status : SUCCESS === ok Test create affinity group that exists (same name) ... === TestName: test_04_user_create_aff_grp_existing_name | Status : SUCCESS === ok Test create affinity group with existing name but within different account ... === TestName: test_05_create_aff_grp_same_name_diff_acc | Status : SUCCESS === ok Test create affinity group of non-existing type ... === TestName: test_06_create_aff_grp_nonexisting_type | Status : SUCCESS === ok Delete Affinity Group by name ... === TestName: test_01_delete_aff_grp_by_name | Status : SUCCESS === ok Delete Affinity Group as admin for an account ... === TestName: test_02_delete_aff_grp_for_acc | Status : SUCCESS === ok Delete Affinity Group which has vms in it ... === TestName: test_03_delete_aff_grp_with_vms | Status : SUCCESS === ok Delete Affinity Group with id which does not belong to this user ... === TestName: test_05_delete_aff_grp_id | Status : SUCCESS === ok Delete Affinity Group by name which does not belong to this user ... === TestName: test_06_delete_aff_grp_name | Status : SUCCESS === ok Delete Affinity Group by id. ... === TestName: test_08_delete_aff_grp_by_id | Status : SUCCESS === ok Root admin should be able to delete affinity group of other users ... === TestName: test_09_delete_aff_grp_root_admin | Status : SUCCESS === ok Deploy VM without affinity group ... === TestName: test_01_deploy_vm_without_aff_grp | Status : SUCCESS === ok Deploy VM by aff grp name ... === TestName: test_02_deploy_vm_by_aff_grp_name | Status : SUCCESS === ok Deploy VM by aff grp id ... === TestName: test_03_deploy_vm_by_aff_grp_id | Status : SUCCESS === ok test DeployVM in anti-affinity groups ... === TestName: test_04_deploy_vm_anti_affinity_group | Status : SUCCESS === ok Deploy vms by affinity group id ... === TestName: test_05_deploy_vm_by_id | Status : SUCCESS === ok Deploy vm in affinity group of another user by name ... === TestName: test_06_deploy_vm_aff_grp_of_other_user_by_name | Status : SUCCESS === ok Deploy vm in affinity group of another user by id ... === TestName: test_07_deploy_vm_aff_grp_of_other_user_by_id | Status : SUCCESS === ok Deploy vm in multiple affinity groups ... === TestName: test_08_deploy_vm_multiple_aff_grps | Status : SUCCESS === ok Deploy multiple vms in multiple affinity groups ... === TestName: test_09_deploy_vm_multiple_aff_grps | Status : SUCCESS === ok Deploy VM by aff grp name and id ... === TestName: test_10_deploy_vm_by_aff_grp_name_and_id | Status : SUCCESS === ok List affinity group for a vm ... === TestName: test_01_list_aff_grps_for_vm | Status : SUCCESS === ok List multiple affinity groups associated with a vm ... === TestName: test_02_list_multiple_aff_grps_for_vm | Status : SUCCESS === ok List affinity groups by id ... === TestName: test_03_list_aff_grps_by_id | Status : SUCCESS === ok List Affinity Groups by name ... === TestName: test_04_list_aff_grps_by_name | Status : SUCCESS === ok List Affinity Groups by non-existing id ... === TestName: test_05_list_aff_grps_by_non_existing_id | Status : SUCCESS === ok List Affinity Groups by non-existing name ... === TestName: test_06_list_aff_grps_by_non_existing_name | Status : SUCCESS === ok List affinity group should list all for a vms associated with that group ... === TestName: test_07_list_all_vms_in_aff_grp | Status : SUCCESS === ok Update the list of affinityGroups by using affinity groupids ... === TestName: test_01_update_aff_grp_by_ids | Status : SUCCESS === ok Update the list of affinityGroups by using affinity groupnames ... === TestName: test_02_update_aff_grp_by_names | Status : SUCCESS === ok Update the list of affinityGroups for vm which is not associated ... === TestName: test_03_update_aff_grp_for_vm_with_no_aff_grp | Status : SUCCESS === ok Update the list of Affinity Groups to empty list ... SKIP: Skip - Failing - work in progress Update the list of Affinity Groups on running vm ... === TestName: test_05_update_aff_grp_on_running_vm | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 42 tests in 976.432s OK (SKIP=1) * pr/1134: CLOUDSTACK-6276 Removing unused parameter in integration test for projects CLOUDSTACK-6276 Removing unused parameter in integration test CLOUDSTACK-6276 Fixing affinity groups for projects Signed-off-by: Remi Bergsma <github@remi.nl>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
No description provided.