Bug 1365688 - unable to tag datastores via rest api or UI
Summary: unable to tag datastores via rest api or UI
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.5.0
Hardware: All
OS: All
medium
high
Target Milestone: GA
: 5.7.0
Assignee: Gregg Tanzillo
QA Contact: Martin Kourim
URL:
Whiteboard: api:rest:ui:tag:datastore
Depends On:
Blocks: 1366597 1366601
TreeView+ depends on / blocked
 
Reported: 2016-08-09 21:37 UTC by Josh Carter
Modified: 2019-12-16 06:19 UTC (History)
6 users (show)

Fixed In Version: 5.7.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1366597 1366601 (view as bug list)
Environment:
Last Closed: 2017-01-11 20:23:38 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Hot fix for tagging storages that are not attached to a host (40.00 KB, application/x-tar)
2016-08-11 20:07 UTC, Gregg Tanzillo
no flags Details

Comment 5 Gregg Tanzillo 2016-08-11 20:07:40 UTC
Created attachment 1190138 [details]
Hot fix for tagging storages that are not attached to a host

The root cause of this issue is that there are storage instances in the DB (provided by the customer and used to recreate) that are not attached to any hosts. Attempting to tag one of these storages will result in the reported error.

The attached hot fix handles that situation and allows the tag operation to complete successfully.

Follow these steps to apply the fix -

1. Copy the tar file bz-1365688-storage-tenant-identity.tar to the /var/www/miq/vmdb directory on the appliance.
2. Make a backup copy of /var/www/miq/vmdb/app/models/storage.rb
3. cd to /var/www/miq/vmdb on the appliance an unpack the tar file
tar -xvf bz-1365688-storage-tenant-identity.tar
4. Restart EVM

Comment 6 Gregg Tanzillo 2016-08-11 20:31:14 UTC
https://github.com/ManageIQ/manageiq/pull/10419

Comment 7 CFME Bot 2016-08-11 21:35:50 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/3ce925b216c13aecde33359a1887e6850d278cbb

commit 3ce925b216c13aecde33359a1887e6850d278cbb
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Thu Aug 11 16:27:09 2016 -0400
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Thu Aug 11 16:27:09 2016 -0400

    Fixed tenant_identity to handle storage that does not belong to an EMS
    
    - Removed #tenant_identity method in place of mixing version that already handles nil EMS
    - Storages belong to an EMS indirectly through the hosts to which it is attached. If a storage is not attached to any hosts the EMS will be nil.
    In that case the root tenant will be used for the tenant_identity.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1365688

 app/models/storage.rb       |  5 +----
 spec/models/storage_spec.rb | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 4 deletions(-)

Comment 10 CFME Bot 2016-08-24 02:05:52 UTC
New commit detected on ManageIQ/manageiq/darga:
https://github.com/ManageIQ/manageiq/commit/c25e4078d934c6aeccebfd51b2e4a8d6f2d047e9

commit c25e4078d934c6aeccebfd51b2e4a8d6f2d047e9
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Tue Aug 23 18:07:53 2016 -0400
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Tue Aug 23 18:07:53 2016 -0400

    Fixed tenant_identity to handle storage that does not belong to an EMS
    
    Storages belong to an EMS indirectly through the hosts to which it is attached. If a storage is not attached to any hosts the EMS will be nil. In that case the root tenant will be used for the tenant_identity.
    Backported from https://github.com/ManageIQ/manageiq/pull/10419. Was done manually because the change upstream was different for the draga branch.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1365688

 app/models/storage.rb       |  6 +++++-
 spec/models/storage_spec.rb | 24 ++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)


Note You need to log in before you can comment on or make changes to this bug.