概要:
在新建虚拟机的过程中,可以对root密码进行初始化。这样可以保障虚拟机的安全,同时也可以给用户自定义root密码的机会。
步骤:
修改控制节点的nova配置项:
首先修改nova的配置文件。文件位置 /etc/nova/nova.conf
将inject_password改为True
[libvirt]
# There is no agent needed within the image to do this. If *libguestfs* is
# available on the host, it will be used. Otherwise *nbd* is used. Thefile
# system of the image will be mounted and the admin password, which isprovided
# in the REST API call will be injected as password for the root user. Ifno
# root user is available, the instance won't be launched and an error isthrown.
# Be aware that the injection is *not* possible when the instance getslaunched
# from a volume.
#
# Possible values:
#
# * True: Allows the injec