Skip to content

Conversation

@vishesh92
Copy link
Member

@vishesh92 vishesh92 commented Apr 30, 2024

Description

Documentation PR: apache/cloudstack-documentation#398

Currently, an administrator can break host tag compatibility for a VM administrator by certain operations:

  • deploy/start VM on a specific host
  • migrate VM
  • restore VM
  • scale VM

This PR allows the user to specify tags which must be checked during these operations.

Global Settings

  1. vm.strict.host.tags - A comma-separated list of tags for strict host check (Default - empty)
  2. vm.strict.resource.limit.host.tag.check - Determines whether the resource limits tags are considered strict or not (Default - true)

During the above operations, we now check and throw an error if host tags compatibility is being broken for tags specified in vm.strict.host.tags. If vm.strict.resource.limit.host.tag.check is set to true, tags set in resource.limit.host.tags are also checked during these operations.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

How Has This Been Tested?

Manually tested

How did you try to break this feature and the system with this change?

@codecov-commenter
Copy link

codecov-commenter commented Apr 30, 2024

Codecov Report

Attention: Patch coverage is 62.66667% with 28 lines in your changes missing coverage. Please review.

Project coverage is 15.28%. Comparing base (19f9635) to head (73d6888).
Report is 103 commits behind head on main.

Files Patch % Lines
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 47.05% 18 Missing ⚠️
...rver/src/main/java/com/cloud/vm/UserVmManager.java 63.63% 2 Missing and 2 partials ⚠️
...ne/schema/src/main/java/com/cloud/host/HostVO.java 88.88% 0 Missing and 3 partials ⚠️
...om/cloud/deploy/DeploymentPlanningManagerImpl.java 0.00% 1 Missing and 1 partial ⚠️
.../apache/cloudstack/vm/UnmanagedVMsManagerImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               main    #9017    +/-   ##
==========================================
  Coverage     15.28%   15.28%            
- Complexity    11535    11542     +7     
==========================================
  Files          5424     5424            
  Lines        474334   474390    +56     
  Branches      60970    61603   +633     
==========================================
+ Hits          72498    72524    +26     
- Misses       393778   393810    +32     
+ Partials       8058     8056     -2     
Flag Coverage Δ
uitests 4.25% <ø> (ø)
unittests 16.02% <62.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vishesh92 vishesh92 force-pushed the enforce-strict-host-tag-check branch from 5e42531 to 3c53cf4 Compare April 30, 2024 20:46
@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9491

@vishesh92
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@vishesh92 a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9507

@vishesh92
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@vishesh92 a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-10102)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 47445 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9017-t10102-kvm-centos7.zip
Smoke tests completed. 128 look OK, 4 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 426.75 test_events_resource.py
test_01_restore_vm Error 0.25 test_restore_vm.py
test_02_restore_vm_allocated_root Error 0.15 test_restore_vm.py
ContextSuite context=TestRestoreVM>:teardown Error 1.35 test_restore_vm.py
test_02_trigger_shutdown Failure 346.70 test_safe_shutdown.py
test_02_restore_vm_strict_tags_failure Failure 41.64 test_vm_strict_host_tags.py
test_02_scale_vm_strict_tags_failure Failure 44.85 test_vm_strict_host_tags.py
test_06_deploy_vm_on_any_host_with_strict_tags_failure Failure 1.30 test_vm_strict_host_tags.py
ContextSuite context=TestVMDeploymentPlannerStrictTags>:teardown Error 53.96 test_vm_strict_host_tags.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-10124)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 52549 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9017-t10124-kvm-centos7.zip
Smoke tests completed. 127 look OK, 5 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 428.10 test_events_resource.py
test_01_restore_vm Error 0.24 test_restore_vm.py
test_02_restore_vm_allocated_root Error 0.14 test_restore_vm.py
ContextSuite context=TestRestoreVM>:teardown Error 1.23 test_restore_vm.py
test_02_list_cpvm_vm Failure 0.05 test_ssvm.py
test_04_cpvm_internals Failure 0.04 test_ssvm.py
test_01_secure_vm_migration Error 135.30 test_vm_life_cycle.py
test_01_secure_vm_migration Error 135.31 test_vm_life_cycle.py
test_02_restore_vm_strict_tags_failure Failure 46.75 test_vm_strict_host_tags.py
test_02_scale_vm_strict_tags_failure Failure 51.04 test_vm_strict_host_tags.py
test_06_deploy_vm_on_any_host_with_strict_tags_failure Failure 1.31 test_vm_strict_host_tags.py
ContextSuite context=TestVMDeploymentPlannerStrictTags>:teardown Error 77.52 test_vm_strict_host_tags.py

@vishesh92 vishesh92 force-pushed the enforce-strict-host-tag-check branch from a1091b0 to 8769a93 Compare May 2, 2024 12:54
@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9517

@vishesh92
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@vishesh92 a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-10146)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 49258 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9017-t10146-kvm-centos7.zip
Smoke tests completed. 129 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 437.35 test_events_resource.py
test_01_restore_vm Error 0.21 test_restore_vm.py
test_02_restore_vm_allocated_root Error 0.14 test_restore_vm.py
ContextSuite context=TestRestoreVM>:teardown Error 1.23 test_restore_vm.py
ContextSuite context=TestVMDeploymentPlannerStrictTags>:teardown Error 59.13 test_vm_strict_host_tags.py

@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9532

@vishesh92
Copy link
Member Author

@blueorangutan test

@vishesh92
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@vishesh92 a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-10182)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 48103 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9017-t10182-kvm-centos7.zip
Smoke tests completed. 131 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 428.02 test_events_resource.py

@github-actions
Copy link

github-actions bot commented May 8, 2024

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9647

@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@vladimirpetrov
Copy link
Contributor

@blueorangutan test matrix

@blueorangutan
Copy link

@vladimirpetrov a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9811

@blueorangutan
Copy link

[SF] Trillian test result (tid-10388)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 46016 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9017-t10388-kvm-centos7.zip
Smoke tests completed. 133 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link

[SF] Trillian test result (tid-10386)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 47326 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9017-t10386-xenserver-71.zip
Smoke tests completed. 133 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link

[SF] Trillian test result (tid-10387)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8
Total time taken: 50026 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9017-t10387-vmware-67u3.zip
Smoke tests completed. 131 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_balanced_drs_algorithm Error 424.56 test_cluster_drs.py
test_02_restore_vm_with_disk_offering Error 57.29 test_restore_vm.py
test_03_restore_vm_with_disk_offering_custom_size Error 58.21 test_restore_vm.py

@vladimirpetrov vladimirpetrov self-assigned this Jun 10, 2024
Copy link
Contributor

@vladimirpetrov vladimirpetrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM based on manual testing. Tested deployment, start/stop, migration with and without storage, reinstal and scaling to another template with and without strict host tagging.

@rohityadavcloud
Copy link
Member

Merging based on manual QA, review and smoketests.

@rohityadavcloud rohityadavcloud marked this pull request as ready for review June 25, 2024 09:10
@rohityadavcloud rohityadavcloud merged commit f6ceeab into apache:main Jun 25, 2024
@rohityadavcloud rohityadavcloud deleted the enforce-strict-host-tag-check branch June 25, 2024 09:12
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jul 2, 2024
Documentation PR: apache/cloudstack-documentation#398

Currently, an administrator can break host tag compatibility for a VM administrator by certain operations:
* deploy/start VM on a specific host
* migrate VM
* restore VM
* scale VM

This PR allows the user to specify tags which must be checked during these operations.

Global Settings
1. `vm.strict.host.tags` - A comma-separated list of tags for strict host check (Default - empty)
2. `vm.strict.resource.limit.host.tag.check` - Determines whether the resource limits tags are considered strict or not (Default - true)

During the above operations, we now check and throw an error if host tags compatibility is being broken for tags specified in `vm.strict.host.tags`. If `vm.strict.resource.limit.host.tag.check` is set to `true`, tags set in `resource.limit.host.tags` are also checked during these operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants