为实例提供用户数据。

为实例提供用户数据。

任意**用户数据**(user data). 用户数据是元数据服务中一个特殊的键,映射一个可供客户机中云应用访问的文件。例如,一个使用了用户数据的应用是`cloud-init <https://help.ubuntu.com/community/CloudInit>`__系统。这是一个Ubuntu系统使用的开源包,也应用于多个Linux发行版,用于执行实例初始化相关处理。

当虚拟机启动时,通过``–user-data <user-data-file>``参数用本地文件为虚拟机传递用户数据。

$ openstack server create --image ubuntu-cloudimage --flavor 1 \
  --user-data mydata.file VM_INSTANCE
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.