Skip to content
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

osbuild: fix virtiofs data loss; switch compression to off #3729

Closed
wants to merge 5 commits into from

Commits on Feb 13, 2024

  1. qemu: Detect raw format too

    Raw format is fine to use on systems that have reflinks for example.
    cgwalters authored and dustymabe committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    f9f32dd View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2024

  1. supermin: don't cd $workdir in supermin-init-prelude

    I've been investigating why a seemingly innocuous change
    (changing compression on OSBuild generated qemu qcow2) would
    cause disk images to not boot [1]. I think I have found the issue.
    
    I was first trying to make sure 100% that the files got written
    out over the virtiofs mount before the VM got shutdown so I decided
    to add a `umount $workdir` to the process. But this ended up with
    a `umount: /srv/: target is busy.` error.
    
    When the supermin VM gets run we `cd "${workdir}"` at the end of
    supermin-init-prelude.sh. This has the effect of causing all
    spawned processes (including PID1/init) to have a cwd of /srv/.
    
    ```
    bash-5.2# lsof /srv
    COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
    init        1 root  cwd    DIR   0,26     4096 10485829 /srv
    kthreadd    2 root  cwd    DIR   0,26     4096 10485829 /srv
    pool_work   3 root  cwd    DIR   0,26     4096 10485829 /srv
    kworker/R   4 root  cwd    DIR   0,26     4096 10485829 /srv
    ...
    ...
    ```
    
    Which means it's unlikely that the virtiofs mount ever gets cleanly
    unmounted. Let's rework things here so that actual work gets spawned
    in a subshell to prevent `init` from having a cwd on the virtiofs mount.
    
    We also add in an `umount` of the cache qcow2 (if exists) and the virtiofs
    mount to strengthen our chances of a clean unmount.
    
    [1] coreos#3728
    dustymabe committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    4cd8289 View commit details
    Browse the repository at this point in the history
  2. osbuild: disable internal compression for qemu qcow2

    We previously did this in a different way (2a8d1e6) but then
    had to revert it (39fdd61) because it caused images to not boot [1].
    The root cause appears to have been the virtiofs mount not
    being unmounted cleanly from the supermin VM and that is now
    fixed so let's switch back to not compressing since we rely on
    our outer compression [2].
    
    [1] coreos#3728
    [2] coreos/fedora-coreos-tracker#1653 (comment)
    dustymabe committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    1011ec7 View commit details
    Browse the repository at this point in the history
  3. osbuild: don't use supermin VM rootfs for outdir

    Just in case this is what is causing issues with file consistency
    when copying out of the supermin VM.
    dustymabe committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    40b14dd View commit details
    Browse the repository at this point in the history
  4. mantle/platform/qemu: use cache=never for virtiofsd

    Still trying to figure out data corruption from
    coreos#3728
    dustymabe committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    9ed1b14 View commit details
    Browse the repository at this point in the history