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  

相关内容

热门资讯

2分钟德州透视挂!hhpoke... 2分钟德州透视挂!hhpoker开挂教程,德州透视插件,详细教程(有挂功能)1、完成德州透视插件透视...
九分钟开辅助!wepoker辅... 九分钟开辅助!wepoker辅助软件价格(透视底牌)详细辅助程序(本来是真的有挂)1、任何wepok...
9分钟透视插件!hh poke... 9分钟透视插件!hh poker软件,hhpoker是正品吗,详细教程(有挂智能)1、hh poke...
7分钟插件辅助!wepoker... 7分钟插件辅助!wepoker买钻石有用吗(透视底牌)详细辅助插件(果然是有挂)7分钟插件辅助!we...
八分钟作弊实战!hhpoker... 八分钟作弊实战!hhpoker脚本,hhpoker辅助靠谱吗,详细教程(有挂安装)1、完成hhpok...
二分钟苹果版!wepoker有... 二分钟苹果版!wepoker有辅助器吗(透视底牌)详细辅助免费(切实真的是有挂)1、点击下载安装,插...
八分钟破解工具!德州透视hhp... 八分钟破解工具!德州透视hhpoker,hh poker辅助器先试用,详细教程(有挂插件)1、该软件...
二分钟作弊!wepoker私人... 二分钟作弊!wepoker私人局可以透视(透视底牌)详细辅助作弊器(本来真的有挂);暗藏猫腻,小编详...
五分钟外挂!德扑HHpoker... 五分钟外挂!德扑HHpoker有挂吗(透视脚本)详细辅助助手(确实真的是有挂)1、任何ai辅助神器的...
5分钟新号!wepoker透视... 5分钟新号!wepoker透视器免费(透视底牌)详细辅助外挂(确实是真的有挂)1、打开软件启动之后找...