Can't pass user data to cloudinit

Running into an error passing user data into cloudinit.

Unhandled non-multipart (text/x-not-multipart) userdata

In /var/log/cloud-init-output.log
2019-07-03 16:12:01,821 - init.py[WARNING]: Unhandled non-multipart (text/x-not-multipart) userdata: ‘b’package_upgrade: true’…’

The Profile that I’m using

config:
user.user-data: |
package_upgrade: true
packages: |
- tree
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
name: default
used_by:

  • /1.0/containers/doot

LXC/LXD version 3.0.3
Running on Ubuntu 18.04

Your metadata is invalid, it needs to start with a suitable header, in this case I think it is #cloud-config.

#cloud-config
package_upgrade: true
packages:
 - tree

This worked like a charm. Not sure why I missed that, thank you.

Is there documentation on the valid metadata options ?

https://cloudinit.readthedocs.io/en/latest/topics/format.html

This covers the different formats that are supported, the most common is #cloud-config which is the usual yaml config

Nice, Thank you.