DIB_UBUNTU_MIRROR doesn't override the default archive server

Bug #2011527 reported by Nobuto Murata
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charm-octavia-diskimage-retrofit
Status tracked in Trunk
Trunk
Fix Released
Undecided
Unassigned
snap-octavia-diskimage-retrofit
Fix Committed
High
Unassigned

Bug Description

In the retrofitting process, we can specify DIB_UBUNTU_MIRROR by `-m` switch but it doesn't override the default archive server.

As we can see in the following file it's *adding* the mirror instead of replacing the default server.
https://github.com/openstack-charmers/octavia-diskimage-retrofit/blob/2dad8d8d2b6615f406ad7339d92c4c1a3a6557d0/src/elements/ubuntu-archive/pre-install.d/42-ubuntu-archive

What happens in an environment with an archive mirror is that `apt update` inside the retrofitting process uses both archive.ubuntu.com and DIB_UBUNTU_MIRROR and it's blocked unnecessarily for waiting DNS timeout of querying archive.ubuntu.com and such. In the end, the whole process takes more than an hour easily.

Revision history for this message
Nobuto Murata (nobuto) wrote :
Revision history for this message
Nobuto Murata (nobuto) wrote :

$ sudo octavia-diskimage-retrofit -d \
    -m 'deb http://mirror.archive.ubuntu.com/ubuntu jammy main universe' \
    jammy-server-cloudimg-amd64.img \
    ubuntu-amphora-haproxy-amd64.qcow2 \
    |& tee octavia-diskimage-retrofit.log

$ egrep -o '[a-z.]+\.ubuntu\.com' octavia-diskimage-retrofit.log | sort | uniq -c
    248 archive.ubuntu.com
     14 mirror.archive.ubuntu.com
     19 security.ubuntu.com

Changed in snap-octavia-diskimage-retrofit:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Nobuto Murata (nobuto) wrote :

With the patched version, there is no leak about the destination but only mirror.archive.ubuntu.com was used for GET requests.

$ sudo octavia-diskimage-retrofit -d \
    -m 'deb http://mirror.archive.ubuntu.com/ubuntu jammy main universe\ndeb http://mirror.archive.ubuntu.com/ubuntu jammy-security main universe\ndeb http://mirror.archive.ubuntu.com/ubuntu jammy-updates main universe' \
    jammy-server-cloudimg-amd64.img \
    ubuntu-amphora-haproxy-amd64.qcow2 \
    |& tee octavia-diskimage-retrofit_patched.log

$ egrep -o '[a-z.]+\.ubuntu\.com' octavia-diskimage-retrofit_patched.log | sort | uniq -c
     12 archive.ubuntu.com
    239 mirror.archive.ubuntu.com
      6 security.ubuntu.com

archive.ubuntu.com and security.ubuntu.com are just about the existing cache in the original cloud image to be converted as:

> /sysroot/subroot/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_jammy-security_main_i18n_Translation-en

Revision history for this message
Nobuto Murata (nobuto) wrote :

Subscribing ~field-high to get reviews on the PR and release a fix.
https://github.com/openstack-charmers/octavia-diskimage-retrofit/pull/33

Nobuto Murata (nobuto)
Changed in snap-octavia-diskimage-retrofit:
status: Triaged → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-octavia-diskimage-retrofit (master)
Changed in charm-octavia-diskimage-retrofit:
status: New → In Progress
Revision history for this message
Nobuto Murata (nobuto) wrote :

Released as latest/edge. The next action is to release it to the 1.0 branch.

https://github.com/openstack-charmers/octavia-diskimage-retrofit/pull/34

$ snap info octavia-diskimage-retrofit

channels:
  latest/stable: –
  latest/candidate: –
  latest/beta: 0.9.12 2021-07-16 (236) 185MB devmode
  latest/edge: 1.0.0+git7.gf0dac14 2023-03-19 (352) 279MB classic
  1.0/stable: 1.0.1 2023-01-19 (344) 277MB classic
  1.0/candidate: ↑
  1.0/beta: ↑
  1.0/edge: 1.0.1 2023-01-19 (344) 277MB classic

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/+/877886
Committed: https://opendev.org/openstack/charm-octavia-diskimage-retrofit/commit/eec35d902228c07af3c567fee7594a6fbb858899
Submitter: "Zuul (22348)"
Branch: master

commit eec35d902228c07af3c567fee7594a6fbb858899
Author: Nobuto Murata <email address hidden>
Date: Mon Mar 20 11:02:38 2023 +0900

    Update example for "ubuntu-mirror"

    To reflect changes made in the equivalent snap.
    https://github.com/openstack-charmers/octavia-diskimage-retrofit/pull/33

    Closes-Bug: #2011527
    Change-Id: I5d5b1110e1efb3b92b4443b1a8b786cf58102910

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