openstack使用官方镜像不知道密码的问题

在/etc/nova/nova.conf中添加并重启nova服务

[libvirt]
virt_type = qemu
inject_password = true #新增

#重启
systemctl restart openstack-nova-compute.service

给镜像添加新的元数据key-value

glance image-list
glance image-update 477dcfca-f0e9-41e2-9d98-3108cd0be03a --property hw_qemu_guest_agent=yes

最后重置instance密码(需要修改完镜像元数据后重新创建instance)

openstack server set --root-password serverid

方式二:
https://blog.csdn.net/liudongyang123/article/details/126622682

方式三:
在/etc/openstack-dashborad/local_settings中添加
在这里插入图片描述
重启

systemctl restart httpd.service memcached.service

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
使用Ansible调用OpenStack API下载镜像,需要使用以下步骤: 1. 安装python-openstackclient和python-novaclient: ``` $ sudo pip install python-openstackclient python-novaclient ``` 2. 创建一个名为“download_image.yaml”的YAML文件,并在其中定义以下Playbook: ```yaml - hosts: localhost gather_facts: no tasks: - name: Download image os_compute_api: auth: auth_url: "{{ auth_url }}" username: "{{ username }}" password: "{{ password }}" project_name: "{{ project_name }}" project_domain_name: "{{ project_domain_name }}" user_domain_name: "{{ user_domain_name }}" api_version: 2 endpoint_type: public service_name: compute resource: servers server: "{{ server_name }}" action: image.create image_name: "{{ image_name }}" disk_format: "{{ disk_format }}" container_format: "{{ container_format }}" ``` 3. 在上面的Playbook中,将以下变量替换为OpenStack API的凭据和要下载的镜像的详细信息: ``` auth_url: OpenStack API的认证URL username: OpenStack API的用户名 password: OpenStack API的密码 project_name: OpenStack API的项目名称 project_domain_name: OpenStack API的项目域名 user_domain_name: OpenStack API的用户域名 server_name: 要下载镜像的实例名称 image_name: 要下载的镜像名称 disk_format: 镜像的磁盘格式(例如qcow2) container_format: 镜像的容器格式(例如bare) ``` 4. 运行以下命令以使用上述Playbook: ``` $ ansible-playbook download_image.yaml ``` 这将调用OpenStack API并下载指定的镜像
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值