Error message: error loading cloud-init config: bad file when launching VM with Multipass
Describe the bug When I attempt to launch a new VM with Multipass using the '--cloud-init <cloud-config.yaml> I am getting the error "error loading cloud-init config: bad file".
To Reproduce How, and what happened?
- Change to the directory where my test-cloud-config.yaml file is located
- Run the command "multipass --name testvm --network bobsbridge --cloud-config test-cloud-config.yaml"
Expected behavior VM launches and properties are used as described in the cloud config yaml file.
Logs When running the following command, there are no new entries added to the daemon log. multipass launch --name testvm_1 --cloud-init test-cloud-config.yaml
The only output from this command is... error loading cloud-init config: bad file
Here are the last 5 lines written. Aug 28 09:52:57 bbproxy multipassd[872]: Checking for images to update… Aug 28 15:52:57 bbproxy multipassd[872]: Checking for images to update… Aug 28 21:52:57 bbproxy multipassd[872]: Checking for images to update… Aug 29 03:52:57 bbproxy multipassd[872]: Checking for images to update… Aug 29 05:12:13 bbproxy multipassd[872]: Using the 'multipass' storage pool.
Additional info No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy
Multipass information multipass 1.10.1 multipassd 1.10.1 multipass info --all <empty) multipass get local.driver` -- lxd
Additional context The only thing I currently have in my test-cloud-config.yaml is shown below.
#cloud-config
users:
- name: atladmin
Several articles I've found online reference the following command for validating the yaml, but in my environment, "schema" does not appear to be valid based on the output.
cloud-init devel schema --config-file test-cloud-config.yaml
Not sure what I've missed here, any direction would be greatly appreciated.
Thank you!
Hi @boursawb!
That cloud-init file looks valid, so I'm wondering which directory you have the test-cloud-config.yaml. If it's not in your user's home directory, snap confinement will deny access to the file and that gives these types of weird error messages.