首页 » OpenStack系统架构设计实战 » OpenStack系统架构设计实战全文在线阅读

《OpenStack系统架构设计实战》2.8 nova-objectstore

关灯直达底部

Nova本身自带了一个对象存储服务nova-objectstore,nova-objectstore是一个简单的代码,仅仅模拟了对象存储的几个接口,使用本地文件系统来存储虚拟机镜像。真正大规模部署需要使用S3、Swift等模块。但在简单环境下,nova-objectstore也够用了。nova-objectstore将用户上传的虚拟机模板文件image存放于/var/lib/nova/images目录下,看以下/var/lib/nova/images内容:

[email protected]:/var/lib/nova/images# ls03aebd2e 0abf52fb 12fe2610 16cb8aa6 2e6b3fd1- 6217df26 644208f3 [email protected]:/var/lib/nova/images#

03aebd2e等目录对应的是镜像的ID,在真正的对象存储中,每个镜像都对应一个对象的ID,这里用文件夹来区分模拟。

[email protected]:/var/lib/nova/images/03aebd2e# lsimage [email protected]:/var/lib/nova/images/03aebd2e#

进一步到子目录里查看,镜像是对应的虚拟机文件,info.json描述了模拟的对象存储的属性信息。

[email protected]:/var/lib/nova/images/03aebd2e# cat info.json {"status": "active", "location": "/var/lib/nova/images/03aebd2e/image", "is_public": true, "container_format": "ami", "disk_format": "ami", "properties": {"kernel_id": 180310779, "image_location": "uecbucket/maverick-server-uec-amd64.img.manifest.xml", "image_state": "available", "project_id": "nubeblog", "architecture": "i386"}, "id": 61783342}[email protected]:/var/lib/nova/images/03aebd2e#

事实上,nova-compute在获取nova-objectstore上的镜像文件时更为简化,Nova会将/var/lib/nova/images目录使用NFS直接挂接到nova-compute节点上。

[email protected]:~# mount/dev/mapper/nova--controller-root on / type ext4 (rw,errors=remount-ro)proc on /proc type proc (rw,noexec,nosuid,nodev)none on /sys type sysfs (rw,noexec,nosuid,nodev)none on /sys/fs/fuse/connections type fusectl (rw)none on /sys/kernel/debug type debugfs (rw)none on /sys/kernel/security type securityfs (rw)none on /dev type devtmpfs (rw,mode=0755)none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)none on /dev/shm type tmpfs (rw,nosuid,nodev)none on /var/run type tmpfs (rw,nosuid,mode=0755)none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)/dev/cciss/c0d0p1 on /boot type ext1-(rw)10.46.169.194:/var/lib/nova/images on /var/lib/nova/images type nfs (rw,addr=10.46.169.194)[email protected]:~#