Fix: Migration target has no matching tags - #3329
Conversation
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(), |
There was a problem hiding this comment.
Added some details in the log message.
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
DaanHoogland
left a comment
There was a problem hiding this comment.
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).
|
Packaging result: ✔centos6 ✔centos7 ✖debian. JID-2802 |
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2805 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3598)
|
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 fromstorage_pool_tags, which contains the tags from each tagged storage.Types of changes
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:
After update with the proposed fix, the volume got migrated successfully.