Skip to content

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

Merged
rafaelweingartner merged 5 commits into
apache:masterfrom
rafaelweingartner:CLOUDSTACK-10323
Apr 26, 2018
Merged

[CLOUDSTACK-10323] Allow changing disk offering during volume migration #2486
rafaelweingartner merged 5 commits into
apache:masterfrom
rafaelweingartner:CLOUDSTACK-10323

Conversation

@rafaelweingartner

@rafaelweingartnerrafaelweingartner commented Mar 14, 2018

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@borisstoyanov

Copy link
Copy Markdown
Contributor

ok @rafaelweingartner, let me run some tests

@blueorangutan

Copy link
Copy Markdown

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

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@rafaelweingartnerrafaelweingartner added this to the 4.12.0.0 milestone Mar 14, 2018
@blueorangutan

Copy link
Copy Markdown

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:

TestResultTime (s)Test File
test_04_extract_templateFailure128.33test_templates.py
ContextSuite context=TestISOUsage>:setupError0.00test_usage.py
test_06_download_detached_volumeFailure137.59test_volumes.py
test_01_redundant_vpc_site2site_vpnFailure325.32test_vpc_vpn.py
test_hostha_enable_ha_when_host_in_maintenanceError0.45test_hostha_kvm.py

@borisstoyanov

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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

@borisstoyanov

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@borisstoyanov 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: ✔centos6 ✔centos7 ✖debian. JID-1781

@blueorangutan

Copy link
Copy Markdown

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

@DaanHoogland

Copy link
Copy Markdown
Contributor

debian packaging failed and so did jenkins and travis!

@rafaelweingartner

Copy link
Copy Markdown
MemberAuthor

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

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

rafaelweingartnerand 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
Copy Markdown
MemberAuthor

@DaanHoogland now everything is ok again.

@DaanHoogland

Copy link
Copy Markdown
Contributor

thanks @rafaelweingartner , didn't notice the relation

@blueorangutan

Copy link
Copy Markdown

@rafaelweingartner 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: ✔centos6 ✔centos7 ✔debian. JID-1889

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland 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-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:

TestResultTime (s)Test File
test_01_add_primary_storage_disabled_hostError0.61test_primary_storage.py
test_01_primary_storage_nfsError0.13test_primary_storage.py
ContextSuite context=TestStorageTags>:setupError0.24test_primary_storage.py
test_04_restart_network_wo_cleanupFailure3.27test_routers.py
test_02_list_snapshots_with_removed_data_storeError1.15test_snapshots.py
test_08_migrate_vmError17.79test_vm_life_cycle.py
test_01_cancel_host_maintenace_with_no_migration_jobsFailure6.34test_host_maintenance.py
test_02_cancel_host_maintenace_with_migration_jobsError2.29test_host_maintenance.py
test_hostha_kvm_host_fencingFailure1491.43test_hostha_kvm.py
test_hostha_kvm_host_recoveringFailure616.59test_hostha_kvm.py

@rafaelweingartner

Copy link
Copy Markdown
MemberAuthor

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

yup, let me run it again @blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@PaulAngus

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@apacheapache deleted a comment from nitin-maharanaApr 10, 2018
@blueorangutan

Copy link
Copy Markdown

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:

TestResultTime (s)Test File
test_01_add_primary_storage_disabled_hostError0.74test_primary_storage.py
test_01_primary_storage_nfsError0.12test_primary_storage.py
ContextSuite context=TestStorageTags>:setupError0.21test_primary_storage.py
test_04_restart_network_wo_cleanupFailure4.11test_routers.py
test_02_list_snapshots_with_removed_data_storeError1.16test_snapshots.py
test_08_migrate_vmError18.91test_vm_life_cycle.py
test_01_cancel_host_maintenace_with_no_migration_jobsFailure1.14test_host_maintenance.py
test_02_cancel_host_maintenace_with_migration_jobsError2.31test_host_maintenance.py
test_hostha_enable_ha_when_host_in_maintenanceError1.56test_hostha_kvm.py
test_hostha_kvm_host_degradedFailure1503.52test_hostha_kvm.py
test_hostha_kvm_host_fencingFailure619.78test_hostha_kvm.py
test_hostha_kvm_host_recoveringFailure621.92test_hostha_kvm.py

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

LGTM

@mike-tutkowskimike-tutkowski mentioned this pull request Apr 12, 2018
11 tasks
@rafaelweingartner

Copy link
Copy Markdown
MemberAuthor

@nitin-maharana are you LGTM here?

@GabrielBrascherGabrielBrascher left a comment

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.

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
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
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:masterApr 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 freeto 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

@rafaelweingartner@borisstoyanov@blueorangutan@DaanHoogland@PaulAngus@GabrielBrascher@nitin-maharana