List allocation API missing data for multi-host reservations

Bug #1958307 reported by Pierre Riteau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Blazar
Fix Released
High
Pierre Riteau

Bug Description

Create a two-node reservation:

blazar lease-create --physical-reservation min=2,max=2 a

Query the allocation list:

curl -s --header "X-Auth-Token: $OS_AUTH_TOKEN" http://os.cloud/reservation/v1/os-hosts/allocations | jq
{
  "allocations": [
    {
      "resource_id": "1",
      "reservations": [
        {
          "lease_id": "ce12b879-faca-4ca0-a54a-5c113c8a0a72",
          "id": "4abc4ddd-45aa-4e93-93c4-e72637ffdddc"
        }
      ]
    }
  ]
}

What I am expecting to see:

{
  "allocations": [
    {
      "resource_id": "1",
      "reservations": [
        {
          "lease_id": "ce12b879-faca-4ca0-a54a-5c113c8a0a72",
          "id": "4abc4ddd-45aa-4e93-93c4-e72637ffdddc"
        }
      ]
    },
    {
      "resource_id": "2",
      "reservations": [
        {
          "lease_id": "ce12b879-faca-4ca0-a54a-5c113c8a0a72",
          "id": "4abc4ddd-45aa-4e93-93c4-e72637ffdddc"
        }
      ]
    }
  ]
}

Pierre Riteau (priteau)
Changed in blazar:
importance: Undecided → High
assignee: nobody → Pierre Riteau (priteau)
status: New → Incomplete
status: Incomplete → Confirmed
Changed in blazar:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to blazar (master)

Reviewed: https://review.opendev.org/c/openstack/blazar/+/825181
Committed: https://opendev.org/openstack/blazar/commit/39c67f09b8095c4d8aadfe550f0aa924a3693f5a
Submitter: "Zuul (22348)"
Branch: master

commit 39c67f09b8095c4d8aadfe550f0aa924a3693f5a
Author: Pierre Riteau <email address hidden>
Date: Tue Jan 18 23:21:43 2022 +0100

    Fix list_allocations for multi-host reservations

    The get_reservation_allocations_by_host_ids function builds an
    allocation dictionary that looks like this:

        allocations = {
            'r1': ['host1'],
            'r2': ['host1', 'host2']
        }

    The list returned by this function was only using the first host of each
    reservation:

        allocations[r['id']][0]

    Loop over hosts to build the list of (reservation, lease, host) tuples.

    Change-Id: I55b3cb4e736f6f747c8b3254c62fa40bac3f288f
    Closes-Bug: #1958307

Changed in blazar:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to blazar (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/blazar/+/828745

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to blazar (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/blazar/+/828745
Committed: https://opendev.org/openstack/blazar/commit/d20932fd98fefaf76b31e201e3e49dfe0a14e5b9
Submitter: "Zuul (22348)"
Branch: stable/xena

commit d20932fd98fefaf76b31e201e3e49dfe0a14e5b9
Author: Pierre Riteau <email address hidden>
Date: Tue Jan 18 23:21:43 2022 +0100

    Fix list_allocations for multi-host reservations

    The get_reservation_allocations_by_host_ids function builds an
    allocation dictionary that looks like this:

        allocations = {
            'r1': ['host1'],
            'r2': ['host1', 'host2']
        }

    The list returned by this function was only using the first host of each
    reservation:

        allocations[r['id']][0]

    Loop over hosts to build the list of (reservation, lease, host) tuples.

    Change-Id: I55b3cb4e736f6f747c8b3254c62fa40bac3f288f
    Closes-Bug: #1958307
    (cherry picked from commit 39c67f09b8095c4d8aadfe550f0aa924a3693f5a)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/blazar 9.0.0.0rc1

This issue was fixed in the openstack/blazar 9.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to blazar (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/blazar/+/835057

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to blazar (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/blazar/+/835057
Committed: https://opendev.org/openstack/blazar/commit/61daf2d95ddc5550f096761f167212997c83bab5
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 61daf2d95ddc5550f096761f167212997c83bab5
Author: Pierre Riteau <email address hidden>
Date: Tue Jan 18 23:21:43 2022 +0100

    Fix list_allocations for multi-host reservations

    The get_reservation_allocations_by_host_ids function builds an
    allocation dictionary that looks like this:

        allocations = {
            'r1': ['host1'],
            'r2': ['host1', 'host2']
        }

    The list returned by this function was only using the first host of each
    reservation:

        allocations[r['id']][0]

    Loop over hosts to build the list of (reservation, lease, host) tuples.

    Change-Id: I55b3cb4e736f6f747c8b3254c62fa40bac3f288f
    Closes-Bug: #1958307
    (cherry picked from commit 39c67f09b8095c4d8aadfe550f0aa924a3693f5a)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/blazar 7.0.1

This issue was fixed in the openstack/blazar 7.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/blazar 8.0.1

This issue was fixed in the openstack/blazar 8.0.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.