Child's root provider is not updated

Bug #1779818 reported by Tetsuro Nakamura on 2018-07-03
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Eric Fried

Bug Description

Description
===========

You can update a resource provider(old root RP)'s parent RP from None to a specific existing RP(original root RP).
But if the resource provider(old root RP) has a child RP, the child RP's root RP is not updated automatically to the new root RP.

Reproduction
============
1. There is already an RP

```
* original_root
```

{
    "resource_providers": [
        {
            "uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed",
            "parent_provider_uuid": null,
            "generation": 1,
            "root_provider_uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed",
            "name": "original_root"
        }
    ]
}

2. create a new RP and its child using POST /resource_providers

```
* original_root
* old_root_rp
     |
     +-- child_rp
```

{
    "resource_providers": [
        {
            "uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed",
            "parent_provider_uuid": null,
            "generation": 1,
            "root_provider_uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed",
            "name": "original_root"
        },
        {
            "uuid": "6985934e-0d44-404e-9b59-92d33f89d9ef",
            "parent_provider_uuid": null,
            "generation": 0,
            "root_provider_uuid": "6985934e-0d44-404e-9b59-92d33f89d9ef",
            "name": "old_root_rp"
        }
        {
            "uuid": "b80b63c9-1923-42ac-8659-e32479c70eaf",
            "parent_provider_uuid": "6985934e-0d44-404e-9b59-92d33f89d9ef",
            "generation": 0,
            "root_provider_uuid": "6985934e-0d44-404e-9b59-92d33f89d9ef",
            "name": "child_rp"
        }
    ]
}

3. Update old root rp's parent to the original root using PUT /resource_providers/6985934e-0d44-404e-9b59-92d33f89d9ef

```
* original_root
    |
    +-- old_root_rp
             |
             +-- child_rp
```

{
    "resource_providers": [
        {
            "uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed",
            "parent_provider_uuid": null,
            "generation": 1,
            "root_provider_uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed",
            "name": "original_root"
        },
        {
            "uuid": "6985934e-0d44-404e-9b59-92d33f89d9ef",
            "parent_provider_uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed", # updated :)
            "generation": 0,
            "root_provider_uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed", # updated :)
            "name": "old_root_rp"
        },
        {
            "uuid": "b80b63c9-1923-42ac-8659-e32479c70eaf",
            "parent_provider_uuid": "6985934e-0d44-404e-9b59-92d33f89d9ef", # not updated :(
            "generation": 0,
            "root_provider_uuid": "6985934e-0d44-404e-9b59-92d33f89d9ef", # not updated :(
            "name": "child_rp"
        }
    ]
}

The old_root_rp's root provider uuid is updated,
but the child_rp's root provider uuid remains old root rp's uuid.

Expected
========

The child_rp's root provider uuid is also updated to the original_root's rp uuid.

{
    "resource_providers": [
        {
            "uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed",
            "parent_provider_uuid": null,
            "generation": 1,
            "root_provider_uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed",
            "name": "original_root"
        },
        {
            "uuid": "6985934e-0d44-404e-9b59-92d33f89d9ef",
            "parent_provider_uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed",
            "generation": 0,
            "root_provider_uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed",
            "name": "old_root_rp"
        },
        {
            "uuid": "b80b63c9-1923-42ac-8659-e32479c70eaf",
            "parent_provider_uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed", # updated as well :)
            "generation": 0,
            "root_provider_uuid": "da9bd8c5-e376-4828-b8ed-080081f8e4ed", # updated as well :)
            "name": "child_rp"
        }
    ]
}

tags: added: placement
Balazs Gibizer (balazs-gibizer) wrote :
Changed in nova:
status: New → Confirmed
importance: Undecided → Medium

Fix proposed to branch: master
Review: https://review.openstack.org/580246

Changed in nova:
assignee: nobody → Tetsuro Nakamura (tetsuro0907)
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/580011
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f87ed5109b02e64c9d8a3061fee3d9f788632b16
Submitter: Zuul
Branch: master

commit f87ed5109b02e64c9d8a3061fee3d9f788632b16
Author: Tetsuro Nakamura <email address hidden>
Date: Mon Jul 2 07:32:18 2018 +0900

    Regression test for bug 1779818

    This patch adds a test that shows that when updating a parent provider
    of a resource provider, placement doesn't update a root provider of
    another resource provider in the same tree.

    Change-Id: I4f58752444cf6dff6b19dabd7a5a829cbf636678
    Related-Bug: #1779818

Changed in nova:
assignee: Tetsuro Nakamura (tetsuro0907) → Eric Fried (efried)

Reviewed: https://review.openstack.org/580246
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=bc8027515dbf7f4903568328633661c2658ee239
Submitter: Zuul
Branch: master

commit bc8027515dbf7f4903568328633661c2658ee239
Author: Tetsuro Nakamura <email address hidden>
Date: Thu Jul 5 11:02:08 2018 +0900

    Update root providers in same tree

    When updating a parent provider of a resource provider, placement
    didn't update a root provider of another resource provider in the
    same tree.

    This patch fixes it to update the root provider field of all the
    resource providers in the same tree.

    Change-Id: Icdedc10cdd5ebfda672ca2d65a75bf0143aa769c
    Closes-Bug: #1779818

Changed in nova:
status: In Progress → Fix Released
Jay Pipes (jaypipes) on 2018-07-16
summary: - child's root provider is not updated.
+ Child's root provider is not updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers