Fine-tune config and services for cinder

This commit is contained in:
Corey Bryant 2017-07-19 21:06:58 +00:00
parent bbe58f037b
commit b974d14039
8 changed files with 80 additions and 62 deletions

View File

@ -2,7 +2,8 @@
This repository contains the source code for the cinder snap.
Cinder provides on demand, self-service access to software defined block Storage resources on top of various traditional backend block storage devices.
Cinder provides on demand, self-service access to software defined block
storage resources on top of various traditional backend block storage devices.
## Installing this snap
@ -20,15 +21,17 @@ should result in an experience such as:
sudo snap install --channel=ocata/stable cinder
sudo snap install --channel=pike/edge cinder
This snap can make use of the Linux SCSI target user-space daemon running on the
host operating system when using the LVM backend. To do this, the tgt package
must be installed:
sudo apt install tgt
## Configuring cinder
The cinder snap gets its default configuration from the following $SNAP
and $SNAP_COMMON locations:
### Insert trees of /snap/cinder/current/etc/ and
### /var/snap/cinder/common/etc. If the OpenStack service has an API
### that runs behind uwsgi+nginx, the trees may like like this:
/snap/cinder/current/etc/
└── cinder
   ├── cinder.conf
@ -47,10 +50,8 @@ and $SNAP_COMMON locations:
└── snap
  └── cinder-api.ini
### Add any details here on how to configure services for this snap.
### Insert a tree of /var/snap/cinder/common/etc with override files.
### If the OpenStack service has an API that runs behind uwsgi+nginx,
### the tree may like like this:
The cinder applications can be configured in a few ways. The directory
structure can be modified to override config as follows:
The cinder snap supports configuration updates via its $SNAP_COMMON writable
area. The default cinder configuration can be overridden as follows:
@ -60,6 +61,8 @@ area. The default cinder configuration can be overridden as follows:
│   ├── cinder.conf.d
│   │   ├── cinder-snap.conf
│   │   ├── database.conf
│   │   ├── keystone.conf
│   │   ├── lvm.conf
│   │   └── rabbitmq.conf
│   └── cinder.conf
├── nginx

View File

@ -1,4 +1,3 @@
# The cinder snap may need to override default config files.
# For example if the default cinder.conf file located in
# $SNAP/etc/cinder/cinder.conf needs to be overridden,
# it can be done with this file.
# Snap distribution defaults - do not change, override in $SNAP_COMMON/etc/cinder.conf.d
[database]
max_retries = -1

View File

@ -1,27 +1,27 @@
setup:
dirs:
- "{snap_common}/etc/cinder/cinder.conf.d"
- "{snap_common}/lib"
- "{snap_common}/lock"
- "{snap_common}/log"
- "{snap_common}/run"
# If the OpenStack service has an API that runs behind uwsgi+nginx,
# define uwsgi and nginx etc dirs.
- "{snap_common}/etc/nginx/sites-enabled"
- "{snap_common}/etc/nginx/snap/sites-enabled"
- "{snap_common}/etc/uwsgi/snap"
- "{snap_common}/lib/volumes"
- "{snap_common}/lock"
- "{snap_common}/log"
- "{snap_common}/run"
templates:
# The cinder snap will likely require a template for the corresponding
# OpenStack service(s). For example, you may need to render a template such
# as the following.
cinder-snap.conf.j2: "{snap_common}/etc/cinder/cinder.conf.d/cinder-snap.conf"
# If the OpenStack service has an API that runs behind uwsgi+nginx,
# render nginx config templates.
cinder-nginx.conf.j2: "{snap_common}/etc/nginx/snap/sites-enabled/cinder.conf"
cinder-snap.conf.j2: "{snap_common}/etc/cinder/cinder.conf.d/cinder-snap.conf"
nginx.conf.j2: "{snap_common}/etc/nginx/snap/nginx.conf"
entry_points:
# This is where entry_points are defined for the OpenStack service. For example,
# the service may have a database command-line tool such as the following.
cinder-backup:
binary: "{snap}/bin/cinder-backup"
config-files:
- "{snap}/etc/cinder/cinder.conf"
config-files-override:
- "{snap_common}/etc/cinder/cinder.conf"
config-dirs:
- "{snap_common}/etc/cinder/cinder.conf.d"
log-file: "{snap_common}/log/cinder-backup.log"
cinder-manage:
binary: "{snap}/bin/cinder-manage"
config-files:
@ -30,8 +30,24 @@ entry_points:
- "{snap_common}/etc/cinder/cinder.conf"
config-dirs:
- "{snap_common}/etc/cinder/cinder.conf.d"
# If the OpenStack service has an API that runs behind uwsgi+nginx, the
# following entry_point must be defined.
cinder-scheduler:
binary: "{snap}/bin/cinder-scheduler"
config-files:
- "{snap}/etc/cinder/cinder.conf"
config-files-override:
- "{snap_common}/etc/cinder/cinder.conf"
config-dirs:
- "{snap_common}/etc/cinder/cinder.conf.d"
log-file: "{snap_common}/log/cinder-scheduler.log"
cinder-volume:
binary: "{snap}/bin/cinder-volume"
config-files:
- "{snap}/etc/cinder/cinder.conf"
config-files-override:
- "{snap_common}/etc/cinder/cinder.conf"
config-dirs:
- "{snap_common}/etc/cinder/cinder.conf.d"
log-file: "{snap_common}/log/cinder-volume.log"
cinder-uwsgi:
type: uwsgi
uwsgi-dir: "{snap_common}/etc/uwsgi/snap"
@ -46,8 +62,6 @@ entry_points:
log-file: "{snap_common}/log/cinder-api.log"
templates:
cinder-api.ini.j2: "{snap_common}/etc/uwsgi/snap/cinder-api.ini"
# If the OpenStack service has an API that runs behind uwsgi+nginx, the
# following entry_point must be defined.
cinder-nginx:
type: nginx
config-file: "{snap_common}/etc/nginx/snap/nginx.conf"

View File

@ -1,11 +1,6 @@
# If the OpenStack service has an API that runs behind uwsgi+nginx, you'll need
# to define this template. Be sure to update the path for the wsgi-file and
# "api-name" for the socket. You may also want to rename this file according to
# the service it provides, and you may even need to provide multiple uwsgi files
# if there is more than one wsgi application.
[uwsgi]
wsgi-file = {{ snap }}/bin/cinder-wsgi-file-name
uwsgi-socket = {{ snap_common }}/run/api-name.sock
wsgi-file = {{ snap }}/bin/cinder-wsgi
uwsgi-socket = {{ snap_common }}/run/cinder-api.sock
buffer-size = 65535
master = true
enable-threads = true

View File

@ -1,14 +1,10 @@
# If the OpenStack service has an API that runs behind uwsgi+nginx, you'll need
# to define this template. Be sure to update "listen" with the port number and
# also update "api-name" for the socket.
server {
listen 1234;
listen 8776;
access_log {{ snap_common }}/log/nginx-access.log;
error_log {{ snap_common }}/log/nginx-error.log;
location / {
include uwsgi_params;
include {{ snap }}/usr/conf/uwsgi_params;
uwsgi_param SCRIPT_NAME '';
uwsgi_pass unix://{{ snap_common }}/run/api-name.sock;
uwsgi_pass unix://{{ snap_common }}/run/cinder-api.sock;
}
}

View File

@ -1,7 +1,10 @@
[DEFAULT]
# Set state path to writable directory
state_path = /lib
state_path = {{ snap_common }}/lib
# Set volume configuration file storage directory
volumes_dir = {{ snap_common }}/lib/volumes
[oslo_concurrency]
# Oslo Concurrency lock path
lock_path = /lock
lock_path = {{ snap_common }}/lock

View File

@ -1,5 +1,3 @@
# If the OpenStack service has an API that runs behind uwsgi+nginx, you'll need
# to define this template.
user root root;
worker_processes auto;
pid {{ snap_common }}/run/nginx.pid;

View File

@ -2,42 +2,57 @@ name: cinder
version: ocata
summary: OpenStack Block Storage Service (cinder)
description: |
Cinder provides on demand, self-service access to software defined block Storage resources on top of various traditional backend block storage devices.
Cinder provides on demand, self-service access to software defined block
Storage resources on top of various traditional backend block storage
devices.
confinement: strict
grade: devel
apps:
# If the OpenStack service has an API that runs behind uwsgi+nginx, the folowing
# app is required.
uwsgi:
command: snap-openstack cinder-uwsgi
daemon: simple
plugs:
- network-bind
# If the OpenStack service has an API that runs behind uwsgi+nginx, the folowing
# app is required.
nginx:
command: snap-openstack cinder-nginx
daemon: forking
plugs:
- network-bind
# Following is an example of creating a command app.
backup:
command: snap-openstack cinder-backup
daemon: simple
plugs:
- network
manage:
command: snap-openstack cinder-manage
plugs:
- network
scheduler:
command: snap-openstack cinder-scheduler
daemon: simple
plugs:
- network
volume:
command: snap-openstack cinder-volume
daemon: simple
plugs:
- network
parts:
# Following is an example of defining a part to build an OpenStack project
lvm2:
source: http://www.sourceware.org/pub/lvm2/LVM2.2.02.172.tgz
plugin: autotools
configflags:
- --with-confdir=/var/snap/common/etc/
- --with-default-system-dir=/var/snap/common/etc/
cinder:
plugin: python
python-version: python2
source: http://tarballs.openstack.org/cinder/cinder-stable-ocata.tar.gz
python-packages:
# You may need to pull in additional python packages
- python-memcached
- pymysql
# If the OpenStack service has an API that runs behind uwsgi+nginx, uwsgi is required.
- uwsgi
- git+https://github.com/openstack/snap.openstack#egg=snap.openstack
constraints: https://raw.githubusercontent.com/openstack/requirements/stable/ocata/upper-constraints.txt
@ -57,7 +72,6 @@ parts:
after: [cinder]
plugin: dump
source: snap
# Following is an example of including the OpenStack project's config
config:
after: [cinder]
plugin: dump
@ -75,8 +89,6 @@ parts:
- etc/cinder/*.templates
stage: [$etc]
prime: [$etc]
# If the OpenStack service has an API that runs behind uwsgi+nginx, the following
# part is required.
nginx:
source: http://www.nginx.org/download/nginx-1.13.0.tar.gz
plugin: autotools
@ -99,8 +111,6 @@ parts:
export SNAP_ROOT="../../.."
export SNAP_SOURCE="$SNAP_ROOT/parts/nginx/build"
patch -d $SNAP_SOURCE -p1 < $SNAP_ROOT/patches/drop-nginx-setgroups.patch
# If the OpenStack service has an API that runs behind uwsgi+nginx, the following
# part is required.
libxml2:
source: http://xmlsoft.org/sources/libxml2-2.9.4.tar.gz
plugin: autotools