安装cinder服务
在存储节点安装cinder服务
- apt-get install -y cinder-api cinder-scheduler cinder-volume open-iscsi tgt Python-cinderclient
硬盘专门一个分区给volume使用
- pvcreate /dev/sda5
- vgcreate cinder-volumes /dev/sda5
编辑 /etc/cinder/cinder.conf ,直接运行下面命令就可以
- [DEFAULT]
- rootwrap_config = /etc/cinder/rootwrap.conf
- sql_connection = mysql://cinder:cinder-pass@192.168.4.164:3306/cinder
- api_paste_confg = /etc/cinder/api-paste.ini
- iscsi_helper = ietadm
- volume_group = cinder-volumes
- volumevolume_name_template = volume-%s
- rabbitrabbit_password = rabbit-pass
- logdir = /var/log/cinder
- verbose = False
- auth_strategy = keystone
编辑 /etc/cinder/api-paste.ini
- admin_tenant_name = service
- admin_user = cinder
- admin_password = cinder
同步数据库
- cinder-manage db sync
重启服务
- service cinder-api restart
- service cinder-scheduler restart
- service cinder-volume restart
nova 命令创建额外存储
volume-attach Attach a volume to a server.
volume-create Add a new volume.
volume-delete Remove a volume.
volume-detach Detach a volume from a server.
volume-list List all the volumes.
volume-show Show details about a volume.
创建
显示volume
显示虚拟机
挂载
显示volume
挂好的显示 in-use
卸载
显示volume
进入虚拟机就会看到 /dev/下面多了个磁盘文件







