Updated on 2024-06-11 GMT+08:00

Cloud-Init

Cloud-Init is an open-source cloud initialization program, which initializes some of the customized configurations of a newly created ECS, such as the hostname, key pair, and user data.

Using Cloud-Init to initialize your ECSs will affect your ECS, IMS, and AS services.

Impact on IMS

To ensure that ECSs created using a private image support custom configurations, you must install Cloud-Init on the ECSs before using them to create private images.

After being installed in an image, Cloud-Init automatically configures initial attributes for the ECSs created using this image.

For more information, see Installing Cloud-Init.

Impact on ECS

  • When creating an ECS, if the selected image supports Cloud-Init, you can use the User Data function to specify custom configuration, such as ECS login password to the ECS. Such custom settings will take effect upon ECS initialization.
  • If Cloud-Init is supported, you can view and use metadata to configure and manage running ECSs.

Impact on AS

  • When creating an AS configuration, you can use the User Data function to specify ECS configurations for initialization. If the AS configuration has taken effect in an AS group, the ECSs newly created in the AS group will automatically initialize their configurations based on the specified ECS configurations.
  • For an existing AS configuration, if its private image does not have Cloud-Init or Cloudbase-Init installed, the login mode of the ECSs created in the AS group where the AS configuration takes effect may fail to take effect.

    To resolve this issue, see How Does Cloud-Init Affect the AS Service? in Auto Scaling User Guide.

Notes

  • When using Cloud-Init, enable DHCP in the VPC to which the ECS belongs.
  • When using Cloud-Init, ensure that security group rules for the outbound direction meet the following requirements:
    • Protocol: TCP
    • Port: 80
    • Destination: 169.254.0.0/16

    If you use the default security group rules for the outbound direction, the metadata can be accessed because the default rules meet the preceding requirements. For details about the default security group rules for the outbound direction, see Security Group.