[SRU] virt-install ignores --cloud-init when --location is present

Bug #2073461 reported by Olivier Gayot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
virt-manager (Debian)
New
Unknown
virt-manager (Ubuntu)
Fix Released
Medium
Olivier Gayot
Noble
New
Undecided
Olivier Gayot

Bug Description

[Impact]
* To run a fully automated Ubuntu server installation (autoinstall) using virt-install, we want to use a combination of:
   * --cloud-init user-data=$path_to_autoinstall
   * --extra-args autoinstall

* Unfortunately, when --location is used, the --cloud-init option gets silently ignored. This makes the installer start interactively ; instead of performing the installation automatically using the autoinstall configuration from the cloud-init user-data file.

* In certain scenarios, the --location option can be replaced by --cdrom (and then the --cloud-init option is honored). However, the --cdrom option is mutually exclusive with --extra-args ; so we can only get a partially automated installation (it requires confirmation from the user).

[Test plan]
* Ensuring that the following commands result in a fully automated (and successful) installation:

$ wget https://releases.ubuntu.com/noble/ubuntu-24.04-live-server-amd64.iso

$ cat > autoinstall.yaml
#cloud-config
autoinstall:
  version: 1
  source:
    id: ubuntu-server-minimal
  identity:
    hostname: ubuntu
    realname: ubuntu
    username: ubuntu
    password: $6$VDuw.212hptHuNMP$id7Wzc0Lem9aUl9RqydBIehO.6J2Qud6jlhgLEgXa3cnql30XIGmP5c18FRZixH.6LsgFo336Azfce8Fht0t30

$ virt-install --noreboot --connect qemu:///session --disk size=10 --memory 1024 --virt-type kvm --location ubuntu-24.04-live-server-amd64.iso --cloud-init user-data=autoinstall.yaml --extra-args autoinstall

[Where problems could occur]
It seems unlikely, but if someone relies on virt-install's current behavior (i.e., silently ignoring the --cloud-config option in the presence of --location), they might be surprised to witness a different behavior after virt-manager gets upgraded.

[Additional information]
* There is an upstream bug report [1] with a merged PR [2]
* As of time of writing, virt-manager FTBFS on noble because python-argcomplete regressed (see bug 2075315). Therefore, python-argcomplete needs to be accepted in noble-proposed before virt-install. Alternatively, we will need to request rebuilds of virt-install once python-argcomplete makes it to noble-proposed.

[1] https://github.com/virt-manager/virt-manager/issues/469
[2] https://github.com/virt-manager/virt-manager/pull/485

Related branches

Olivier Gayot (ogayot)
Changed in virt-manager (Ubuntu):
assignee: nobody → Olivier Gayot (ogayot)
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
Olivier Gayot (ogayot) wrote :

Adding .debdiff, already forwarded to Debian.

PPA build: https://launchpad.net/~ogayot/+archive/ubuntu/oracular-proposed/+build/28667379

Changed in virt-manager (Debian):
status: Unknown → New
Revision history for this message
Olivier Gayot (ogayot) wrote :

The patch has now been merged upstream!

Revision history for this message
Dan Bungert (dbungert) wrote :

Uploaded with modified Applied-Upstream to reflect the change since the diff was generated

Changed in virt-manager (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package virt-manager - 1:4.1.0-4ubuntu1

---------------
virt-manager (1:4.1.0-4ubuntu1) oracular; urgency=medium

  * d/p/virtinstall-Fix-location-and-cloud-init-conflict.patch: do not ignore
    virt-install's --cloud-init option when used in conjunction with
    --location. (LP: #2073461)

 -- Olivier Gayot <email address hidden> Thu, 18 Jul 2024 09:54:44 +0200

Changed in virt-manager (Ubuntu):
status: Fix Committed → Fix Released
Olivier Gayot (ogayot)
description: updated
description: updated
Olivier Gayot (ogayot)
description: updated
summary: - virt-install ignores --cloud-init when --location is present
+ [SRU] virt-install ignores --cloud-init when --location is present
Changed in virt-manager (Ubuntu Noble):
assignee: nobody → Olivier Gayot (ogayot)
Revision history for this message
Olivier Gayot (ogayot) wrote :

Build on noble is currently blocked because of bug 2075315

Revision history for this message
Olivier Gayot (ogayot) wrote :

I've linked a merge proposal (marked on hold) and can be reviewed but the fix for bug 2075315 must be in proposed before virt-manager can build again.

Olivier Gayot (ogayot)
description: updated
Revision history for this message
Olivier Gayot (ogayot) wrote (last edit ):

Updated the description to mention that python-argcomplete must be accepted into -proposed before virt-install. The SRU for the former does not need to block the SRU of the latter.

Relevant IRC discussion:

[12:02] <ogayot> ubuntu-sru: I would like to get virt-manager (bug 2073461) SRU-ed to noble ; but the package currently FTBFS because one of its build dependencies regressed (bug 2075315). Assuming the SRUs are approved, should I wait until the fixed build dependency makes it to noble-updates before seeking sponsoring for virt-install; or can both packages live in noble-proposed and migrate together?
[12:02] -ubottu:#ubuntu-release- Bug 2073461 in virt-manager (Ubuntu Noble) "[SRU] virt-install ignores --cloud-init when --location is present" [Undecided, New] https://launchpad.net/bugs/2073461
[12:02] -ubottu:#ubuntu-release- Bug 2075315 in python-argcomplete (Ubuntu Noble) "[SRU] argcomplete 3.1.4-1 is incompatible with default python version (3.12.3)" [Undecided, Confirmed] https://launchpad.net/bugs/2075315
[12:05] <ogayot> (I assume builders have -proposed enabled in stable series, too?)
[12:26] <rbasak> ogayot: no need to block one SRU on the other, based on your explanation above. However, we do need to accept into proposed in the correct order (or deal with rebuild attempts etc). Please explain that in the SRU documentation in the bug.
[12:32] <ogayot> rbasak: Thanks, I will document what's needed!

https://irclogs.ubuntu.com/2024/08/08/%23ubuntu-release.html

Olivier Gayot (ogayot)
description: updated
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.