From: Luis Chamberlain <mcgrof@kernel.org>
To: Chuck Lever <cel@kernel.org>, Daniel Gomez <da.gomez@kruces.com>,
kdevops@lists.linux.dev
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [RFT 2/4] guestfs: fix custom image bringup failure for Debian 13
Date: Tue, 26 Aug 2025 20:57:45 -0700 [thread overview]
Message-ID: <20250827035747.3314144-3-mcgrof@kernel.org> (raw)
In-Reply-To: <20250827035747.3314144-1-mcgrof@kernel.org>
When using custom images (like Debian 13 daily builds), the base_image
role would incorrectly attempt to build the image using virt-builder
even though a custom image workflow was configured. This failed because
"debian-13-generic-amd64-daily" is not a valid virt-builder template.
The issue had two root causes:
1. The base-image.yml task would run even when custom images were
configured, attempting to use virt-builder with an invalid template
2. The custom-image.yml task prepared the custom image but never copied
it to the base_image_pathname location expected by subsequent tasks
Fix both issues by:
- Adding a condition to skip base-image.yml when using custom images
- Copying the prepared custom image to the base_image_pathname location
This ensures custom images are properly downloaded, prepared with the
kdevops user configuration, and placed in the expected location for
VM provisioning.
Fixes: df31e8f55d7d ("guestfs: fix custom image partition not expanded after disk resize")
Generated-by: Claude AI
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
playbooks/roles/base_image/tasks/custom-image.yml | 11 +++++++++++
playbooks/roles/base_image/tasks/main.yml | 1 +
2 files changed, 12 insertions(+)
diff --git a/playbooks/roles/base_image/tasks/custom-image.yml b/playbooks/roles/base_image/tasks/custom-image.yml
index 207a5fa1..296424bc 100644
--- a/playbooks/roles/base_image/tasks/custom-image.yml
+++ b/playbooks/roles/base_image/tasks/custom-image.yml
@@ -281,3 +281,14 @@
- "--no-compression"
- "{{ custom_image_dir }}"
changed_when: true
+
+- name: Copy custom image to base image location
+ become: true
+ become_method: ansible.builtin.sudo
+ ansible.builtin.copy:
+ src: "{{ custom_image }}"
+ dest: "{{ base_image_pathname }}"
+ remote_src: true
+ mode: "u=rw,g=r,o=r"
+ when:
+ - custom_image_stat.stat.exists or custom_image_download is changed
diff --git a/playbooks/roles/base_image/tasks/main.yml b/playbooks/roles/base_image/tasks/main.yml
index 37907d71..05ab68bd 100644
--- a/playbooks/roles/base_image/tasks/main.yml
+++ b/playbooks/roles/base_image/tasks/main.yml
@@ -17,3 +17,4 @@
file: "{{ role_path }}/tasks/base-image.yml"
when:
- not result.stat.exists
+ - not guestfs_has_custom_raw_image|bool
--
2.50.1
next prev parent reply other threads:[~2025-08-27 3:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-27 3:57 [RFT 0/4] guestfs: few custom image fixes Luis Chamberlain
2025-08-27 3:57 ` [RFT 1/4] guestfs: fix custom image partition not expanded after disk resize Luis Chamberlain
2025-08-27 3:57 ` Luis Chamberlain [this message]
2025-08-27 3:57 ` [RFT 3/4] guestfs: fix virt-resize failure for custom images Luis Chamberlain
2025-08-27 3:57 ` [RFT 4/4] guestfs: fix checksum verification for resized " Luis Chamberlain
2025-08-29 2:01 ` [RFT 0/4] guestfs: few custom image fixes Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250827035747.3314144-3-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=cel@kernel.org \
--cc=da.gomez@kruces.com \
--cc=kdevops@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox