openstack on centos 7.1(block storage)

来源:互联网 发布:杜兰 金融 知乎 编辑:程序博客网 时间:2024/05/26 07:30

1.Install and configure controller node

Prerequisites

mysql -u root -pCREATE DATABASE cinder;GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'CINDER_DBPASS'; #Replace CINDER_DBPASS with a suitable passwordGRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY 'CINDER_DBPASS';exit;
. admin-openrcopenstack user create --domain default --password-prompt cinderopenstack role add --project service --user cinder adminopenstack service create --name cinder --description "OpenStack Block Storage" volumeopenstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2openstack endpoint create --region RegionOne volume public http://controller:8776/v1/%\(tenant_id\)sopenstack endpoint create --region RegionOne volume internal http://controller:8776/v1/%\(tenant_id\)sopenstack endpoint create --region RegionOne volume admin http://controller:8776/v1/%\(tenant_id\)sopenstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%\(tenant_id\)sopenstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%\(tenant_id\)sopenstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%\(tenant_id\)s

Install and configure components

yum install openstack-cinder

/etc/cinder/cinder.conf

[database]...connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder #Replace CINDER_DBPASS with the password you chose for the Block Storage database[DEFAULT]...rpc_backend = rabbitauth_strategy = keystonemy_ip = 10.0.0.11 #IP address of the controller node[oslo_messaging_rabbit]...rabbit_host = controllerrabbit_userid = openstackrabbit_password = RABBIT_PASS #Replace RABBIT_PASS with the password you chose for the openstack account in RabbitMQ[keystone_authtoken]...auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = cinderpassword = CINDER_PASS #Replace CINDER_PASS with the password you chose for the cinder user in the Identity service[oslo_concurrency]...lock_path = /var/lib/cinder/tmp
su -s /bin/sh -c "cinder-manage db sync" cinder

Configure Compute to use Block Storage

/etc/nova/nova.conf

[cinder]os_region_name = RegionOne

Finalize installation

systemctl restart openstack-nova-api.servicesystemctl enable openstack-cinder-api.service openstack-cinder-scheduler.servicesystemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

2.Install and configure a storage node

Prerequisites

yum install lvm2systemctl enable lvm2-lvmetad.servicesystemctl start lvm2-lvmetad.servicepvcreate /dev/sdbvgcreate cinder-volumes /dev/sdb

/etc/lvm/lvm.conf

devices {...filter = [ "a/sdb/", "r/.*/"]

Install and configure components

/etc/cinder/cinder.conf

[database]...connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder[DEFAULT]...rpc_backend = rabbitauth_strategy = keystonemy_ip = MANAGEMENT_INTERFACE_IP_ADDRESSenabled_backends = lvmglance_api_servers = http://controller:9292[oslo_messaging_rabbit]...rabbit_host = controllerrabbit_userid = openstackrabbit_password = RABBIT_PASS[keystone_authtoken]...auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = cinderpassword = CINDER_PASS[lvm]...volume_driver = cinder.volume.drivers.lvm.LVMVolumeDrivervolume_group = cinder-volumesiscsi_protocol = iscsiiscsi_helper = lioadm[oslo_concurrency]...lock_path = /var/lib/cinder/tmp

Finalize installation

systemctl enable openstack-cinder-volume.service target.servicesystemctl start openstack-cinder-volume.service target.service

Verify operation

. admin-openrccinder service-list
0 0
原创粉丝点击