Skip to content

Conversation

@GabrielBrascher
Copy link
Member

@GabrielBrascher GabrielBrascher commented May 14, 2019

Description

The code prior to this commit was looking for the storage tags at the table storage_pool_details, which is empty. It should select from storage_pool_tags, which contains the tags from each tagged storage.

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)

Screenshots (if appropriate):

How Has This Been Tested?

Migrated a volume with a tag 'A' to a storage pool that also has the tag 'A'. Resulted on the following exception:

2019-05-10 17:03:16,343 ERROR [c.c.a.ApiAsyncJobDispatcher] (API-Job-Executor-9:ctx-1255172b job-16095) (logid:3f7e0f22) Unexpected exception while executing org.apache.cloudstack.api.command.admin.volume.MigrateVolumeCmdByAdmin
com.cloud.utils.exception.CloudRuntimeException: Migration target has no matching tags for volume 'ROOT-2086(262d639d-a0b0-4f8d-9e86-01fb210ace8f)'
        at com.cloud.storage.VolumeApiServiceImpl.migrateVolume(VolumeApiServiceImpl.java:2086)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)

After update with the proposed fix, the volume got migrated successfully.

The code prior to this commit was looking into storage tags at the
storage_pool_details. However, it gets null (table is empty). It should
select from storage_pool_tags, which would result on the storage pool
tags. and then reflect on the code that matched the volume tags (e.g.
'aTag') with the storage pool tags (empty).
if(! doesTargetStorageSupportDiskOffering(destPool, diskOffering)) {
throw new CloudRuntimeException("Migration target has no matching tags for volume '" +vol.getName() + "(" + vol.getUuid() + ")'");
if (!doesTargetStorageSupportDiskOffering(destPool, diskOffering)) {
throw new CloudRuntimeException(String.format("Migration target pool [%s, tags:%s] has no matching tags for volume [%s, uuid:%s, tags:%s]", destPool.getName(),
Copy link
Member Author

@GabrielBrascher GabrielBrascher May 14, 2019

Choose a reason for hiding this comment

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

Added some details in the log message.

Copy link
Contributor

@anuragaw anuragaw left a comment

Choose a reason for hiding this comment

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

LGTM

@rohityadavcloud
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

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

Copy link
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.

though I approve of this change, I must add that tagging and tag checking should be implemented in a way transcending resource types (i.e. not only diskOfferings-storagePools, but also template/serviceOffering-host/cluster/pod etc).

@blueorangutan
Copy link

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

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@rohityadavcloud
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-3598)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 33188 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3329-t3598-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 70 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@rohityadavcloud rohityadavcloud merged commit 6323aac into apache:master Jun 7, 2019
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.

5 participants