Overview
User data is a script or cloud-init document handed to an instance on first boot. It is how an instance arrives configured rather than bare: packages installed, users created, services started, configuration written. There are two ways to supply it, and they behave differently.Inline user data
Supplied as theuserData field on POST /api/v1/compute/instances, base64-encoded. See Instances.
Two toggles in the create wizard’s SSH Advanced section generate cloud-init for you, and are combined with anything you supply:
If you are writing your own cloud-init that sets either of these, use the toggles or your document, not both.
Registered user data
Both
name and userdata are required on register.
Registered payloads can also be linked to a template, so anything deployed from that image gets them by default —
POST /api/v1/templates/{id}/link-userdata. See Templates.Writing user data that works
Related
Virtual Machines
The create wizard and its Advanced options.
Templates
Linking a payload to an image.
The console
Reading cloud-init logs when a payload fails.
SSH Keys
The supported way to get access, rather than passwords.