cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Fix exceeding of resource limits with powerflex

Open vishesh92 opened this issue 9 months ago • 16 comments

Description

Because we have the condition that a powerflex/scaleio volume can be a size /8 the user can exploit this and request a smaller number without exceeding the limit, but eventually PF will deploy a volume of size [req-size ]< and /8, thus allowing the user to break the limit

STEPS TO REPRODUCE

  1. Set a tag limit of 6GB
  2. Deploy a volume with the offering of the tag limit and override the size to '5'
  3. Cloudstack will consider correctly that request is within the tag limit 5<6, but will eventually deploy a volume with 8 GB exceeding the limit
  4. After syncing resource counts this the error becomes evident. image

Types of changes

  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] New feature (non-breaking change which adds functionality)
  • [x] 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
  • [x] Minor

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [ ] Major
  • [x] Minor
  • [ ] Trivial

Screenshots (if appropriate):

How Has This Been Tested?

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

vishesh92 avatar Apr 30 '24 10:04 vishesh92

@blueorangutan package

vishesh92 avatar Apr 30 '24 10:04 vishesh92

Codecov Report

Attention: Patch coverage is 11.11111% with 96 lines in your changes are missing coverage. Please review.

Project coverage is 15.28%. Comparing base (e9ff270) to head (09f188e).

:exclamation: Current head 09f188e differs from pull request most recent head f9e96af. Consider uploading reports for the commit f9e96af to get more accurate results

Files Patch % Lines
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 12.00% 35 Missing and 9 partials :warning:
...stack/engine/orchestration/VolumeOrchestrator.java 0.00% 26 Missing :warning:
...n/java/com/cloud/storage/VolumeApiServiceImpl.java 0.00% 11 Missing :warning:
.../cloud/resourcelimit/ResourceLimitManagerImpl.java 0.00% 10 Missing :warning:
.../subsystem/api/storage/PrimaryDataStoreDriver.java 0.00% 3 Missing :warning:
...n/java/com/cloud/vm/VirtualMachineManagerImpl.java 0.00% 1 Missing :warning:
...atastore/driver/ScaleIOPrimaryDataStoreDriver.java 85.71% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##              main    #9008       +/-   ##
============================================
+ Coverage     4.26%   15.28%   +11.01%     
- Complexity       0    11528    +11528     
============================================
  Files          363     5425     +5062     
  Lines        29565   474074   +444509     
  Branches      5190    61618    +56428     
============================================
+ Hits          1262    72462    +71200     
- Misses       28160   393553   +365393     
- Partials       143     8059     +7916     
Flag Coverage Δ
uitests 4.26% <ø> (ø)
unittests 16.01% <11.11%> (?)

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 30 '24 10:04 codecov-commenter

@blueorangutan package

sureshanaparti avatar Apr 30 '24 13:04 sureshanaparti

@sureshanaparti 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 avatar Apr 30 '24 13:04 blueorangutan

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

blueorangutan avatar Apr 30 '24 14:04 blueorangutan

@blueorangutan test

vishesh92 avatar Apr 30 '24 16:04 vishesh92

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

blueorangutan avatar Apr 30 '24 16:04 blueorangutan

@blueorangutan package

vishesh92 avatar May 01 '24 06:05 vishesh92

@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 avatar May 01 '24 06:05 blueorangutan

[SF] Trillian test result (tid-10100) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 51007 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9008-t10100-kvm-centos7.zip Smoke tests completed. 126 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 435.40 test_events_resource.py
test_create_pvlan_network Error 0.07 test_pvlan.py
test_01_restore_vm Error 0.20 test_restore_vm.py
test_02_restore_vm_with_disk_offering Error 0.14 test_restore_vm.py
test_03_restore_vm_with_disk_offering_custom_size Error 0.14 test_restore_vm.py
test_04_restore_vm_allocated_root Error 0.14 test_restore_vm.py
ContextSuite context=TestRestoreVM>:teardown Error 1.24 test_restore_vm.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 390.50 test_vpc_redundant.py
test_01_redundant_vpc_site2site_vpn Failure 442.61 test_vpc_vpn.py

blueorangutan avatar May 01 '24 06:05 blueorangutan

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

blueorangutan avatar May 01 '24 07:05 blueorangutan

@blueorangutan test

vishesh92 avatar May 02 '24 13:05 vishesh92

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

blueorangutan avatar May 02 '24 13:05 blueorangutan

[SF] Trillian Build Failed (tid-10140)

blueorangutan avatar May 02 '24 13:05 blueorangutan

@blueorangutan test

vishesh92 avatar May 02 '24 19:05 vishesh92

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

blueorangutan avatar May 02 '24 19:05 blueorangutan

[SF] Trillian test result (tid-10148) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 53386 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9008-t10148-kvm-centos7.zip Smoke tests completed. 127 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 432.41 test_events_resource.py
ContextSuite context=TestRestoreVM>:setup Error 0.00 test_restore_vm.py
test_02_trigger_shutdown Failure 346.72 test_safe_shutdown.py
test_02_list_cpvm_vm Failure 0.05 test_ssvm.py
test_04_cpvm_internals Failure 0.05 test_ssvm.py
test_12_destroy_cpvm Error 3.19 test_ssvm.py

blueorangutan avatar May 03 '24 11:05 blueorangutan

@blueorangutan package

vishesh92 avatar May 07 '24 05:05 vishesh92

@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 avatar May 07 '24 05:05 blueorangutan

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

blueorangutan avatar May 07 '24 06:05 blueorangutan

@blueorangutan package

vishesh92 avatar May 07 '24 07:05 vishesh92

@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 avatar May 07 '24 07:05 blueorangutan

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

blueorangutan avatar May 07 '24 09:05 blueorangutan

@blueorangutan test keepEnv

borisstoyanov avatar May 07 '24 09:05 borisstoyanov

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

blueorangutan avatar May 07 '24 09:05 blueorangutan

[SF] Trillian test result (tid-10180) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 51401 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9008-t10180-kvm-centos7.zip Smoke tests completed. 130 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 418.47 test_events_resource.py

blueorangutan avatar May 08 '24 00:05 blueorangutan