Dokumentation

User data

Give a server start-up instructions via cloud-init, and reuse them across your servers.

User data lets you give a server instructions that it reads and carries out itself at start-up -- typically via cloud-init, to create users, install packages or write configuration files, for example. The content can be up to 32 KB, and can either be written directly when creating a server or saved as a reusable template in your user data library.

Register user data

  1. Select Compute > User Data Library.
  2. Click Register User Data.
  3. Enter a name and the content itself. If the content contains variables (for example {{ ds.meta_data.variable1 }}), list them as a comma-separated list under User Data parameters -- except built-in values such as public_hostname, which you do not specify yourself.

You can then select this template directly when creating a new server, and fill in any variables in the dialog.

Reset user data

  1. Stop the server.
  2. Click Reset Userdata on the server.
  3. Either choose a saved template from your library or enter new content manually.

Using cloud-init

If cloud-init is installed in your image, user data is read automatically at start-up. From inside a running server you can always see the current content again with:

curl http://data-server./latest/user-data