Skip to content

Secondary Storage Usage Improvements#4053

Merged
yadvr merged 56 commits into
apache:masterfrom
shapeblue:SecStgMgmt
Sep 17, 2020
Merged

Secondary Storage Usage Improvements#4053
yadvr merged 56 commits into
apache:masterfrom
shapeblue:SecStgMgmt

Conversation

@Pearl1594
Copy link
Copy Markdown
Contributor

@Pearl1594 Pearl1594 commented May 4, 2020

Description

This feature enables the following:

  • Balanced migration of data objects from source Image store to destination Image store(s)
  • Complete migration of data
  • setting an image store to read-only
  • viewing download progress of templates across all data stores

Related Primate PR: apache/cloudstack-primate#326

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)

@yadvr yadvr added this to the 4.15.0.0 milestone May 5, 2020
@Pearl1594 Pearl1594 changed the title Secondary Storage Management Secondary Storage Usage Improvement May 8, 2020
@DaanHoogland DaanHoogland changed the title Secondary Storage Usage Improvement Secondary Storage Usage Improvements May 8, 2020
Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

some intermediate comments. no blockers and not done with the full review.

Comment thread api/src/main/java/org/apache/cloudstack/api/ApiConstants.java Outdated
Comment thread api/src/main/java/com/cloud/storage/ImageStoreService.java Outdated
Comment on lines +173 to +174
@Override
public MigrationResponse migrateData(Long srcDataStoreId, List<Long> destDatastores, MigrationPolicy migrationPolicy) {
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.

this method is way too long. please modularise it into byte size chunks and factor it out to a worker - or utility class?
I can not set a rule but in my opinion any method larger than 20 line or any class larger than 300 lines is probably not separating concerns.
every comment in this method should probably be converted to a good method name and extracted, and so should many top level blocks (if-, for- and while statements

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created a utility class

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.

It is still 112 lines and there are a lot of comments in it that could serve as method names. This would help make the code more prozaic and thus easier to read. This method could do with some modularisation.

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.

75 lines, still big but i slowly get the picture ;)

@Pearl1594 Pearl1594 requested a review from DaanHoogland May 18, 2020 06:53
@apache apache deleted a comment from blueorangutan May 18, 2020
Comment on lines +173 to +174
@Override
public MigrationResponse migrateData(Long srcDataStoreId, List<Long> destDatastores, MigrationPolicy migrationPolicy) {
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.

It is still 112 lines and there are a lot of comments in it that could serve as method names. This would help make the code more prozaic and thus easier to read. This method could do with some modularisation.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos7 ✖centos8 ✖debian. JID-1990

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 14, 2020

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-1993

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 14, 2020

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-2733)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 70668 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4053-t2733-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 81 look OK, 4 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_03_vpc_privategw_restart_vpc_cleanup Failure 358.67 test_privategw_acl.py
test_04_rvpc_privategw_static_routes Failure 563.47 test_privategw_acl.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 450.45 test_vpc_redundant.py
test_02_redundant_VPC_default_routes Failure 447.19 test_vpc_redundant.py
test_01_redundant_vpc_site2site_vpn Failure 737.25 test_vpc_vpn.py
test_01_vpc_site2site_vpn_multiple_options Error 695.53 test_vpc_vpn.py
test_01_vpc_site2site_vpn Failure 465.04 test_vpc_vpn.py
test_hostha_enable_ha_when_host_disabled Error 1.58 test_hostha_kvm.py
test_hostha_enable_ha_when_host_in_maintenance Error 301.71 test_hostha_kvm.py

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 15, 2020

Tests LGTM, I checked all are intermittent failures.

@Pearl1594
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2016

@Pearl1594
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

Comment thread test.sh Outdated
@@ -0,0 +1 @@
cks
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Pearl1594 can you remove this file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 16, 2020

@Pearl1594 pl advise if/when this is ready for merge, thnx

@Pearl1594
Copy link
Copy Markdown
Contributor Author

@rhtyd post this round of smoke test, the PR will be ready for merging

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-2753)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 67152 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4053-t2753-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_domain_vpc_offerings.py
Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
Intermittent failure detected: /marvin/tests/smoke/test_iso.py
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_supported_versions.py
Intermittent failure detected: /marvin/tests/smoke/test_password_server.py
Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_host_maintenance.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 80 look OK, 5 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_04_extract_Iso Failure 128.37 test_iso.py
test_01_add_delete_kubernetes_supported_version Error 1812.30 test_kubernetes_supported_versions.py
test_02_vpc_privategw_static_routes Failure 218.84 test_privategw_acl.py
test_03_vpc_privategw_restart_vpc_cleanup Failure 207.93 test_privategw_acl.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Error 583.06 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Failure 476.67 test_vpc_redundant.py
test_hostha_kvm_host_fencing Error 163.16 test_hostha_kvm.py

@Pearl1594
Copy link
Copy Markdown
Contributor Author

@rhtyd - ready to merge - test failures seem unrelated to this PR

@yadvr yadvr merged commit b464fe4 into apache:master Sep 17, 2020
@@ -53,6 +53,33 @@ ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `backup_offering_id` bigint unsigne
ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `backup_external_id` varchar(255) DEFAULT NULL COMMENT 'ID of external backup job or container if any';
ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `backup_volumes` text DEFAULT NULL COMMENT 'details of backedup volumes';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This schema change has to be moved to schema-41400to41500.sql.
@Pearl1594 please raise a separate PR as this is already merged.

@Pearl1594 Pearl1594 mentioned this pull request Nov 17, 2020
12 tasks
weizhouapache pushed a commit to apache/cloudstack-primate that referenced this pull request Jan 19, 2021
Enable migration of data between secondary storage pools - addresses feature: apache/cloudstack#4053
yadvr pushed a commit that referenced this pull request Jan 20, 2021
Enable migration of data between secondary storage pools - addresses feature: #4053

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
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.

9 participants