juju metadata generate-image fails with ubuntu@24.04

Bug #2084362 reported by Alan Baghumian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Simon Richardson

Bug Description

I have an OpenStack Jammy/Yoga cloud that use for personal workloads as well as experiments and reproducer.

While experimenting with a POC deployment, that started with a brand new controller, I noticed that Juju's meatdata generator fails to understand ubuntu@24.04 base and falls back to what seems to be a hard coded 22.04 state:

I tested 3.3, 3.4 and 3.5 and all behave the same way:

$ openstack image list | grep Ubuntu-24.04
| 3b7a074e-47a7-48d6-8443-9f70ae744e5f | Ubuntu-24.04-LTS | active |
| 6f34e1ec-65f2-4d20-a4fd-f9ff42edfdc2 | Ubuntu-24.04-LTS-arm64 | active |

$ sudo snap refresh juju --channel 3.3
juju (3.3/stable) 3.3.7 from Canonical✓ refreshed

$ mkdir ss
$ juju metadata generate-image -d ~/ss -i 3b7a074e-47a7-48d6-8443-9f70ae744e5f --base ubuntu@24.04 -r RegionOne -u $OS_AUTH_URL

Image metadata files have been written to:
/home/ubuntu/ss/images/streams/v1.

$ cat ss/images/streams/v1/com.ubuntu.cloud-released-imagemetadata.json
{
    "products": {
        "com.ubuntu.cloud:server:22.04:amd64": {
            "version": "22.04",
            "arch": "amd64",
            "versions": {
                "20241012": {
                    "items": {
                        "3b7a074e-47a7-48d6-8443-9f70ae744e5f": {
                            "id": "3b7a074e-47a7-48d6-8443-9f70ae744e5f",
                            "region": "RegionOne",
                            "endpoint": "https://keystone.int.hrizn.cloud:5000/v3"
                        }
                    }
                }
            }
        }
    },
    "updated": "Sat, 12 Oct 2024 15:59:59 -0700",
    "format": "products:1.0",
    "content_id": "com.ubuntu.cloud:custom"
}

$ rm -r ss && mkdir ss
$ sudo snap refresh juju --channel 3.4
juju (3.4/stable) 3.4.6 from Canonical✓ refreshed

$ juju metadata generate-image -d ~/ss -i 3b7a074e-47a7-48d6-8443-9f70ae744e5f --base ubuntu@24.04 -r RegionOne -u $OS_AUTH_URL

Image metadata files have been written to:
/home/ubuntu/ss/images/streams/v1.

$ cat ss/images/streams/v1/com.ubuntu.cloud-released-imagemetadata.json
{
    "products": {
        "com.ubuntu.cloud:server:22.04:amd64": {
            "version": "22.04",
            "arch": "amd64",
            "versions": {
                "20241012": {
                    "items": {
                        "3b7a074e-47a7-48d6-8443-9f70ae744e5f": {
                            "id": "3b7a074e-47a7-48d6-8443-9f70ae744e5f",
                            "region": "RegionOne",
                            "endpoint": "https://keystone.int.hrizn.cloud:5000/v3"
                        }
                    }
                }
            }
        }
    },
    "updated": "Sat, 12 Oct 2024 16:00:43 -0700",
    "format": "products:1.0",
    "content_id": "com.ubuntu.cloud:custom"
}

$ rm -r ss && mkdir ss
$ sudo snap refresh juju --channel 3.5
juju (3.5/stable) 3.5.4 from Canonical✓ refreshed

$ juju metadata generate-image -d ~/ss -i 3b7a074e-47a7-48d6-8443-9f70ae744e5f --base ubuntu@24.04 -r RegionOne -u $OS_AUTH_URL

Image metadata files have been written to:
/home/ubuntu/ss/images/streams/v1.

$ cat ss/images/streams/v1/com.ubuntu.cloud-released-imagemetadata.json
{
    "products": {
        "com.ubuntu.cloud:server:22.04:amd64": {
            "version": "22.04",
            "arch": "amd64",
            "versions": {
                "20241012": {
                    "items": {
                        "3b7a074e-47a7-48d6-8443-9f70ae744e5f": {
                            "id": "3b7a074e-47a7-48d6-8443-9f70ae744e5f",
                            "region": "RegionOne",
                            "endpoint": "https://keystone.int.hrizn.cloud:5000/v3"
                        }
                    }
                }
            }
        }
    },
    "updated": "Sat, 12 Oct 2024 16:01:13 -0700",
    "format": "products:1.0",
    "content_id": "com.ubuntu.cloud:custom"
}

Current workaround is to add the 24.04 images post controller bootstrap:

$ juju metadata add-image --base ubuntu@24.04 --arch amd64 --region RegionOne --stream released 3b7a074e-47a7-48d6-8443-9f70ae744e5f

$ juju metadata add-image --base ubuntu@24.04 --arch arm64 --region RegionOne --stream released 6f34e1ec-65f2-4d20-a4fd-f9ff42edfdc2

However there are other issues that will be reported in a separate bug.

Please let me know if you need anything else.

Best,
Alan

Revision history for this message
Alan Baghumian (alanbach) wrote :

This appear to be completely broken:

| 38362029-cb55-4704-a9e8-5f81354e64ec | Ubuntu-18.04-LTS | active |
| 46370444-5257-4ee1-8552-9168f9fbbef0 | Ubuntu-18.04-LTS-arm64 | active |

$ juju metadata generate-image -d ~/ss -i 38362029-cb55-4704-a9e8-5f81354e64ec --base ubuntu@18.04 -r RegionOne -u $OS_AUTH_URL

Image metadata files have been written to:
/home/ubuntu/ss/images/streams/v1.

$ cat ss/images/streams/v1/com.ubuntu.cloud-released-imagemetadata.json
{
    "products": {
        "com.ubuntu.cloud:server:22.04:amd64": {
            "version": "22.04",
            "arch": "amd64",
            "versions": {
                "20241012": {
                    "items": {
                        "38362029-cb55-4704-a9e8-5f81354e64ec": {
                            "id": "38362029-cb55-4704-a9e8-5f81354e64ec",
                            "region": "RegionOne",
                            "endpoint": "https://keystone.int.hrizn.cloud:5000/v3"
                        }
                    }
                }
            }
        }
    },
    "updated": "Sat, 12 Oct 2024 16:12:51 -0700",
    "format": "products:1.0",
    "content_id": "com.ubuntu.cloud:custom"
}

Everything is 22.04 LTS :-D

Revision history for this message
Guillaume Fouillet (gfouillet) wrote :

It seems that the base passed as parameter is ignored as long as there is a preferred base in environ config:

https://github.com/juju/juju/blob/eb81da8d97bd519cb160a6b8c74bfec96ede1738/cmd/plugins/juju-metadata/imagemetadata.go#L163-L169

We need to reassess the right behavior.

Thanks for noticing it.

Changed in juju:
assignee: nobody → Vitaly Antonenko (anvial)
Changed in juju:
assignee: Vitaly Antonenko (anvial) → Simon Richardson (simonrichardson)
importance: Undecided → High
milestone: none → 3.5.7
status: New → Triaged
Changed in juju:
status: Triaged → In Progress
Revision history for this message
Simon Richardson (simonrichardson) wrote :
Jack Shaw (jack-shaw)
Changed in juju:
milestone: 3.5.7 → none
status: In Progress → Fix Released
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.