canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.67k stars 637 forks source link

multipass launch results in error loading cloud-init config: bad file #1672

Open hemna opened 4 years ago

hemna commented 4 years ago

Trying to launch a new focal vm with a cloud init yml file results in multipass complaining that the cloud-init.yml is bad, even though cloud-init devel schema says it's a valid file.

waboring@dl360-1:~/.dotfiles-private:(git::master) $  cloud-init devel schema --config-file ~/.dotfiles-private/cloud-init-20.04.yml
Valid cloud-config file /home/waboring/.dotfiles-private/cloud-init-20.04.yml
waboring@dl360-1:~/.dotfiles-private:(git::master) $  mp launch -c6 -m8192 -d80G --cloud-init ~/.dotfiles-private/cloud-init-20.04.yml focal
error loading cloud-init config: bad file

Here is my cloud-init.yaml

#cloud-config

users:
    - name: waboring
      sudo: ALL=(ALL) NOPASSWD:ALL
      shell: /bin/bash
      primary_group: waboring

final_message: "The system is finally up, after $UPTIME seconds"

Info:

$  uname -a
Linux dl360-1 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$  lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal

waboring@dl360-1:~/.dotfiles-private:(git::master) $  multipass version
multipass  1.3.0
multipassd 1.3.0

waboring@dl360-1:~/.dotfiles-private:(git::master) $  multipass info --all
Name:           ceph-master
State:          Stopped
IPv4:           --
Release:        --
Image hash:     3b2e3aaaebf2 (Ubuntu 18.04 LTS)
Load:           --
Disk usage:     --
Memory usage:   --

Name:           devstack-20
State:          Running
IPv4:           192.168.122.25
Release:        Ubuntu 20.04 LTS
Image hash:     40bff1540a57 (Ubuntu 20.04 LTS)
Load:           0.00 0.00 0.00
Disk usage:     18.7G out of 38.6G
Memory usage:   929.9M out of 7.8G

Name:           devstack-sap
State:          Running
IPv4:           192.168.122.202
Release:        Ubuntu 16.04.6 LTS
Image hash:     4fdec6a01294 (Ubuntu 16.04 LTS)
Load:           0.01 0.01 0.00
Disk usage:     9.0G out of 19.3G
Memory usage:   342.6M out of 15.7G

Name:           devstack-sap-2
State:          Stopped
IPv4:           --
Release:        --
Image hash:     4fdec6a01294 (Ubuntu 16.04 LTS)
Load:           --
Disk usage:     --
Memory usage:   --

Name:           fedora32
State:          Stopped
IPv4:           --
Release:        --
Image hash:     Not Available
Load:           --
Disk usage:     --
Memory usage:   --

Name:           sap-2
State:          Stopped
IPv4:           --
Release:        --
Image hash:     b2b40a41b08c (Ubuntu 16.04 LTS)
Load:           --
Disk usage:     --
Memory usage:   --

Name:           ubuntu-20
State:          Stopped
IPv4:           --
Release:        --
Image hash:     266663b10f78 (Ubuntu 20.04 LTS)
Load:           --
Disk usage:     --
Memory usage:   --

Name:           ubuntu20-k8s
State:          Stopped
IPv4:           --
Release:        --
Image hash:     fa1a86cdcf79 (Ubuntu 20.04 LTS)
Load:           --
Disk usage:     --
Memory usage:   --
townsend2010 commented 4 years ago

Hi @hemna,

Our snap has strict confinement and so it is using the home interface. That doesn't allow for hidden files and directories like the .dotfiles-private directory you are passing in. Please try a non hidden directory and see if that helps.

Thanks!

hemna commented 4 years ago

Ok that seems to have been the problem. Thank you.

Seems like we need a more descriptive error message, as this one wasn't helpful at all.

Saviq commented 4 years ago

You can also pipe it in, using --cloud-init -, it won't matter where the file is, then.

townsend2010 commented 4 years ago

@hemna,

Seems like we need a more descriptive error message, as this one wasn't helpful at all.

Agreed, but this comes from yaml-cpp which is a submodule we use. I have found other error messages that it throws lacking as well, so we should follow up with this upstream.