Autoinstall with storage layout and swap defined raises error

Bug #2064050 reported by Jon "The Nice Guy" Spriggs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity
New
Undecided
Unassigned

Bug Description

I have defined my storage stanzas of the autoinstall.yml file as follows:

  storage:
    swap:
      size: 32GB
    layout:
      name: lvm
      password: password-in-here

I did this as a test, expecting it to either

A) Realise this is an instruction to use the full primary disk, subtracting 32GB for Swap OR
B) Show "this configuration is not permitted"

Instead, when I do this, I get a "this has crashed" whoopsie dialogue, a "sorry we don't know why this has failed" message in the application, and when you look at the log, you get the following message (the full log is attached to the bug):

        Running command ['sh', '-c', 'rm -f "$1" && umask 0066 && truncate -s 0 "$1" && { chattr +C "$1" || true; } && fallocate -l "${2}M" "$1" && mkswap "$1" || { r=$?; rm -f "$1"; exit $r; }', 'setup_swap', '/target//swap.img', '32768'] with allowed return codes [0] (capture=False)
        chattr: Operation not supported while setting flags on /target//swap.img
        fallocate: fallocate failed: No space left on device
        creating swapfile '/swap.img' of 32768MB took 0.096 seconds
        failed creating swapfile '/swap.img' of 32768MB
        finish: cmd-install/stage-curthooks/builtin/cmd-curthooks/setting-up-swap: FAIL: setting up swap
        finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: FAIL: curtin command curthooks
        Traceback (most recent call last):
          File "/snap/ubuntu-desktop-bootstrap/171/lib/python3.10/site-packages/curtin/commands/main.py", line 202, in main
            ret = args.func(args)
          File "/snap/ubuntu-desktop-bootstrap/171/lib/python3.10/site-packages/curtin/commands/curthooks.py", line 2224, in curthooks
            builtin_curthooks(cfg, target, state)
          File "/snap/ubuntu-desktop-bootstrap/171/lib/python3.10/site-packages/curtin/commands/curthooks.py", line 2057, in builtin_curthooks
            add_swap(cfg, target, state.get('fstab'))
          File "/snap/ubuntu-desktop-bootstrap/171/lib/python3.10/site-packages/curtin/commands/curthooks.py", line 1080, in add_swap
            swap.setup_swapfile(target=target, fstab=fstab, swapfile=fname, size=size,
          File "/snap/ubuntu-desktop-bootstrap/171/lib/python3.10/site-packages/curtin/swap.py", line 188, in setup_swapfile
            util.subp(
          File "/snap/ubuntu-desktop-bootstrap/171/lib/python3.10/site-packages/curtin/util.py", line 323, in subp
            return _subp(*args, **kwargs)
          File "/snap/ubuntu-desktop-bootstrap/171/lib/python3.10/site-packages/curtin/util.py", line 172, in _subp
            raise ProcessExecutionError(stdout=out, stderr=err,
        curtin.util.ProcessExecutionError: Unexpected error while running command.
        Command: ['sh', '-c', 'rm -f "$1" && umask 0066 && truncate -s 0 "$1" && { chattr +C "$1" || true; } && fallocate -l "${2}M" "$1" && mkswap "$1" || { r=$?; rm -f "$1"; exit $r; }', 'setup_swap', '/target//swap.img', '32768']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: ''
        Unexpected error while running command.
        Command: ['sh', '-c', 'rm -f "$1" && umask 0066 && truncate -s 0 "$1" && { chattr +C "$1" || true; } && fallocate -l "${2}M" "$1" && mkswap "$1" || { r=$?; rm -f "$1"; exit $r; }', 'setup_swap', '/target//swap.img', '32768']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: ''

Revision history for this message
Jon "The Nice Guy" Spriggs (jontheniceguy) wrote :
Revision history for this message
Jon "The Nice Guy" Spriggs (jontheniceguy) wrote :

I should clarify, as I didn't submit this from the VM, this is from a release-day 24.04 Ubuntu Desktop Installer ISO running in Virtualbox on X86-64 hardware with UEFI enabled in both VirtualBox and the host OS.

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.