Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return VMs and Templates for EMS prev_relats #15671

Merged
merged 1 commit into from
Jul 27, 2017

Conversation

agrare
Copy link
Member

@agrare agrare commented Jul 27, 2017

When retrieving vmdb_relats_ems we weren't including templates in the
list of children for folders. This isn't an issue for clusters, hosts,
and resource_pools because templates don't belong to any of these but
they do belong to folders.

If a VM was marked as a template and moved into a new folder it was not
being included in the prev_relats which meant that its previous
resource_pool and folder relat were not being deleted, but we were
adding a new folder relationship. This caused the "multiple parents
found" exception seen occasionally on the UI while provisioning.

https://bugzilla.redhat.com/show_bug.cgi?id=1475405

Steps to reproduce:
With evmserver stopped (needed to ensure a full refresh is run)

In rails console:

  1. Run a full refresh in rails console

In VMware Client:
2. Move a template into a different folder

In rails console:
3. Run another full refresh (Note: with a running system this can happen for a few reasons, in the case of this ticket the new folder event got merged causing the full refresh)
4. Print the parent blue folder (VmOrTemplate.find_by(:name => "foo").parent_blue_folder)

Before this patch this should result in the multiple parent found exception.

When retrieving vmdb_relats_ems we weren't including templates in the
list of children for folders.  This isn't an issue for clusters, hosts,
and resource_pools because templates don't belong to any of these but
they do belong to folders.

If a VM was marked as a template and moved into a new folder it was not
being included in the prev_relats which meant that its previous
resource_pool and folder relat were not being deleted, but we were
adding a new folder relationship.  This caused the "multiple parents
found" exception seen occasionally on the UI while provisioning.

https://bugzilla.redhat.com/show_bug.cgi?id=1475405
@agrare agrare force-pushed the bz_1475405_multiple_parents_found branch from c0bb826 to b1ed3c8 Compare July 27, 2017 19:28
@miq-bot
Copy link
Member

miq-bot commented Jul 27, 2017

Checked commit agrare@b1ed3c8 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

Copy link
Member

@blomquisg blomquisg left a comment

Choose a reason for hiding this comment

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

I read it, I understand it, I approve it 😄

@Fryguy Fryguy merged commit 3c599e9 into ManageIQ:master Jul 27, 2017
@Fryguy Fryguy added this to the Sprint 66 Ending Aug 7, 2017 milestone Jul 27, 2017
@Fryguy
Copy link
Member

Fryguy commented Jul 27, 2017

Great find @agrare !!

@agrare agrare deleted the bz_1475405_multiple_parents_found branch July 28, 2017 13:27
@agrare
Copy link
Member Author

agrare commented Jul 28, 2017

After applying this patch just running a full refresh will clean up any existing stale relationships without needing to run the tools/delete_ems_metadata_relationships.rb script.

simaishi pushed a commit that referenced this pull request Aug 2, 2017
@simaishi
Copy link
Contributor

simaishi commented Aug 2, 2017

Euwe backport details:

$ git log -1
commit 3f85b495969d3adf3e2f50856b662fce87b4abca
Author: Jason Frey <fryguy9@gmail.com>
Date:   Thu Jul 27 17:44:29 2017 -0400

    Merge pull request #15671 from agrare/bz_1475405_multiple_parents_found
    
    Return VMs and Templates for EMS prev_relats
    (cherry picked from commit 3c599e9431c10e8073874b9093f0e6c005f13993)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1477722

@agrare
Copy link
Member Author

agrare commented Aug 2, 2017

Should also backport #15692 to fix a sporadic test failure

simaishi pushed a commit that referenced this pull request Aug 9, 2017
@simaishi
Copy link
Contributor

simaishi commented Aug 9, 2017

Fine backport details:

$ git log -1
commit 4e0ccf48f4b0771f02d560cf7bc4e68943ec9283
Author: Jason Frey <fryguy9@gmail.com>
Date:   Thu Jul 27 17:44:29 2017 -0400

    Merge pull request #15671 from agrare/bz_1475405_multiple_parents_found
    
    Return VMs and Templates for EMS prev_relats
    (cherry picked from commit 3c599e9431c10e8073874b9093f0e6c005f13993)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1479805

@nmaludy
Copy link

nmaludy commented Aug 31, 2017

+1

d-m-u pushed a commit to d-m-u/manageiq that referenced this pull request Jun 6, 2018
…ents_found

Return VMs and Templates for EMS prev_relats
(cherry picked from commit 3c599e9)

https://bugzilla.redhat.com/show_bug.cgi?id=1479805
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.

6 participants