Closed astuanax closed 2 months ago
Seem the API v2 is no longer encoding the string. Encoding the string beforehand, seems to have done the trick.
Might need some adjustments in the documentation to document this change in behavior.
Hi @astuanax, thanks for your bug report! We are updating the API V2 description in the next release to clarify that user-data must be base64 encoded :)
I am unable to create a server and provide user_data in cloud-init format. Using API v2, version: 0.8, and the function create_instance
Cloud init script and code to test:
script = """#!/bin/bash echo "Test" """
ubuntu = c.create_instance( public_ip_assignment="inet4", security_groups=[{"id": SECURITY_GROUP_ID}], name="demo2", instance_type={"id": INSTANCE_TYPE_ID}, template={"id": TEMPLATE_ID}, ssh_keys=[{"name": SSH_KEY_NAME}], disk_size=50, user_data=script)
When removing the user_data parameter the function works fine, and the result is a new server. Adding the user_data back and it breaks.
Tested with several formats listed here: https://cloudbase-init.readthedocs.io/en/latest/userdata.html#bash
print("test") """ Same problem.
Cloud config: script = """#cloud-config runcmd:
Same issue.