You can add user data to an instance to more specifically configure it. User data can be of any type of information, like a script or text information. You can also specify tags to give precise instructions about the instance placement or IP addresses.   

User data are data linked to the instance by the user. An instance can access user data at any time but they are taken into account only at launch. However, you can create a script contained in the OMI used to launch an instance to require that user data are taken into account at every stop and start. This enables you to modify them, and then stop and start the instance for the modifications to be applied. For more information about how to modify user data, see Modifying an Instance Attribute.

To get information about the user data of an instance, type to the following address in the terminal of the instance or in a web browser: 169.254.169.254/latest/user-data.

The following procedures are available:


Adding a Script or Text in User Data

You can add a script or any other text information in the user data of an instance. Your script can contain text variables and can be used to have the instance execute any action you need at boot, for example to automatically download a file from an Object Storage Unit (OSU) bucket.

These user data can be executed every time the instance boots, if the instance contains a script that can do so:

  • In the Free section of the User Data screen in the CREATE INSTANCE dialog box (Expert Mode only) on Cockpit, or in the user-data attribute of the run-instances AWS CLI command:

    • For Linux instances, you need to create a script that fetches and executes the user data. For more information, see Creating an Autonomous Instance.
    • For Windows instances, you can type your script within one of the following wrappers to execute it at boot:

      LanguageWrapperDescription
      Powershell
      # autoexecutepowershellnopasswd
      <your_script>
      # autoexecutepowershellnopasswd 
      Executes the powershell script without init password administrator. The script is launched with the administrator user.
      Powershell
      # autoexecutepowershell
      <your_script>
      # autoexecutepowershell
      Executes the powershell script with init password administrator. The script is launched with the administrator user.
      Vbscript
      # autoexecutevbs
      <your_script>
      # autoexecutevbs
      Executes the vbscript script with init password administrator. The script is launched with the administrator user.


      If the boot script finds one of the above wrappers, it saves the script to a VB or PowerShell file in its /userdata and runs these files when the instance starts.

      You can separate the commands in a script using line breaks to run all the commands you want in the Windows PowerShell command prompt.


Adding 3DS OUTSCALE Tags in User Data

You can add 3DS OUTSCALE tags in user data to give instructions about the placement of your instances. You can for example place instances in a same server (also called hypervisor) or cluster (a set of hypervisors) to improve network performance, or place them in different clusters to reduce risks.  

You can also add these tags using the classic method. For more information, see Adding or Removing Tags.


  1. If you are using AWS CLI, create a section for all your 3DS OUTSCALE tags following this syntax:

    -----BEGIN OUTSCALE SECTION-----
    <tags>
    -----END OUTSCALE SECTION-----
     


    - Do not add a blank space at the end of each line.
    - Insert a carriage return at the end of the code. Otherwise, the last line is not read properly.  


     If you are using Cockpit, this section is already created.


  2. Add your tags within this section following the tags.TAG_NAME=TAG_VALUE format. 
    The following tags are available:

    • Tags to specify ins tructions about the placement of an instance: 


      Tag NameDescriptionTag ValueApplication

      osc.fcu.repulse_server

      Places instances with the same tag value on different serversFree
      • At instance launch
      • After a stop/start

      osc.fcu.attract_server

      Places instances with the same tag value on the same server

      osc.fcu.repulse_cluster

      Places instances with the same tag value on different Cisco UCS clusters

      osc.fcu.attract_cluster

      Places instances with the same tag value on the same Cisco UCS cluster


      These tags can be used in strict mode, which means that if the requested placement options are not possible, an InsufficientCapacity error is returned. If you do not use strict mode, the requested placement options are bypassed if they are not possible.

      To define strict mode, add _strict to the tag name (for example, osc.fcu.repulse_server_strict).


      In the following example, instance#1 and instance#2 are placed on the same server, if possible: 

      INSTANCE#1 USER DATA
      -----BEGIN OUTSCALE SECTION-----
      tags.osc.fcu.attract_server=front80
      -----END OUTSCALE SECTION-----
      
      INSTANCE#2 USER DATA
      -----BEGIN OUTSCALE SECTION-----
      tags.osc.fcu.attract_server=front80
      -----END OUTSCALE SECTION-----
       


      In the following example, instance#3 and instance#4 are placed on different servers, and an error occurs if not possible:

      INSTANCE#3 USER DATA
      -----BEGIN OUTSCALE SECTION-----
      tags.osc.fcu.repulse_server_strict=front80
      -----END OUTSCALE SECTION-----
      
      INSTANCE#4 USER DATA
      -----BEGIN OUTSCALE SECTION-----
      tags.osc.fcu.repulse_server_strict=front80
      -----END OUTSCALE SECTION-----
       


    • Tags to manage IP addresses associated with an instance:


      Tag NameDescriptionTag ValueApplication

      osc.fcu.eip.auto-attach

      Automatically associates an External IP address with an instance, and keeps them associated through the stop and start process

      The external IP address (EIP) you want to associate.

      For more information, see About EIPs > EIP Association.

      • At instance launch
      • After a stop/start
      private_onlyBlocks attribution of a public IP to an instance in the public Cloudtrue or false
      • At instance launch

      In the following example, the 111.33.22.100 External IP address is attached and fixed to the instance: 

      -----BEGIN OUTSCALE SECTION-----
      tags.osc.fcu.eip.auto-attach=111.33.22.100
      -----END OUTSCALE SECTION-----
       

      If the instance is already started, you need to add the following as EC2 tag, before stopping and restarting the instance (no reboot):

      osc.fcu.eip.auto-attach:111.33.22.100




Windows® is a registered trademark of Microsoft Corporation in the United States and/or other countries.

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.

See Legal Mentions.