Skip to content

Resize volume: add pool capacity disablethreshold for resize and allow volume auto migration - #9761

Merged
yadvr merged 8 commits into
apache:4.20from
weizhouapache:4.20-resize-volume-threshold-automigrate
Dec 2, 2024
Merged

Resize volume: add pool capacity disablethreshold for resize and allow volume auto migration#9761
yadvr merged 8 commits into
apache:4.20from
weizhouapache:4.20-resize-volume-threshold-automigrate

Conversation

@weizhouapache

Copy link
Copy Markdown
Member

Description

Currently, when resize a volume, ACS checks if the current storage pool can accommodate the new size, and simply return true if pool has enough capacity, or false if there are not enough capacity.

This PR

  • add global and zone setting volume.resize.allowed.beyond.allocation and pool.storage.allocated.resize.capacity.disablethreshold
  • add API parameter automigrate to resizeVolume API.

when resize a volume

  • check if the pool capacity (with new volume size) is above disable threshold pool.storage.allocated.capacity.disablethreshold
  • if pool capacity is below disable threshold, operation succeeds.
  • if pool capacity is above disable threshold
    • if volume.resize.allowed.beyond.allocation is false, go to migration step
    • if volume.resize.allowed.beyond.allocation is true, it will check pool capacity for resize threshold pool.storage.allocated.resize.capacity.disablethreshold.
      • if yes, operation succeeds.
      • if not, go to migration step
  • migrate volume to another pool
    • find storage pools by tags, storage types, pool allocation capacity (consider current volume size), and etc
    • filter storage pool by resize capacity threshold (consider new volume size)
    • if no pool found, operation fails.
    • if automigrate is false, operation fails
    • if automigrate is true, try to migrate volume to another pool
      • if migration succeeds (for example vm is stopped), operation succeeds
      • if migration fails (for example vm is running on KVM), operation succeeds

prior to this change
Apple-issue-299- resize-volume-Page-2

With this change
Apple-issue-299- resize-volume-Page-1 drawio

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
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

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

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache 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.

@codecov

codecovBot commented Oct 3, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 50.76923% with 32 lines in your changes missing coverage. Please review.

Project coverage is 15.91%. Comparing base (046870e) to head (e92f38e).
Report is 72 commits behind head on 4.20.

Files with missing linesPatch %Lines
...n/java/com/cloud/storage/VolumeApiServiceImpl.java40.00%19 Missing and 8 partials ⚠️
...ain/java/com/cloud/storage/StorageManagerImpl.java78.57%3 Missing ⚠️
...stack/api/command/user/volume/ResizeVolumeCmd.java33.33%2 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## 4.20 #9761 +/- ##
============================================
+ Coverage 15.78% 15.91% +0.12% - Complexity 12552 12722 +170 
============================================
Files 5625 5627 +2 Lines 491972 499027 +7055 Branches 63764 63574 -190 ============================================
+ Hits 77664 79425 +1761 - Misses 405849 410931 +5082 - Partials 8459 8671 +212 
FlagCoverage Δ
uitests4.04% <ø> (+<0.01%)⬆️
unittests16.73% <50.76%> (+0.12%)⬆️

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.

@blueorangutan

Copy link
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache 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
Copy Markdown

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

TestResultTime (s)Test File
all_test_deploy_vmSkipped---test_deploy_vm.py
all_test_escalations_templatesSkipped---test_escalations_templates.py
all_test_vm_haSkipped---test_vm_ha.py
all_test_vm_syncSkipped---test_vm_sync.py
all_test_accountsSkipped---test_accounts.py
all_test_affinity_groups_projectsSkipped---test_affinity_groups_projects.py
all_test_affinity_groupsSkipped---test_affinity_groups.py
all_test_async_jobSkipped---test_async_job.py
all_test_certauthority_rootSkipped---test_certauthority_root.py
all_test_create_list_domain_account_projectSkipped---test_create_list_domain_account_project.py
all_test_deploy_vgpu_enabled_vmSkipped---test_deploy_vgpu_enabled_vm.py
all_test_deploy_virtio_scsi_vmSkipped---test_deploy_virtio_scsi_vm.py
all_test_deploy_vm_isoSkipped---test_deploy_vm_iso.py
all_test_deploy_vm_root_resizeSkipped---test_deploy_vm_root_resize.py
all_test_deploy_vms_with_varied_deploymentplannersSkipped---test_deploy_vms_with_varied_deploymentplanners.py
all_test_deploy_vm_with_userdataSkipped---test_deploy_vm_with_userdata.py
all_test_diagnosticsSkipped---test_diagnostics.py
all_test_direct_downloadSkipped---test_direct_download.py
all_test_disk_offeringsSkipped---test_disk_offerings.py
all_test_domain_disk_offeringsSkipped---test_domain_disk_offerings.py
all_test_domain_network_offeringsSkipped---test_domain_network_offerings.py
all_test_domain_service_offeringsSkipped---test_domain_service_offerings.py
all_test_domain_vpc_offeringsSkipped---test_domain_vpc_offerings.py
all_test_dynamicrolesSkipped---test_dynamicroles.py
all_test_global_settingsSkipped---test_global_settings.py
all_test_guest_vlan_rangeSkipped---test_guest_vlan_range.py
all_test_host_annotationsSkipped---test_host_annotations.py
all_test_hostha_simulatorSkipped---test_hostha_simulator.py
all_test_internal_lbSkipped---test_internal_lb.py
all_test_isoSkipped---test_iso.py
all_test_list_ids_parameterSkipped---test_list_ids_parameter.py
all_test_loadbalanceSkipped---test_loadbalance.py
all_test_loginSkipped---test_login.py
all_test_metrics_apiSkipped---test_metrics_api.py
all_test_migrationSkipped---test_migration.py
all_test_multipleips_per_nicSkipped---test_multipleips_per_nic.py
all_test_nested_virtualizationSkipped---test_nested_virtualization.py
all_test_network_aclSkipped---test_network_acl.py
all_test_networkSkipped---test_network.py
all_test_nic_adapter_typeSkipped---test_nic_adapter_type.py
all_test_nicSkipped---test_nic.py
all_test_non_contigiousvlanSkipped---test_non_contigiousvlan.py
all_test_outofbandmanagement_nestedpluginSkipped---test_outofbandmanagement_nestedplugin.py
all_test_outofbandmanagementSkipped---test_outofbandmanagement.py
all_test_over_provisioningSkipped---test_over_provisioning.py
all_test_password_serverSkipped---test_password_server.py
all_test_portable_publicipSkipped---test_portable_publicip.py
all_test_portforwardingrulesSkipped---test_portforwardingrules.py
all_test_primary_storageSkipped---test_primary_storage.py
all_test_privategw_aclSkipped---test_privategw_acl.py
all_test_projectsSkipped---test_projects.py
all_test_public_ip_rangeSkipped---test_public_ip_range.py
all_test_pvlanSkipped---test_pvlan.py
all_test_regionsSkipped---test_regions.py
all_test_reset_vm_on_rebootSkipped---test_reset_vm_on_reboot.py
all_test_resource_accountingSkipped---test_resource_accounting.py
all_test_resource_detailSkipped---test_resource_detail.py
all_test_router_dhcphostsSkipped---test_router_dhcphosts.py
all_test_router_dnsSkipped---test_router_dns.py
all_test_router_dnsserviceSkipped---test_router_dnsservice.py
all_test_routers_iptables_default_policySkipped---test_routers_iptables_default_policy.py
all_test_routers_network_opsSkipped---test_routers_network_ops.py
all_test_routersSkipped---test_routers.py
all_test_scale_vmSkipped---test_scale_vm.py
all_test_secondary_storageSkipped---test_secondary_storage.py
all_test_service_offeringsSkipped---test_service_offerings.py
all_test_snapshotsSkipped---test_snapshots.py
all_test_ssvmSkipped---test_ssvm.py
all_test_staticrolesSkipped---test_staticroles.py
all_test_templatesSkipped---test_templates.py
all_test_usage_eventsSkipped---test_usage_events.py
all_test_usageSkipped---test_usage.py
all_test_vm_deployment_plannerSkipped---test_vm_deployment_planner.py
all_test_vm_life_cycleSkipped---test_vm_life_cycle.py
all_test_vm_snapshotsSkipped---test_vm_snapshots.py
all_test_volumesSkipped---test_volumes.py
all_test_vpc_redundantSkipped---test_vpc_redundant.py
all_test_vpc_router_nicsSkipped---test_vpc_router_nics.py
all_test_vpc_vpnSkipped---test_vpc_vpn.py
all_test_host_maintenanceSkipped---test_host_maintenance.py
all_test_hostha_kvmSkipped---test_hostha_kvm.py

@sureshanapartisureshanaparti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clgtm

@blueorangutan

Copy link
Copy Markdown

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

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

TestResultTime (s)Test File
test_01_secure_vm_migrationError377.75test_vm_life_cycle.py

@blueorangutan

Copy link
Copy Markdown

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

TestResultTime (s)Test File
test_01_secure_vm_migrationError134.20test_vm_life_cycle.py
test_01_secure_vm_migrationError134.21test_vm_life_cycle.py
test_04_deploy_vnf_applianceError477.32test_vnf_templates.py
test_04_deploy_vnf_applianceError477.32test_vnf_templates.py
test_05_delete_vnf_templateError1.22test_vnf_templates.py
ContextSuite context=TestVnfTemplates>:teardownError1.43test_vnf_templates.py

@blueorangutan

Copy link
Copy Markdown

@weizhouapache 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
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache 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
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-11811)

@JoaoJandre

Copy link
Copy Markdown
Contributor

@weizhouapache does the migration take flexible tags into account (not only normal tags)?

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@weizhouapache does the migration take flexible tags into account (not only normal tags)?

To be frank, I have not tested flexible tags.
This PR calls an existing method listStoragePoolsForSystemMigrationOfVolume to list suitable storage pools.

If there are some issues with the method, we can fix it in a separated PR.

@yadvr

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud 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.

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache 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
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@JoaoJandre

Copy link
Copy Markdown
Contributor

@weizhouapache does the migration take flexible tags into account (not only normal tags)?

To be frank, I have not tested flexible tags. This PR calls an existing method listStoragePoolsForSystemMigrationOfVolume to list suitable storage pools.

If there are some issues with the method, we can fix it in a separated PR.

@weizhouapache from what I have gathered reviewing the code. If the volume is attached to a running VM, flexible tags will be considered. Otherwise not... This should be fixed.

@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@weizhouapache from what I have gathered reviewing the code. If the volume is attached to a running VM, flexible tags will be considered. Otherwise not... This should be fixed.

@JoaoJandre
thanks for looking into it. Agree it should be fixed.

since you are the author of flexible tags (PR #7489), could you please have a look ?
I am not familiar with flexible tags.

@blueorangutan

Copy link
Copy Markdown

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

TestResultTime (s)Test File
test_01_secure_vm_migrationError134.14test_vm_life_cycle.py
test_01_secure_vm_migrationError134.15test_vm_life_cycle.py

@yadvr
yadvr merged commit 8a1da38 into apache:4.20Dec 2, 2024
@DaanHoogland
DaanHoogland deleted the 4.20-resize-volume-threshold-automigrate branch December 2, 2024 07:55
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Dec 12, 2024
…w volume auto migration (apache#9761)
* server: add global settings for volume resize
* resizeVolume: support automigrate
* Address Suresh's comments
* Update api/src/main/java/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
* address Suresh's comments
* UI: add autoMigrate to resizeVolume
* resizevolume: add unit tests
* resizevolume: add unit test for Allocated volume
---------
Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
@Pearl1594Pearl1594 moved this to Done in ACS 4.20.1Mar 17, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants

@weizhouapache@blueorangutan@sureshanaparti@yadvr@JoaoJandre@borisstoyanov@Pearl1594