CentOS7云镜像:注入实例的root密码

默认OpenStack的Dashboard修改虚拟机的密码的功能是关闭的,你需要enable。
1.
配置 can_set_password :
[root@controller ~]# vim /etc/openstack-dashboard/local_settings
......
OPENSTACK_HYPERVISOR_FEATURES = {
    'can_set_mount_point': False,
    'can_set_password':  True,
    'requires_keypair': False,
}
......
重启 httpd 服务:
[root@controller ~]# systemctl restart httpd.service memcached.service

这时候你就可以看到设置管理员密码的地方:

不过这个时候,你可能还是不能修改密码。你需要修改计算节点的nova.conf文件
[root@compute2 ~]# vi /etc/nova/nova.conf
......
[libvirt]
......
# Inject the admin password at boot time, without an agent. (boolean value)
inject_password=true
......
# The partition to inject to : -2 => disable, -1 => inspect (libguestfs only),
# 0 => not partitioned, >0 => partition number (integer value)
inject_partition=-1
......
重启服务:
[root@compute2 ~]# systemctl restart libvirtd.service openstack-nova-compute.service

这样,就可以在创建instance时,在‘管理员密码’处设置root的密码了。


你可能感兴趣的:(云计算)