Cloud-init cant handle swap size 'auto'

Bug #1885586 reported by Eduardo on 2020-06-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Undecided
Unassigned

Bug Description

When using 'auto' as the swap size, cloud-init logs this:

2020-06-29 14:39:17,053 - cc_mounts.py[WARNING]: failed to setup swap: unsupported operand type(s) for /: 'str' and 'int'

# Define a swapfile
swap:
    filename: /swapfile.img
    size: "auto"
    maxsize: 2147483648

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: cloud-init 20.1-10-g71af48df-0ubuntu5 [modified: usr/lib/python3/dist-packages/cloudinit/config/cc_mounts.py]
ProcVersionSignature: Ubuntu 5.4.0-39.43-generic 5.4.41
Uname: Linux 5.4.0-39-generic x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: pass
Date: Mon Jun 29 15:05:45 2020
InstallationDate: Installed on 2020-06-29 (0 days ago)
InstallationMedia: Ubuntu-Server 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)
logs.tgz: Error: [Errno 2] No such file or directory: '/tmp/cloud-init-logs.tgz'
modified.conffile..etc.cloud.cloud.cfg: [modified]
mtime.conffile..etc.cloud.cloud.cfg: 2020-06-29T15:02:38.663779
user_data.txt: Error: [Errno 13] Permission denied: '/var/lib/cloud/instance/user-data.txt'

Eduardo (egonzalf) wrote :
Dan Watkins (oddbloke) wrote :

Hi Eduardo,

Thanks for using cloud-init, and for the bug report! We believe that this bug is fixed in the version of cloud-init that is currently going through the SRU process to be backported to focal. (Specifically, the fix was proposed in https://github.com/canonical/cloud-init/pull/315.)

This version should be available in the Ubuntu archive over the next week, and will appear in Ubuntu cloud images shortly thereafter.

Thanks!

Dan

Changed in cloud-init (Ubuntu):
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers