Bug 1215461

Summary: guestfs-tools unable to determine guest arch
Product: [openSUSE] openSUSE Distribution Reporter: Olav Reinert <seroton10>
Component: Virtualization:ToolsAssignee: Charles Arnold <carnold>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: carnold, lma, seroton10
Version: Leap 15.5   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Debugging output from running the failing virt-sysprep command

Description Olav Reinert 2023-09-18 20:31:04 UTC
Created attachment 869581 [details]
Debugging output from running the failing virt-sysprep command

I use the virt-sysprep command to prepare OS image files (qemu2 format) for use as KVM images.

One preparation task is to define the salt minion name, by adding the argument

    --run-command 'echo -e "# vi:filetype=yaml\nid: $MINION_ID" >/etc/salt/minion.d/id.conf'

to the virt-sysprep command.

When running the virt-sysprep command, I get the following error:

    virt-sysprep: error: host cpu (x86_64) and guest arch (unknown) are not 
    compatible, so you cannot use command line options that involve running 
    commands in the guest.  Use --firstboot scripts instead.

    If reporting bugs, run virt-sysprep with debugging enabled and include the 
    complete output:

      virt-sysprep -v -x [...]

However, it used to work flawlessly until recently, so some sort of regression has occurred. I guess the problem is that virt-sysprep is no longer able to identify the architecture of the guest OS in the image file. The image contains a standard Leap 15.5 server installation for amd64, the same arch as the host system.

Unfortunately, I can't pinpoint exactly when this issue started occurring, but I last used the tool successfully on 2023-09-01.
Comment 1 Lin Ma 2023-09-19 11:48:22 UTC
Could you please use the below leap 15.1 image instead of your image to see what happens?

https://download.opensuse.org/distribution/leap/15.1/jeos/openSUSE-Leap-15.1-JeOS.x86_64-15.1.0-kvm-and-xen-Current.qcow2
Comment 2 Olav Reinert 2023-09-19 11:58:12 UTC
(In reply to Lin Ma from comment #1)
> Could you please use the below leap 15.1 image instead of your image to see
> what happens?
> 
> https://download.opensuse.org/distribution/leap/15.1/jeos/openSUSE-Leap-15.1-
> JeOS.x86_64-15.1.0-kvm-and-xen-Current.qcow2

Using the linked image produces the same error.
Comment 3 Olav Reinert 2023-09-20 04:56:04 UTC
(In reply to Lin Ma from comment #1)
> Could you please use the below leap 15.1 image instead of your image to see
> what happens?
> 
> https://download.opensuse.org/distribution/leap/15.1/jeos/openSUSE-Leap-15.1-
> JeOS.x86_64-15.1.0-kvm-and-xen-Current.qcow2

Just for reference: Using the linked image, the following command reproduces the error:

    virt-sysprep -a openSUSE-Leap-15.1-JeOS.x86_64-15.1.0-kvm-and-xen-Current.qcow2 --run-command 'uname -a'
Comment 4 Lin Ma 2023-09-21 07:40:50 UTC
I did some tests:
1. Verify the issue via virt-sysprep of guestfs-tools-1.50.1 in Tumbleweed host.
2. Verify the issue via virt-sysprep of guestfs-tools-1.48.3 in Tumbleweed host.
3. Verify the issue via virt-sysprep of guestfs-tools-1.50.1 in Leap 15.5 host.
4. Verify the issue via virt-sysprep of guestfs-tools-1.48.3 in Leap 15.5 host.

The issue can't be reproduce in 1 and 2, only reproducible in 3 and 4.
So the root cause of this issue seems not in guestfs-tools package, It's probably in guestfs-tools's dependencies.


CC Charles for further processing.
Comment 5 Charles Arnold 2023-09-22 19:42:37 UTC
Could you please install the libguestfs RPMs from this location and try
virt-sysprep again?

https://download.opensuse.org/repositories/home:/charlesa/15.5/x86_64/

Thanks
Comment 6 Olav Reinert 2023-09-22 21:28:56 UTC
(In reply to Charles Arnold from comment #5)
> Could you please install the libguestfs RPMs from this location and try
> virt-sysprep again?
> 
> https://download.opensuse.org/repositories/home:/charlesa/15.5/x86_64/

Using those RPMs, it works as expected.
Comment 7 Charles Arnold 2023-09-25 22:03:01 UTC
(In reply to Olav Reinert from comment #6)
> (In reply to Charles Arnold from comment #5)
> > Could you please install the libguestfs RPMs from this location and try
> > virt-sysprep again?
> > 
> > https://download.opensuse.org/repositories/home:/charlesa/15.5/x86_64/
> 
> Using those RPMs, it works as expected.

Thanks for testing. A submission will be made soon containing this fix.
Comment 9 OBSbugzilla Bot 2023-09-26 00:35:04 UTC
This is an autogenerated message for OBS integration:
This bug (1215461) was mentioned in
https://build.opensuse.org/request/show/1113550 Factory / libguestfs
Comment 10 Maintenance Automation 2023-10-16 12:30:03 UTC
SUSE-RU-2023:4088-1: An update that has five fixes can now be installed.

Category: recommended (moderate)
Bug References: 1212972, 1215461, 1215543, 1215586, 1215664
Sources used:
SUSE Linux Enterprise Micro 5.5 (src): libguestfs-1.48.6-150500.3.8.1
Server Applications Module 15-SP5 (src): libguestfs-1.48.6-150500.3.8.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 11 Charles Arnold 2023-10-25 20:45:45 UTC
This fix should now be available in the update channel.
Comment 12 Olav Reinert 2023-10-26 07:13:40 UTC
It is - has been since comment #10 was posted.
Thank you.