By default, an Elastic Compute Service (ECS) instance uses an initialization tool to automatically perform predefined configuration tasks, such as network configuration, hostname assignment, and custom script execution, when the instance is created or started. Different types of operating systems use different initialization tools. A Linux instance uses the cloud-init tool for automatic initialization, and a Windows instance uses the Vminit tool for automatic initialization. This topic describes the initialization tools that are used in Linux instances and Windows instances.
Cloud-init
A Linux instance uses the open source cloud-init tool to complete automatic initialization. For more information, see Cloud-init documentation.
Cloud-init defines a series of modules to execute tasks and configurations. Each module has the following elements: name, running frequency, and configuration parameters. The running frequency indicates the frequency at which a module is run. In most cases, the once-per-instance and always running frequencies are used. The
once-per-instance
running frequency indicates that a module is run only once the first time an ECS instance is started. Thealways
running frequency indicates that a module is run each time an ECS instance is started. For more information, see Module reference.Cloud-init uses the
/etc/cloud/cloud.cfg
configuration file to control the initialization behavior of an ECS instance, such as determining which modules to run. When modules are run, cloud-init can obtain metadata, such as the instance ID and hostname of an ECS instance, from the metadata service. For example, when an ECS instance is started, cloud-init runs the Set Hostname module to obtain the hostname of the instance from the metadata service and set the hostname of the instance to the obtained hostname.
Cloud-init is installed in all Alibaba Cloud public images and in custom images that are created based on the public images. If you create ECS instances from the images, cloud-init is automatically installed on the instances. If you use custom images that are created based on on-premises devices to create ECS instances and cloud-init is not installed in the images, you must manually install cloud-init on the instances. For information about how to install cloud-init, see Install cloud-init.
Vminit
A Windows instance uses the Vminit initialization tool to complete automatic initialization. Vminit executes a series of plug-ins in sequence to complete system initialization configurations. Several plug-ins are executed only once the first time an ECS instance is started. Other plug-ins are executed each time the instance is started. By default, all Vminit plug-ins are automatically executed to initialize an ECS instance when the instance is created from a Windows image.
Vminit is installed in Windows public images released in September 2023 and later and in custom images created based on the Windows public images. If you create ECS instances from the images, Vminit is automatically installed on the instances. If you use custom images that are created based on on-premises devices to create ECS instances and Vminit is not installed in the images, you must manually install Vminit on the instances. This ensures that the ECS instances can complete initialization configurations. For more information, see Install Vminit.
The following table describes 10 Vminit plug-ins.
Release notes
Vminit is updated from time to time. The following table describes the release information of Vminit versions.
Vminit version | Release content | Release date |
2.0.1.2 |
| January 2024 |
2.0.1.0 | The first release. Configurable plug-ins were supported. | September 2023 |
References
You can use instance user data to initialize an ECS instance when you create the instance. For more information, see Customize initialization configurations for an instance.
For information about how to install and use initialization tools when you create images, see Install cloud-init and Install Vminit.