改变cinder默认vg的方法


在存储节点:
# pvcreate /dev/sdb
# vgcreate vg100gb /dev/sdb


# openstack-config --set /etc/cinder/cinder.conf DEFAULT volume_group vg100gb
# chkconfig --list|grep cinder|awk '{print "service "$1" restart"}'
service openstack-cinder-api restart
service openstack-cinder-backup restart
service openstack-cinder-scheduler restart
service openstack-cinder-volume restart


在控制节点:
# source demo-openrc.sh
# cinder create --display-name demo-volume1 1
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
|      created_at     |      2015-12-30T14:54:15.337702      |
| display_description |                 None                 |
|     display_name    |             demo-volume1             |
|      encrypted      |                False                 |
|          id         | ae0fe7e4-8db6-4b95-b2ae-f98c7ebca920 |
|       metadata      |                  {}                  |
|         size        |                  1                   |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|     volume_type     |                 None                 |
+---------------------+--------------------------------------+

# cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| ae0fe7e4-8db6-4b95-b2ae-f98c7ebca920 | available | demo-volume1 |  1   |     None    |  false   |             |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+


在存储节点:
# lvs -S vg_name=vg100gb
  LV                                          VG      Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  volume-ae0fe7e4-8db6-4b95-b2ae-f98c7ebca920 vg100gb -wi-a----- 1.00g


本文写的是默认vg,还可以添加额外的vg:
http://fatmin.com/2015/04/28/openstack-cinder-add-additional-backend-volumes/comment-page-1/

 

posted @ 2015-12-30 15:02  Endoresu  阅读(389)  评论(0编辑  收藏  举报