glance对接nfs,cinder,swift 后端
创始人
2024-12-04 09:33:24
0

欢迎来交流!!!!!!!!!!!!!!!


glance对接nfs后端存储

配置该主机为nfs的server端,将该云主机中的/mnt/test目录进行共享(目录不存在可自行创建)。然后配置controller节点为nfs的client端,要求将/mnt/test目录作为glance后端存储的挂载目录。

环境

系统角色ip
centos7.9nfs10.196.110.86
centos7.9controller10.196.110.32

安装步骤

安装nfs服务
[root@nfs ~]# yum -y install nfs-utils 
修改NFS的配置文件 /etc/exports
[root@nfs ~]# vi /etc/exports /mnt/test *(ro,rw,no_root_squash) 

访问/mnt/test 主机用root用户身份访问该共享目录时,不映射root用户(no_root_squash),即相当于在服务器上用root身份访问该目录

(1) Ro 该主机对该共享目录有只读权限

(2) Rw 该主机对该共享目录有读写权限

(3) No_root_squash 客户机用root访问该共享文件夹时,不映射root用户

[root@nfs ~]# exportfs -r  刷新  exportfs命令 常用选项 -a 全部挂载或者全部卸载 -r 重新挂载 -u 卸载某一个目录 -v 显示共享目录 
验证测试
[root@nfs ~]# showmount -e Export list for nfs: /mnt/test     
glance连接nfs
挂载nfs [root@controller ~]# mount -t  nfs 10.196.110.86:/mnt/test /var/lib/glance/images/  给文件为glance用户  不然无法访问  如果不能给检测上面的配置文件 [root@controller ~]# chown glance:glance /var/lib/glance/images/  创建镜像测试是否有问题 [root@controller ~]# openstack image create cirros < cirros-0.3.4-x86_64-disk.img  [root@controller ~]# ls /var/lib/glance/images/ 8979d0ee-63b9-4ebf-be41-0a67b571675d  

glance对接cinder后端存储

使glance可以使用cinder作为后端存储,将镜像存储于cinder卷中。使用cirros-0.3.4-x86_64-disk.img文件创建cirros-image镜像存储于cirros-cinder卷中,通过cirros-image镜像使用cinder卷启动盘的方式进行创建虚拟机。

环境

系统角色ip
centos7.9controller10.196.110.32

修改glance配置文件

[root@controller ~]# vi /etc/glance/glance-api.conf  show_multiple_locations = true  [glance_store] #stores = file,http #demo_store = file #filesystem_store_datadir = /var/lib/glance/images/  stores = cinder default_store=cinder  [root@controller ~]# systemctl restart openstack-glance*  

修改cinder配置文件

[root@controller ~]# vi /etc/cinder/cinder.conf  allowed_direct_url_schemes = cinder image_upload_use_cinder_backend = true image_upload_use_internal_tenant = true  #重启服务 [root@controller ~]# systemctl restart openstack-cinder*  

测试

[root@controller ~]# openstack image create cirros < cirros-0.3.4-x86_64-disk.img   [root@controller ~]# cinder list   +--------------------------------------+-----------+--------------------------------------------+------+-------------+----------+-------------+ | ID                                   | Status    | Name                                       | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+--------------------------------------------+------+-------------+----------+-------------+ | 527a11ff-5a45-4d72-8bbe-8e6a2215342d | available | image-dca0685f-4261-475f-80cd-f6f868b96741 | 1    | -           | false    |             | +--------------------------------------+-----------+--------------------------------------------+------+-------------+----------+-------------+ [root@controller ~]#   

glance对接swift后端存储

使用Swift对象存储服务,修改相应的配置文件,使对象存储Swift作为glance镜像服务的后端存储,使默认上传的镜像会在swift中创建chinaskill_glance容器。

环境

系统角色ip
centos7.9controller10.196.110.32

修改glance配置文件

[root@controller ~]# cat /etc/glance/glance-api.conf  | grep "#swift" [root@controller ~]# vi /etc/glance/glance-api.conf   [glance_store] swift_store_container = glance swift_store_create_container_on_put = true swift_store_multi_tenant = true swift_store_admin_tenants = service swift_store_user = glance swift_store_key = 000000  stores = swift default_store=swift  [root@controller ~]# openstack-service restart glance  

测试

[root@controller ~]# openstack image create test < cirros-0.3.4-x86_64-disk.img [root@controller ~]# swift list  chinaskill_glance_27981d9d-836f-4683-830f-975044d84e09  

相关内容

热门资讯

黑科技辅助!we-poker辅... 黑科技辅助!we-poker辅助软件演示,(wepoke好友房)先前真的是有挂,wpk教程(确实有挂...
发现一款!wepoker可以开... 【福星临门,好运相随】;发现一款!wepoker可以开透视,werplan外卦神器,揭秘教程(有挂攻...
盘点十款!红龙扑克辅助器(红龙... 盘点十款!红龙扑克辅助器(红龙扑克辅助器)往昔真的有挂(2026已更新)(哔哩哔哩),红龙扑克辅助器...
重磅来袭(WPK新版)wpk外... 重磅来袭(WPK新版)wpk外挂是真的还是假的(WpK)原生存在有挂(2020已更新)(哔哩哔哩)是...
黑科技辅助!wepoke软件透... 黑科技辅助!wepoke软件透明是真的,(Wepoke实测)往昔是真的有挂,攻略教程(有挂秘笈)-哔...
一起来探讨!德普辅助器可以用,... 一起来探讨!德普辅助器可以用,wepokerplus到底是挂了,透明教程(真实有挂)-哔哩哔哩相信很...
黑科技辅助(Wepoke存在)... 您好,Wepoke存在这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多玩家在...
重要通知!wepoke 软件(... 重要通知!wepoke 软件(WePoKe挂真的)从前有挂技术(2024已更新)(哔哩哔哩);AI辅...
黑科技辅助!扑克王辅助工具,(... 黑科技辅助!扑克王辅助工具,(扑克世界)都是是有挂,揭秘攻略(有挂存在)-哔哩哔哩;黑科技辅助!扑克...
实测发现!约局吧开挂神器是真的... 实测发现!约局吧开挂神器是真的,hhpoker有作弊辅助,力荐教程(有挂功能)-哔哩哔哩;1.约局吧...