cloud-init user-data not working via OVF iso data source on vSphere 6

Asked by Ryan Bolger

I recently downloaded the OVA version of the Ubuntu 16.04 cloud image (release-20160721) to import into my vSphere 6 based environment.
https://cloud-images.ubuntu.com/releases/16.04/release-20160721/

The OVA exposes cloud-init config values as vApp Options such that you can enter values into the deployment wizard and they will be passed to cloud-init via a mounted ISO that gets processed by the OVF datasource in cloud-init. All of the exposed options (e.g. hostname, default user password) seem to be working except "Encoded user-data".

I'm trying to embed a simple #cloud-config script into user-data just to test the functionality. The contents of the script is this.

#cloud-config
users:
  - name: demo

The help text for "Encoded user-data" claims the data entered should be base64 encoded. "In order to fit into a xml attribute, this value is base64 encoded. It will be decoded, and then processed normally as user-data." The base64 encoded version of my #cloud-config script is this.

I2Nsb3VkLWNvbmZpZwp1c2VyczoKICAtIG5hbWU6IGRlbW8K

But when I enter that base64 encoded value into the deployment wizard, the demo user is never created and the following warning shows up in the cloud-init.log file.

__init__.py[WARNING]: Unhandled non-multipart (text/x-not-multipart) userdata: 'b'I2Nsb3VkLWNvbmZpZwp1c2Vy'...'

If I skip the base64 encoding and just try to paste the raw #cloud-config script manually into the wizard, things get slightly better. Cloud-init seems to recognize the script from the "#cloud-config" header and set the mime type appropriately. But all of the line breaks get stripped out which invalidates the yaml format of the file.

util.py[DEBUG]: Attempting to load yaml from string of length 33 with allowed root types (<class 'dict'>,)
util.py[WARNING]: Failed loading yaml blob
util.py[DEBUG]: Failed loading yaml blob#012Traceback (most recent call last):#012 File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 828, in load_yaml#012 (allowed, type_utils.obj_name(converted)))#012TypeError: Yaml load allows (<class 'dict'>,) root types, but got NoneType instead
util.py[WARNING]: Failed at merging in cloud config part from part-001
util.py[DEBUG]: Failed at merging in cloud config part from part-001#012Traceback (most recent call last):#012 File "/usr/lib/python3/dist-packages/cloudinit/handlers/cloud_config.py", line 156, in handle_part#012 self._merge_part(payload, headers)#012 File "/usr/lib/python3/dist-packages/cloudinit/handlers/cloud_config.py", line 132, in _merge_part#012 (payload_yaml, my_mergers) = self._extract_mergers(payload, headers)#012 File "/usr/lib/python3/dist-packages/cloudinit/handlers/cloud_config.py", line 111, in _extract_mergers#012 mergers_yaml = mergers.dict_extract_mergers(payload_yaml)#012 File "/usr/lib/python3/dist-packages/cloudinit/mergers/__init__.py", line 95, in dict_extract_mergers#012 raw_mergers = config.pop('merge_how', None)#012AttributeError: 'NoneType' object has no attribute 'pop'

Does anyone have an idea what I'm doing wrong here?

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Did you MD5 test the ISO you downloaded?

Revision history for this message
Ryan Bolger (rbolger) said :
#2

I didn't, but I have now. Both MD5 and SHA-1 hashes match.

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.