octavia-diskimage-retrofit fails to set image architecture

Bug #2016344 reported by Alan Baghumian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charm-octavia-diskimage-retrofit
Fix Committed
Wishlist
Alan Baghumian

Bug Description

Executing the following command produces amphorae images on OpenStack:

$ juju run-action --wait octavia-diskimage-retrofit/leader retrofit-image

However it does not set the "architecture" property properly.

This causes Openstack to schedule workloads on mismatching compute nodes in multi-arch deployments. For instance we see x86_64 image being launched on aarch64 nodes.

This should be fairly easy to fix.

Thank you,
Alan

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

So doing a bit of digging, the glance client 'create' method takes an architecture property: https://github.com/openstack/python-glanceclient/blob/7c2ab837aa0c5749ac84eb610ed13ac4fb6dfc12/glanceclient/v2/image_schema.py#L221

This just needs to be added in the charm code here: https://github.com/openstack/charm-octavia-diskimage-retrofit/blob/939a008141bb9e5d5390b491cb1713fd7e1c524c/src/lib/charm/openstack/octavia_diskimage_retrofit.py#L300 essentially reusing/using "source_image.architecture).

Changed in charm-octavia-diskimage-retrofit:
importance: Undecided → Wishlist
status: New → Triaged
tags: added: good-first-bug
Revision history for this message
Alan Baghumian (alanbach) wrote :

I just patched my focal/yoga charm (rev 101) and this worked like a charm:

$ openstack image show amphora-haproxy-x86_64-ubuntu-22.04-20231026 --fit-width
+------------------+-----------------------------------------------------------------------+
| Field | Value |
+------------------+-----------------------------------------------------------------------+
| checksum | 5a35a85303aa44013d3e16ff0e0d4a89 |
| container_format | bare |
| created_at | 2023-11-23T20:58:35Z |
| disk_format | qcow2 |
| file | /v2/images/8b3c629f-eff1-4d69-b188-feef55495f8a/file |
| id | 8b3c629f-eff1-4d69-b188-feef55495f8a |
| min_disk | 0 |
| min_ram | 0 |
| name | amphora-haproxy-x86_64-ubuntu-22.04-20231026 |
| owner | 24fc47690c0c4abeb09d10fb7821ecd0 |
| properties | architecture='x86_64', direct_url='rbd://ba189180-72a5-11ed-8b58-1de5 |
| | 666f6941/glance/8b3c629f-eff1-4d69-b188-feef55495f8a/snap', |
| | locations='[{'url': 'rbd://ba189180-72a5-11ed-8b58-1de5666f6941/glanc |
| | e/8b3c629f-eff1-4d69-b188-feef55495f8a/snap', 'metadata': {'store': |
| | 'ceph'}}]', os_hash_algo='sha512', os_hash_value='f3214081a5d3b3f46e1 |
| | beac4641565110700cd1196f0c8d0f238ceda3c1a9108ca109c1d8df760505eb43b30 |
| | 1534cc39c8814c68a93898793d4c6e7a26810267', os_hidden='False', |
| | source_product_name='com.ubuntu.cloud:server:22.04:amd64', |
| | source_version_name='20231026', stores='ceph' |
| protected | False |
| schema | /v2/schemas/image |
| size | 921370624 |
| status | active |
| tags | octavia-amphora, octavia-diskimage-retrofit |
| updated_at | 2023-11-23T20:58:59Z |
| virtual_size | 6656360448 |
| visibility | shared |
+------------------+-----------------------------------------------------------------------+

architecture='x86_64' was successfully injected in the image properties.

Changed in charm-octavia-diskimage-retrofit:
assignee: nobody → Alan Baghumian (alanbach)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-octavia-diskimage-retrofit (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-octavia-diskimage-retrofit (master)

Change abandoned by "Alan Baghumian <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/charm-octavia-diskimage-retrofit/+/901779
Reason: Duplicate review.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Alan Baghumian <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/charm-octavia-diskimage-retrofit/+/901780
Reason: Duplicate review.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-octavia-diskimage-retrofit (master)

Reviewed: https://review.opendev.org/c/openstack/charm-octavia-diskimage-retrofit/+/901802
Committed: https://opendev.org/openstack/charm-octavia-diskimage-retrofit/commit/a2cc1652b93baf79340426f697fb3c2c247ac3c1
Submitter: "Zuul (22348)"
Branch: master

commit a2cc1652b93baf79340426f697fb3c2c247ac3c1
Author: Alan Baghumian <email address hidden>
Date: Thu Nov 23 13:18:18 2023 -0800

    Fixed missing image architecture property.

    Closes-Bug: #2016344
    Change-Id: Ia0d69f3376ae63907df2a5d40f8d4155b8aeaeda

Changed in charm-octavia-diskimage-retrofit:
status: In Progress → Fix Committed
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.