Skip to content

Latest commit

 

History

History
311 lines (222 loc) · 5.53 KB

08-cinder.md

File metadata and controls

311 lines (222 loc) · 5.53 KB

Install Cinder

Cinder logo

1: CONTROLLER NODE

  • Access database as root:
mysql
  • Create cinder database:
CREATE DATABASE cinder;
  • Grant proper access to cinder user:
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' identified by 'password123';
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' identified by 'password123';
exit
  • Source .adminrc
source .adminrc
  • Create cinder user and add role:
openstack user create --domain default --password password123 cinder

openstack role add --project service --user cinder admin
  • Create cinder v2 services:
openstack service create --name cinderv2 \
  --description "Openstack Block Storage" volumev2

openstack service create --name cinderv3 \
  --description "Openstack Block Storage" volumev3
  • Create service API endpoints:
for i in public internal admin; \
  do openstack endpoint create --region RegionOne \
  volumev2 $i http://controller:8776/v2/%\(project_id\)s; \
  done

for i in public internal admin; \
  do openstack endpoint create --region RegionOne \
  volumev3 $i http://controller:8776/v3/%\(project_id\)s; \
  done
  • Install packages:
apt install cinder-api cinder-scheduler -y
  • Backup an sanitize /etc/cinder/cinder.conf:
cp -p /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak
grep -Ev '^(#|$)' /etc/cinder/cinder.conf.bak|sed '/^\[.*]/i \ '|tail -n +2 > /etc/cinder/cinder.conf
  • Edit /etc/cinder/cinder.conf sections:
[database]
# ...
connection = mysql+pymysql://cinder:password123@controller/cinder

[DEFAULT]
# ...
transport_url = rabbit://openstack:password123@controller
auth_strategy = keystone
my_ip = 10.10.10.11

[keystone_authtoken]
# ...
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = password123

[oslo_concurrency]
# ...
lock_path = /var/lib/cinder/tmp
  • Fix packaging bug
install -d /var/lib/cinder/tmp -o cinder -g cinder
  • Populate database
su -s /bin/sh -c "cinder-manage db sync" cinder
  • Configure compute to use cinder. Edit /etc/nova/nova.conf:
[cinder]
os_region_name = RegionOne
  • Finalize install
service nova-api restart
systemctl enable cinder-scheduler
service cinder-scheduler restart
service apache2 restart

2. STORAGE NODE

  • Install packages:
apt install lvm2 thin-provisioning-tools -y
apt install cinder-volume -y
  • Create LVM volumes. Use appropriate block device name instead of /dev/vdb
pvcreate /dev/vdb

vgcreate cinder-volumes /dev/vdb
  • Create LVM filter
devices {
...
filter = [ "a/sdb/", "r/.*/" ]
  • If LVM used on OS, include those vols. Do same on compute nodes:
filter = [ "a/sda/", "a/sdb/", "r/.*/" ]
  • Backup an sanitize /etc/cinder/cinder.conf:
cp -p /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak
grep -Ev '^(#|$)' /etc/cinder/cinder.conf.bak|sed '/^\[.*]/i \ '|tail -n +2 > /etc/cinder/cinder.conf
  • Edit /etc/cinder/cinder.conf sections:
[database]
# ...
connection = mysql+pymysql://cinder:password123@controller/cinder

[DEFAULT]
# ...
transport_url = rabbit://openstack:password123@controller
auth_strategy = keystone
my_ip = 10.10.10.14
enabled_backends = lvm
glance_api_servers = http://controller:9292

# comment these out... will add in lvm section
#iscsi_helper = lioadm
#volume_name_template = volume-%s
#volume_group = cinder-volumes

[keystone_authtoken]
# ...
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = password123

[lvm]
# ...
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
volume_name_template = volume-%s
target_protocol = iscsi
target_helper = lioadm

[oslo_concurrency]
# ...
lock_path = /var/lib/cinder/tmp
  • Finalize Install
systemctl enable cinder-volume
service cinder-volume restart
  • Verify Ops
source .adminrc

openstack volume service list

openstack volume create --size 1 test-vol

openstack volume list

openstack volume delete test-vol

Configure Backup Service

  • Do this AFTER swift install
  1. Install packages
apt install cinder-backup -y
  1. Get swift url
openstack catalog show object-store
  1. Edit /etc/cinder/cinder.conf:
[DEFAULT]
# ...
backup_driver = cinder.backup.drivers.swift.SwiftBackupDriver
backup_swift_url = SWIFT_URL
swift_catalog_info = object-store:swift:publicURL

# OR WAY SIMPLER TO USE FILE BASED BACKUPS FOR TESTING

backup_driver = cinder.backup.drivers.posix.PosixBackupDriver
  1. Finalize install
systemctl enable cinder-backup
service cinder-backup restart

Enable backups in horizon

  1. Modify settings in /etc/openstack-dashboard/local_settings.py:
OPENSTACK_CINDER_FEATURES = {
  "enable_backup": True
}
service apache2 restart
  1. Verify ops
sourc ~/.adminrc

openstack volume create --size 1 bu-test-vol

openstack volume backup create --name bu-test-vol-backup bu-test-vol

openstack volume backup list

openstack container list

openstack volume backup delete bu-test-vol-backup

openstack volume delete bu-test-vol