cloud-init: Attempt to mkswap on a partition fails: invalid block count argument: ''
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Invalid
|
Medium
|
Unassigned |
Bug Description
If an attempt is made to configure a swap partition on an Ubuntu Bionic machine as follows (not a swap file, a swap partition), the attempt to mkswap fails.
The expected behaviour is that mkswap and swapon are executed correctly, and /dev/xvdg becomes a valid swap disk. In addition, when filename points at a partition, size and maxsize should be ignored.
fs_setup:
- label: vidi
device: /dev/xvde
filesystem: ext4
- label: swap
device: /dev/xvdg
filesystem: swap
mounts:
- [ /dev/xvde, /var/lib/vidispine, ext4, defaults, 0, 0 ]
- [ /dev/xvdg, none, swap, sw, 0, 0 ]
swap:
filename: /dev/xvdg
size: auto
maxsize: 17179869184
mount_default_
When the machine starts up for the first time, the following error is logged after the swap size parameter is passed as the empty string:
2020-02-07 20:21:55,242 - cc_disk_
2020-02-07 20:21:55,255 - util.py[WARNING]: Failed during filesystem operation
Failed to exec of '['/sbin/mkswap', '/dev/xvdg', '-L', 'swap', '']':
Unexpected error while running command.
Command: ['/sbin/mkswap', '/dev/xvdg', '-L', 'swap', '']
Exit code: 1
Reason: -
Stdout:
Stderr: mkswap: invalid block count argument: ''
2020-02-07 20:21:55,530 - cc_mounts.
2020-02-07 20:21:55,530 - util.py[WARNING]: Activate mounts: FAIL:swapon -a
Changed in cloud-init: | |
importance: | Undecided → Medium |
status: | New → Incomplete |
Please attach the tarfile of cloud-init collect-logs. and mention the version of cloud-init that is running.