← 返回命令列表

Linux command

cloud-init 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Example

cloud-init status

Wait

cloud-init status --wait

List

cloud-init query --list-keys

Query

cloud-init query [dot_delimited_variable_path]

Clean

cloud-init clean

Analyze

cloud-init analyze show

Validate

cloud-init schema --config-file [path/to/config.yaml]

说明

cloud-init is the industry standard for cloud instance initialization across all major cloud providers and Linux distributions. It handles early initialization of cloud instances including networking configuration, storage setup, SSH key injection, user account creation, and package installation. Cloud-init reads configuration from various datasources including cloud provider metadata services, user-data scripts, and local configuration files. It runs during the boot process in multiple stages to ensure proper ordering of system configuration tasks. The tool supports cloud-config YAML for declarative configuration, shell scripts for imperative setup, and can be extended with custom modules. It provides commands for querying instance metadata, validating configurations, and troubleshooting initialization issues.

参数

init
Initialize cloud-init and perform initial modules
modules
Activate modules using a given configuration key
single
Run a single module
status
Report cloud-init status
query _key_
Query instance metadata
clean
Remove logs and artifacts to allow re-run on next boot
collect-logs
Gather debugging information into a tarball
analyze
Analyze cloud-init boot performance
schema
Validate cloud-config files
features
List defined features supported by this version

FAQ

What is the cloud-init command used for?

cloud-init is the industry standard for cloud instance initialization across all major cloud providers and Linux distributions. It handles early initialization of cloud instances including networking configuration, storage setup, SSH key injection, user account creation, and package installation. Cloud-init reads configuration from various datasources including cloud provider metadata services, user-data scripts, and local configuration files. It runs during the boot process in multiple stages to ensure proper ordering of system configuration tasks. The tool supports cloud-config YAML for declarative configuration, shell scripts for imperative setup, and can be extended with custom modules. It provides commands for querying instance metadata, validating configurations, and troubleshooting initialization issues.

How do I run a basic cloud-init example?

Run `cloud-init status` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does init do in cloud-init?

Initialize cloud-init and perform initial modules