Comment 5 for bug 2037463

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-armada-app (f/antelope)

Reviewed: https://review.opendev.org/c/starlingx/openstack-armada-app/+/897292
Committed: https://opendev.org/starlingx/openstack-armada-app/commit/cba7b53fb1b686ad7557f1b05e48f366fda4ca72
Submitter: "Zuul (22348)"
Branch: f/antelope

commit cba7b53fb1b686ad7557f1b05e48f366fda4ca72
Author: Lucas de Ataides <email address hidden>
Date: Thu Sep 28 14:03:49 2023 -0300

    Allow VMs to be created via volumes

    After STX-Openstack upversioned to Antelope, we noticed that it was not
    possible to create VMs by volume, as they would be stuck on ERROR
    status. The first idea I had to solve this was to create a patch
    containing [1] and [2], because, as specified in [3], Nova now requires
    a service token in order to be able to manipulate Cinder volumes. This
    unfortunately did not solve the issue by itself, as now an error message
    showed up on the nova-conductor pods with the following (not full error
    message, only important part): "nova.exception.RescheduledException:
    Build of instance 2f32c7ea-1720-4f61-bce8-dbe970c40b0c was re-scheduled:
    Secret not found: no secret with matching uuid 'a7f3ae2e-cee7-4f04-9402
    -a78047747654". This UUID was not the same one present when issuing
    `virsh secret-list` on Cinder, Nova and Libvirt containers.

    Turns out openstack-helm and openstack-helm-infra have a Ceph UUID
    hardcoded in them, in Cinder [4], Nova [5] [6] and Libvirt [7] values.
    By changing these values to the UUID that libvirt was trying to find
    (7f3ae2e-cee7-4f04-9402-a78047747654), and it worked to solve the issue.
    However, it is not a good practice to use hardcoded values, and,
    searching on where this UUID was coming from, it turns out it was
    defined by the platform's Ceph configuration under
    `/etc/ceph/ceph.conf`.

    What this change does is dynamically read this `/etc/ceph/ceph.conf`
    file to search for the UUID value, and use it to override the [4] [5]
    [6] and [7] values. It also adds the patch including the Nova service
    token configuration. The combination of these 2 changes allows VMs to be
    created by volumes.

    [1] https://opendev.org/openstack/openstack-helm/commit/91c8a5baf2cf2f0dddded57d88f00ea11dd4ff4a
    [2] https://opendev.org/openstack/openstack-helm/commit/7d39af25fddbf5fc67e15c92a9265f28567a214e
    [3] https://docs.openstack.org/releasenotes/cinder/2023.1.html#upgrade-notes
    [4] https://opendev.org/openstack/openstack-helm/src/branch/master/cinder/values.yaml#L942
    [5] https://opendev.org/openstack/openstack-helm/src/branch/master/nova/values.yaml#L594
    [6] https://opendev.org/openstack/openstack-helm/src/branch/master/nova/values.yaml#L1432
    [7] https://opendev.org/openstack/openstack-helm-infra/src/branch/master/libvirt/values.yaml#L100

    Test Plan:
    PASS: Build openstack-helm, python3-k8sapp-openstack and
          stx-openstack-helm-fluxcd
    PASS: Upload / apply / remove STX-Openstack
    PASS: Create a VM by an image
    PASS: Create a volume and launch a VM from it
    PASS: Create a VM using the `boot-from-volume` flag
    PASS: Delete a VM created by a volume

    Closes-Bug: 2037463

    Change-Id: Ia00bb8dbe3460ce817d69049f97f56a96ad6a298
    Signed-off-by: Lucas de Ataides <email address hidden>