Skip to main content

Configure a VM with user data

You can add user data to a VM (Virtual Machine) to include a more customized configuration or any type of data. This user data can contain any type of information, such as a script or additional data. You can also define tags to give specific instructions on the location of the VM or its IP addresses.

User data is data associated with the VM by the user when it is created. Although the VM can access user data at any time, it is taken into account only when the VM is created. However, you can create a script in the image used to create the VM that requires user data to be taken into account on every start of the VM. This lets you modify it, then stop and restart the VM so that these changes are applied.

To obtain information about the user data of a VM, enter the following address in the terminal of the VM or in a web browser: 169.254.169.254/latest/user-data.

Permissions

info

This action requires the following IAM (Identity and Access Management) permissions:

  • compute.vm.update

Add a script or text to user data

You can include a script or additional data in the user data of a VM. This script can contain text variables and can be configured so that the VM runs a specific action on start, for example, automatically downloading a file from a bucket. This lets you customize and automate the actions of the VM as soon as it starts.

warning

User data must be encoded in Base64. The size of the Base64-encoded user data must not exceed 500 kibibytes (KiB).

This user data can be run on every start of the VM, if the VM contains a suitable script:

In the "Create VM" dialog box in the Numspot console:

  1. From the left-hand side menu, click ComputeVM to access the list of VM;
  2. Click the Create a VM button at the top right of the screen to launch the VM creation wizard;
  3. Follow the wizard steps up to the "User Data" step;
  4. Enter your user data in the field provided for this purpose;
  5. Continue creating the VM.
Cette page vous a-t-elle été utile ?