Bug 1333806
| Summary: | Migration with replication from 5.4 to 5.5; openstack provider, cloudtenant | |||
|---|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Jan Krocil <jkrocil> | |
| Component: | Providers | Assignee: | Ladislav Smola <lsmola> | |
| Status: | CLOSED ERRATA | QA Contact: | luke couzens <lcouzens> | |
| Severity: | high | Docs Contact: | ||
| Priority: | high | |||
| Version: | 5.5.0 | CC: | abellott, cpelland, gblomqui, jfrey, jhardy, jkrocil, lcouzens, mfeifer, obarenbo, simaishi | |
| Target Milestone: | GA | Keywords: | ZStream | |
| Target Release: | 5.6.0 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | migration:replication:openstack | |||
| Fixed In Version: | 5.6.0.10 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1342499 (view as bug list) | Environment: | ||
| Last Closed: | 2016-06-29 15:59:59 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1342499 | |||
|
Comment 5
Greg Blomquist
2016-06-02 18:13:17 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.
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. 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 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 Verified in 5.6.0.11 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 |