Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[CLOUDSTACK-10323] Allow changing disk offering during volume migration #2486

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

Merged
merged 5 commits into from
Apr 26, 2018

Conversation

rafaelweingartner
Copy link
Member

@rafaelweingartner rafaelweingartner commented Mar 14, 2018

This is a continuation of work developed on PR #2425 (CLOUDSTACK-10240), which provided root admins an override mechanism to move volumes between storage systems types (local/shared) even when the disk offering would not allow such operation. To complete the work, we will now provide a way for administrators to enter a new disk offering that can reflect the new placement of the volume. We will add an extra parameter to allow the root admin inform a new disk offering for the volume. Therefore, when the volume is being migrated, it will be possible to replace the disk offering to reflect the new placement of the volume.

The API method will have the following parameters:

  • storageid (required)
  • volumeid (required)
  • livemigrate(optional)
  • newdiskofferingid (optional) – this is the new parameter

The expected behavior is the following:

  • If “newdiskofferingid” is not provided the current behavior is maintained. Override mechanism will also keep working as we have seen so far.
  • If the “newdiskofferingid” is provided by the admin, we will execute the following checks
    • new disk offering mode (local/shared) must match the target storage mode. If it does not match, an exception will be thrown and the operator will receive a message indicating the problem.
    • we will check if the new disk offering tags match the target storage tags. If it does not match, an exception will be thrown and the operator will receive a message indicating the problem.
    • check if the target storage has the capacity for the new volume. If it does not have enough space, then an exception is thrown and the operator will receive a message indicating the problem.
    • check if the size of the volume is the same as the size of the new disk offering. If it is not the same, we will ALLOW the change of the service offering, and a warning message will be logged.

We execute the change of the Disk offering as soon as the migration of the volume finishes. Therefore, if an error happens during the migration and the volume remains in the original storage system, the disk offering will keep reflecting this situation.

Attached is a screenshot to show how the migrate option will look like:
changeintheui

@borisstoyanov
Copy link
Contributor

thanks for this PR @rafaelweingartner, are you looking into adding a marvin tests for this ?
I'll wait on your response and kick the smoketests.

@rafaelweingartner
Copy link
Member Author

I added unit test for the code I changed. I was not planning to create a Marvin tests though.
If you guys think it is a requirement, I can look into it.

@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@borisstoyanov
Copy link
Contributor

ok @rafaelweingartner, let me run some tests

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1777

@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@rafaelweingartner rafaelweingartner added this to the 4.12.0.0 milestone Mar 14, 2018
@blueorangutan
Copy link

Trillian test result (tid-2363)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 31355 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2486-t2363-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_public_ip_range.py
Intermitten failure detected: /marvin/tests/smoke/test_ssvm.py
Intermitten failure detected: /marvin/tests/smoke/test_templates.py
Intermitten failure detected: /marvin/tests/smoke/test_usage.py
Intermitten failure detected: /marvin/tests/smoke/test_volumes.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Intermitten failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 62 look OK, 5 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_04_extract_template Failure 128.33 test_templates.py
ContextSuite context=TestISOUsage>:setup Error 0.00 test_usage.py
test_06_download_detached_volume Failure 137.59 test_volumes.py
test_01_redundant_vpc_site2site_vpn Failure 325.32 test_vpc_vpn.py
test_hostha_enable_ha_when_host_in_maintenance Error 0.45 test_hostha_kvm.py

@borisstoyanov
Copy link
Contributor

@rafaelweingartner I've created a marvin test but I'm not able to push to your repo. How can I contribute?

@rafaelweingartner
Copy link
Member Author

Thanks!
You can open a PR against my branch, then I can merge it here.

@borisstoyanov
Copy link
Contributor

I'm not sure I'm doing this right.. but git says there's nothing to compare..
screen shot 2018-03-15 at 12 51 51
any idea? @rafaelweingartner

@rafaelweingartner
Copy link
Member Author

Did you pushed your changes to your branch in the remote repository?
I am checking your branch, but there is no new commit there.

@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✖debian. JID-1781

@blueorangutan
Copy link

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

@DaanHoogland
Copy link
Contributor

debian packaging failed and so did jenkins and travis!

@rafaelweingartner
Copy link
Member Author

Yes. However, that is a consequence of the last merge and is fixed with: #2491

@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

rafaelweingartner and others added 3 commits March 16, 2018 06:53
This is a continuation of work developed on PR apache#2425 (CLOUDSTACK-10240), which provided root admins an override mechanism to move volumes between storage systems types (local/shared) even when the disk offering would not allow such operation. To complete the work, we will now provide a way for administrators to enter a new disk offering that can reflect the new placement of the volume. We will add an extra parameter to allow the root admin inform a new disk offering for the volume. Therefore, when the volume is being migrated, it will be possible to replace the disk offering to reflect the new placement of the volume.

The API method will have the following parameters:

* storageid (required)
* volumeid (required)
* livemigrate(optional)
* newdiskofferingid (optional) – this is the new parameter

The expected behavior is the following:

* If “newdiskofferingid” is not provided the current behavior is maintained. Override mechanism will also keep working as we have seen so far.
* If the “newdiskofferingid” is provided by the admin, we will execute the following checks
** new disk offering mode (local/shared) must match the target storage mode. If it does not match, an exception will be thrown and the operator will receive a message indicating the problem.
** we will check if the new disk offering tags match the target storage tags. If it does not match, an exception will be thrown and the operator will receive a message indicating the problem.
** check if the target storage has the capacity for the new volume. If it does not have enough space, then an exception is thrown and the operator will receive a message indicating the problem.
** check if the size of the volume is the same as the size of the new disk offering. If it is not the same, we will ALLOW the change of the service offering, and a warning message will be logged.

We execute the change of the Disk offering as soon as the migration of the volume finishes. Therefore, if an error happens during the migration and the volume remains in the original storage system, the disk offering will keep reflecting this situation.
* Adding a test to cover migration with new disk offering

* Update test_volumes.py

* Update test_volumes.py
@rafaelweingartner
Copy link
Member Author

@DaanHoogland now everything is ok again.

@DaanHoogland
Copy link
Contributor

thanks @rafaelweingartner , didn't notice the relation

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1889

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-2471)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 91858 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2486-t2471-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_certauthority_root.py
Intermitten failure detected: /marvin/tests/smoke/test_primary_storage.py
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_routers.py
Intermitten failure detected: /marvin/tests/smoke/test_snapshots.py
Intermitten failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
Intermitten failure detected: /marvin/tests/smoke/test_host_maintenance.py
Intermitten failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 61 look OK, 6 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_add_primary_storage_disabled_host Error 0.61 test_primary_storage.py
test_01_primary_storage_nfs Error 0.13 test_primary_storage.py
ContextSuite context=TestStorageTags>:setup Error 0.24 test_primary_storage.py
test_04_restart_network_wo_cleanup Failure 3.27 test_routers.py
test_02_list_snapshots_with_removed_data_store Error 1.15 test_snapshots.py
test_08_migrate_vm Error 17.79 test_vm_life_cycle.py
test_01_cancel_host_maintenace_with_no_migration_jobs Failure 6.34 test_host_maintenance.py
test_02_cancel_host_maintenace_with_migration_jobs Error 2.29 test_host_maintenance.py
test_hostha_kvm_host_fencing Failure 1491.43 test_hostha_kvm.py
test_hostha_kvm_host_recovering Failure 616.59 test_hostha_kvm.py

@rafaelweingartner
Copy link
Member Author

@borisstoyanov with that change in the test case, now the test we created for this PR passed. Some tests failed, but they are different from the last run.

@borisstoyanov
Copy link
Contributor

yup, let me run it again @blueorangutan test

@blueorangutan
Copy link

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

@PaulAngus
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

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

@apache apache deleted a comment from nitin-maharana Apr 10, 2018
@blueorangutan
Copy link

Trillian test result (tid-2488)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 97660 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2486-t2488-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_certauthority_root.py
Intermitten failure detected: /marvin/tests/smoke/test_primary_storage.py
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_routers.py
Intermitten failure detected: /marvin/tests/smoke/test_snapshots.py
Intermitten failure detected: /marvin/tests/smoke/test_ssvm.py
Intermitten failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
Intermitten failure detected: /marvin/tests/smoke/test_host_maintenance.py
Intermitten failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 61 look OK, 6 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_add_primary_storage_disabled_host Error 0.74 test_primary_storage.py
test_01_primary_storage_nfs Error 0.12 test_primary_storage.py
ContextSuite context=TestStorageTags>:setup Error 0.21 test_primary_storage.py
test_04_restart_network_wo_cleanup Failure 4.11 test_routers.py
test_02_list_snapshots_with_removed_data_store Error 1.16 test_snapshots.py
test_08_migrate_vm Error 18.91 test_vm_life_cycle.py
test_01_cancel_host_maintenace_with_no_migration_jobs Failure 1.14 test_host_maintenance.py
test_02_cancel_host_maintenace_with_migration_jobs Error 2.31 test_host_maintenance.py
test_hostha_enable_ha_when_host_in_maintenance Error 1.56 test_hostha_kvm.py
test_hostha_kvm_host_degraded Failure 1503.52 test_hostha_kvm.py
test_hostha_kvm_host_fencing Failure 619.78 test_hostha_kvm.py
test_hostha_kvm_host_recovering Failure 621.92 test_hostha_kvm.py

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM

@mike-tutkowski mike-tutkowski mentioned this pull request Apr 12, 2018
11 tasks
@rafaelweingartner
Copy link
Member Author

@nitin-maharana are you LGTM here?

Copy link
Member

@GabrielBrascher GabrielBrascher left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @rafaelweingartner.
I have just two minor observations on Javadoc.

The code is well documented and covered with unit tests; additionally, it has passed on integration tests. Based on that, it LGTM.

StoragePool destPool = (StoragePool)dataStoreMgr.getDataStore(destPoolId, DataStoreRole.Primary);
assert (destPool != null);
/**
* Retrieve the new disk offering UUID that might be sent to replace the current one in the volume being migrated.
Copy link
Member

Choose a reason for hiding this comment

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

I think that it should be "Retrieves", right?

Copy link
Member Author

Choose a reason for hiding this comment

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

If you read as "it (the method) retrieves the new .....". Then, yes, I guess it should be "Retrieves".
I will change that.

}

/**
* Retrieve the storage pool tags as a {@link String}. If the storage pool does not have tags we return a null value.
Copy link
Member

Choose a reason for hiding this comment

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

I think that "Retrieves" would best fit here.

@rafaelweingartner rafaelweingartner merged commit d6cbd77 into apache:master Apr 26, 2018
rafaelweingartner added a commit to rafaelweingartner/cloudstack that referenced this pull request Apr 27, 2018
…l selected

After using the feature introduced by apache#2486 in production, we felt the need for an improvement in the UI.  It is interesting to filter the displayed disk offerings according to the type of storage selected (local/shared) to migrate the volume to.
rafaelweingartner added a commit to rafaelweingartner/cloudstack that referenced this pull request Apr 27, 2018
…l selected

After using the feature introduced by apache#2486 in production, we felt the need for an improvement in the UI.  It is interesting to filter the displayed disk offerings according to the type of storage selected (local/shared) to migrate the volume to.
rafaelweingartner added a commit to rafaelweingartner/cloudstack that referenced this pull request Apr 27, 2018
…l selected

After using the feature introduced by apache#2486 in production, we felt the need for an improvement in the UI.  It is interesting to filter the displayed disk offerings according to the type of storage selected (local/shared) to migrate the volume to.
rafaelweingartner added a commit to rafaelweingartner/cloudstack that referenced this pull request Apr 28, 2018
…l selected

After using the feature introduced by apache#2486 in production, we felt the need for an improvement in the UI.  It is interesting to filter the displayed disk offerings according to the type of storage selected (local/shared) to migrate the volume to.
rafaelweingartner added a commit to rafaelweingartner/cloudstack that referenced this pull request Apr 28, 2018
…l selected

After using the feature introduced by apache#2486 in production, we felt the need for an improvement in the UI.  It is interesting to filter the displayed disk offerings according to the type of storage selected (local/shared) to migrate the volume to.
rafaelweingartner added a commit that referenced this pull request May 4, 2018
…l selected (#2612)

After using the feature introduced by #2486 in production, we felt the need for an improvement in the UI.  It is interesting to filter the displayed disk offerings according to the type of storage selected (local/shared) to migrate the volume to.
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