Skip to content

osbuild-manifests: enable kubevirt image for s390x #4093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

madhu-pillai
Copy link
Contributor

Hi,
Based on the jira ticket https://issues.redhat.com/browse/COS-3221 .
https://issues.redhat.com/browse/OCPBUGS-54751

Have done the testing using coreos-assember image with changes in osbuild-manifests. Able to generate kubevirt archive for FCOS as well as RHCOS.

RHCOS

 rhcos419-kubevirt]# cosa list
COREOS_ASSEMBLER_CONTAINER=quay.io/coreos/coreos-assember-kubevirt:latest
COREOS_ASSEMBLER_ADD_CERTS=y
+ podman run --rm -ti --security-opt=label=disable --privileged --userns=keep-id:uid=1000,gid=1000 -v=/root/rhcos419-kubevirt:/srv/ --device=/dev/kvm --device=/dev/fuse --tmpfs=/tmp -v=/var/tmp:/var/tmp --name=cosa -v=/etc/pki/ca-trust:/etc/pki/ca-trust:ro quay.io/coreos/coreos-assember-kubevirt:latest list
419.96.202505071254-0
   Timestamp: 2025-05-07T12:59:19Z (0:33:04 ago)
   Artifacts: ostree oci-manifest qemu kubevirt
      Config: release-4.19 (44326c819510)

+ rc=0
+ set +x

FCOS

fcos419-kubevirt]# cosa list
+ podman run --rm -ti --security-opt=label=disable --privileged --userns=keep-id:uid=1000,gid=1000 -v=/root/fcos419-kubevirt:/srv/ --device=/dev/kvm --device=/dev/fuse --tmpfs=/tmp -v=/var/tmp:/var/tmp --name=cosa quay.io/coreos/coreos-assember-kubevirt:latest list
42.20250507.dev.0
   Timestamp: 2025-05-07T09:15:27Z (0:08:59 ago)
   Artifacts: ostree oci-manifest qemu kubevirt
      Config: testing-devel (5046a4e48d80)

+ rc=0
+ set +x

@dustymabe
Copy link
Member

I suspect if you were to try to boot these images they wouldn't boot (hint: vimdiff platform.qemu.ipp.yaml platform.kubevirt.ipp.yaml).

Can you work with someone (maybe @jschintag) to verify the generated disk images work?

@@ -98,7 +98,10 @@ pipelines:
mpp-if: arch == 'aarch64'
then: arm64
else:
mpp-format-string: '{arch}'
mpp-if: arch == 's390x'
then: s390x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? I mean the default would return s390x anyway right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably need to pass some value here, so I would say yes?

I know for this particular one there's no "mapping" that's happening, but I don't think it hurts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see now the else below..

yeah, the else: mpp-format-string: '{arch}' should already cover this.

@madhu-pillai
Copy link
Contributor Author

hi,
I tried to add the following code platform.qemu.ipp.yaml under - kubevirt . it complains of following error. disk.img file not found.

⏱  Duration: 37s
org.osbuild.zipl.inst: a002480bc5743935ba781035f7e220cddf12c98b48643460d51e8c707aaaa779 {
  "kernel": "1",
  "kernel_opts_append": [
    "ignition.firstboot"
  ],
  "location": 2048
}
Traceback (most recent call last):
  File "/usr/sbin/osbuild", line 33, in <module>
    sys.exit(load_entry_point('osbuild==147', 'console_scripts', 'osbuild')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/osbuild/main_cli.py", line 185, in osbuild_cli
    r = manifest.build(
        object_store,
    ...<4 lines>...
        stage_timeout=stage_timeout
    )
  File "/usr/lib/python3.13/site-packages/osbuild/pipeline.py", line 525, in build
    res = pl.run(store, monitor, libdir, debug_break, stage_timeout)
  File "/usr/lib/python3.13/site-packages/osbuild/pipeline.py", line 399, in run
    results = self.build_stages(store,
                                monitor,
                                libdir,
                                debug_break,
                                stage_timeout)
  File "/usr/lib/python3.13/site-packages/osbuild/pipeline.py", line 371, in build_stages
    r = stage.run(tree,
                  self.runner,
    ...<4 lines>...
                  debug_break,
                  stage_timeout)
  File "/usr/lib/python3.13/site-packages/osbuild/pipeline.py", line 239, in run
    devices[name] = devmgr.open(dev)
                    ~~~~~~~~~~~^^^^^
  File "/usr/lib/python3.13/site-packages/osbuild/devices.py", line 93, in open
    res = client.call("open", args)
  File "/usr/lib/python3.13/site-packages/osbuild/host.py", line 348, in call
    ret, _ = self.call_with_fds(method, args)
             ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/osbuild/host.py", line 384, in call_with_fds
    raise error
osbuild.host.RemoteError: FileNotFoundError: [Errno 2] No such file or directory: '/srv/cache/osbuild/store/stage/uuid-25a7d53a2ef245909ebdbf558c3c8a20/data/tree/disk.img'
   File "/usr/lib/python3.13/site-packages/osbuild/host.py", line 268, in serve
    reply, reply_fds = self._handle_message(msg, fds)
                       ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/osbuild/host.py", line 301, in _handle_message
    ret, fds = self.dispatch(name, args, fds)
               ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/osbuild/devices.py", line 128, in dispatch
    r = self.open(args["dev"],
                  args["parent"],
                  args["tree"],
                  args["options"])
  File "/usr/lib/osbuild/devices/org.osbuild.loopback", line 112, in open
    self.fd = os.open(path, os.O_RDWR | os.O_CLOEXEC)
              ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

failed to execute cmd-buildextend-kubevirt: exit status 1
+ rc=1
+ set +x
  - mpp-if: arch == 's390x'
        then:
          type: org.osbuild.zipl.inst
          options:
            kernel: "1"
            kernel_opts_append:
              - ignition.firstboot
            location:
              mpp-format-int: '{image.layout[''boot''].start}'
            devices:
              disk:
                type: org.osbuild.loopback
                options:
                  filename: disk.img
                  partscan: true
            mounts:
              - name: root
                type: org.osbuild.xfs
                source: disk
                partition:
                  mpp-format-int: '{image.layout[''root''].partnum}'
                target: /
              - name: boot
                type: org.osbuild.ext4
                source: disk
                partition:
                  mpp-format-int: '{image.layout[''boot''].partnum}'
                target: /boot

@dustymabe
Copy link
Member

dustymabe commented May 8, 2025

Maybe since @nikita-dubrovskii knows OSBuild well and overlaps with your TZ better you can do a screenshare to debug what is going on?

In the mean time feel free to push up the lastest version of your code here.

@madhu-pillai madhu-pillai force-pushed the kubevirt-s390x branch 2 times, most recently from fc78841 to cbc74c5 Compare May 10, 2025 08:01
@madhu-pillai
Copy link
Contributor Author

Maybe since @nikita-dubrovskii knows OSBuild well and overlaps with your TZ better you can do a screenshare to debug what is going on?

In the mean time feel free to push up the lastest version of your code here.

By adding just the platform-kubevirt-ipp.yaml under coreos-build-s390x.mpp.yaml creates kubevirt images but it will not boot. So @jschintag told me to add the s390x section similar to the platform.qemu.ipp.yaml somehow it still failed find the disk.img file. i tried may time switching the config. but failed

i ran cosa build && cosa buidextend-kubevirt it builds the qemu-img. then when kubevirt it fails.

attached the failed screen shot too.
image

@madhu-pillai
Copy link
Contributor Author

Hi Dusty,
Thank a lot for the support, I am able to build the fcos kubevirt image and able to boot with that image in kubevirt. I'll test on RHCOS later.

[root@a3elp53ocp-bastion .ssh]# oc get dv
NAME      PHASE       PROGRESS   RESTARTS   AGE
fcos-dv   Succeeded   100.0%                65m
test-dv   Succeeded   100.0%                2d6h

[root@a3elp53ocp-bastion .ssh]# oc get pvc
NAME      STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
fcos-dv   Bound    pvc-8ef072ca-d4a1-4e15-a56a-85b5070bb5a5   119Gi      RWO            hostpath-csi   <unset>                 65m
test-dv   Bound    pvc-f2d1601c-8e0a-479f-a366-fae522dafa48   119Gi      RWO            hostpath-csi   <unset>                 2d6h

[root@a3elp53ocp-bastion .ssh]# oc get vm
NAME       AGE    STATUS    READY
vm-fcos    11m    Running   True
vm-rhcos   2d6h   Running   True

[root@a3elp53ocp-bastion .ssh]# virtctl console vm-fcos
Successfully connected to vm-fcos console. The escape sequence is ^]

vm-fcos login: 

Copy link

openshift-ci bot commented May 10, 2025

@madhu-pillai: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/rhcos 24f2cac link true /test rhcos

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@@ -52,6 +52,41 @@ pipelines:
partition:
mpp-format-int: '{image.layout[''boot''].partnum}'
target: /boot
- mpp-if: arch == 's390x'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the other platforms where we have this we also have this comment above which I think is useful:

      # If on s390x then run zipl, which must run after the kernel
      # arguments get finalized in the coreos.platform stage above

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, if you rebase on top of latest :main I think it will fix the CI failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants