Bug 1333806 - Migration with replication from 5.4 to 5.5; openstack provider, cloudtenant
Summary: Migration with replication from 5.4 to 5.5; openstack provider, cloudtenant
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.5.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.6.0
Assignee: Ladislav Smola
QA Contact: luke couzens
URL:
Whiteboard: migration:replication:openstack
Depends On:
Blocks: 1342499
TreeView+ depends on / blocked
 
Reported: 2016-05-06 13:03 UTC by Jan Krocil
Modified: 2016-07-12 15:18 UTC (History)
10 users (show)

Fixed In Version: 5.6.0.10
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1342499 (view as bug list)
Environment:
Last Closed: 2016-06-29 15:59:59 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 0 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 18:50:04 UTC

Comment 5 Greg Blomquist 2016-06-02 18:13:17 UTC
Jan,

can you setup another 5.4 appliance connected to the same OpenStack.

I need to see the appliance *before* it's migrated to 5.5.  I need to be able to see if there are any incorrectly classified CloudTenants in the database before the migration.

Thanks!

Comment 6 Greg Blomquist 2016-06-02 18:34:04 UTC
I setup a 5.4 appliance and added a rhos7 to the appliance.  Here's what I see in the cloud_tenants table:

> # select id, name, description, ems_ref, type from cloud_tenants;
>  id |  name   | description  |             ems_ref              | type 
> ----+---------+--------------+----------------------------------+------
>   1 | tenant2 |              | 48c71cc5d3444ab2b22a85443d7037b6 | 
>   2 | admin   | admin tenant | ff5ee96505a9421fa973482c3938e22e | 
> (2 rows)

Looks like the type field was never set in 5.4.

I'll look at the migration instructions to see what it says.  There might be some clues in there as to what happens to these records.

Comment 7 Greg Blomquist 2016-06-02 19:10:33 UTC
K, I think I tracked it down.

A long time ago I added the `type` column to the cloud_tenants table and I added a migration to make sure all cloud tenants had the right type for OpenStack (which, at the time was CloudTenantOpenstack).

But, I didn't add anything to the refresh parser to set the cloud tenant type during inventory collection.

So, any openstack tenants collected by a clean 5.4 appliance will have the cloud_tenants type column, but it will be empty (see comment #6).

Then, the 5.5 migration attempts to change all cloud tenants from CloudTenantOpenstack to ManageIQ::Providers::Openstack::CloudTenant.  But, it doesn't find any CloudTenantOpenstack records, so migrates nothing.  Everything without an explicit type in the type column will end up the base class (CloudTenant), so we see the error.

I think the fix is to create a migration that moves all cloud_tenants with no type to ManageIQ::Providers::Openstack::CloudTenant.

I'll have to see if this should be done purely in 5.5.z, or if it should be done upstream too.

The other alternative is to just update the migration docs with an extra step that converts the wrong cloud tenant records.

Comment 10 CFME Bot 2016-06-03 16:06:10 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/43d2c94d7088b16da7b04321c356feca666ef6d1

commit 43d2c94d7088b16da7b04321c356feca666ef6d1
Author:     Ladislav Smola <lsmola>
AuthorDate: Fri Jun 3 16:22:28 2016 +0200
Commit:     Ladislav Smola <lsmola>
CommitDate: Fri Jun 3 16:22:28 2016 +0200

    Fix CloudTenant missing type
    
    Fix CloudTenant missing type
    
    Fixes BZ:
    https://bugzilla.redhat.com/show_bug.cgi?id=1333806

 ...60603125531_correct_sti_type_on_cloud_tenant.rb | 15 +++++++++
 ...125531_correct_sti_type_on_cloud_tenant_spec.rb | 39 ++++++++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 db/migrate/20160603125531_correct_sti_type_on_cloud_tenant.rb
 create mode 100644 spec/migrations/20160603125531_correct_sti_type_on_cloud_tenant_spec.rb

Comment 11 luke couzens 2016-06-09 08:12:51 UTC
To verify this I will need to migrate from 5.4 to 5.6, currently this is blocked by https://bugzilla.redhat.com/show_bug.cgi?id=1344112

Comment 13 luke couzens 2016-06-17 17:38:49 UTC
Verified in 5.6.0.11

Comment 16 errata-xmlrpc 2016-06-29 15:59:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1348


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