-
Notifications
You must be signed in to change notification settings - Fork 859
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
Error loading cloud-init config: bad file - multipass and cloud-init #5737
Comments
@tersucorp Cloud-init appears to work just fine on multipass using a stock multipass image.
Cloud-init failed because ds-identify didn't find a configuration. I can tell you this because on a good launch (stock image) I see this in
but on yours I see:
It looks like multipass isn't providing the user-data disk for some reason - and based on the multipass errors that you shared ( I would recommend double and triple checking that the exact file that you are passing to multipass is valid YAML, since yaml-cpp doesn't seem to think that it is.
Cloud-init is already installed in mulipass images so this shouldn't be necessary. Was this just so that you could locally check the schema using |
@holmanb yes, I checked the validity of the file:
I also want to add that I am running this from my local machine - ubuntu 24.04 This is the link to the files I am working with: https://github.com/davidshare/Kubernetes-tasks/tree/master/multipass-k8s-cluster |
@holmanb I also copied samples from here to test, and got the same error: https://cloudinit.readthedocs.io/en/latest/reference/examples.html |
@tersucorp It works for me with your config. $ multipass launch --name master --cloud-init ./debian-cloud-init.yaml --verbose
Launched: master
$ multipass --version
multipass 1.14.0
multipassd 1.14.0
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
$ cat ./debian-cloud-init.yaml
#cloud-config
package_update: true
packages:
- debootstrap
users:
- name: root
lock_passwd: false
passwd: tersu
ssh_pwauth: true
disable_root: false
runcmd:
- debootstrap --arch=arm64 bookworm /mnt http://deb.debian.org/debian/
- mount --bind /dev /mnt/dev
- mount --bind /proc /mnt/proc
- mount --bind /sys /mnt/sys
- |
chroot /mnt /bin/bash -c "apt-get update && \
apt-get install -y linux-image-arm64 systemd-sysv"
- chroot /mnt /bin/bash -c "apt-get install -y grub-efi"
- |
chroot /mnt /bin/bash -c "grub-install --target=arm64-efi \
--efi-directory=/boot/efi --bootloader-debian --recheck"
- chroot /mnt /bin/bash -c "update-grub"
- |
chroot /mnt /bin/bash -c "echo 'deb http://deb.debian.org/debian/ \
bookworm main' > /etc/apt/sources.list"
- chroot /mnt /bin/bash -c "echo 'root:password' | chpasswd"
- |
chroot /mnt /bin/bash -c "sed -i 's/^#PermitRootLogin.*/\
PermitRootLogin yes/' /etc/ssh/sshd_config"
- chroot /mnt /bin/bash -c "systemctl enable ssh"
- umount /mnt/dev
- umount /mnt/proc
- umount /mnt/sys
- echo "Debian installation completed!" |
Wow! So how do I even begin to figure out what the issue is? |
@tersucorp When dealing with the unexpected like this, start by challenging your assumptions and expectations. Reinstall multipass. Delete the configuration files and scripts and recreate them. Does it still happen? Are you able to recreate my working example? If you're doing anything weird (building multipass from source, using custom images, etc), see if it reproduces with a more standard setup. If none of those steps identify your problem, then you should file a bug against multipass and see if they can help you. Link to the crossposted question for posterity. |
@tersucorp This doesn't appear to be an issue with cloud-init, so I'm going to close it. Best of luck! |
Bug report
I get the error below when trying to create vms with multipass and cloud init.
To Reproduce
1.14.0
24.2-0ubuntu1~24.04.2
Expected behavior
It should create the multipass VMs with the specified config
cloud-init logs
cloud-init.tar.gz
The text was updated successfully, but these errors were encountered: