Fine-tune config and services for cinder
This commit is contained in:
parent
bbe58f037b
commit
b974d14039
21
README.md
21
README.md
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
This repository contains the source code for the cinder snap.
|
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
|
## 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=ocata/stable cinder
|
||||||
sudo snap install --channel=pike/edge 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
|
## Configuring cinder
|
||||||
|
|
||||||
The cinder snap gets its default configuration from the following $SNAP
|
The cinder snap gets its default configuration from the following $SNAP
|
||||||
and $SNAP_COMMON locations:
|
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/
|
/snap/cinder/current/etc/
|
||||||
└── cinder
|
└── cinder
|
||||||
├── cinder.conf
|
├── cinder.conf
|
||||||
@ -47,10 +50,8 @@ and $SNAP_COMMON locations:
|
|||||||
└── snap
|
└── snap
|
||||||
└── cinder-api.ini
|
└── cinder-api.ini
|
||||||
|
|
||||||
### Add any details here on how to configure services for this snap.
|
The cinder applications can be configured in a few ways. The directory
|
||||||
### Insert a tree of /var/snap/cinder/common/etc with override files.
|
structure can be modified to override config as follows:
|
||||||
### If the OpenStack service has an API that runs behind uwsgi+nginx,
|
|
||||||
### the tree may like like this:
|
|
||||||
|
|
||||||
The cinder snap supports configuration updates via its $SNAP_COMMON writable
|
The cinder snap supports configuration updates via its $SNAP_COMMON writable
|
||||||
area. The default cinder configuration can be overridden as follows:
|
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.conf.d
|
||||||
│ │ ├── cinder-snap.conf
|
│ │ ├── cinder-snap.conf
|
||||||
│ │ ├── database.conf
|
│ │ ├── database.conf
|
||||||
|
│ │ ├── keystone.conf
|
||||||
|
│ │ ├── lvm.conf
|
||||||
│ │ └── rabbitmq.conf
|
│ │ └── rabbitmq.conf
|
||||||
│ └── cinder.conf
|
│ └── cinder.conf
|
||||||
├── nginx
|
├── nginx
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# The cinder snap may need to override default config files.
|
# Snap distribution defaults - do not change, override in $SNAP_COMMON/etc/cinder.conf.d
|
||||||
# For example if the default cinder.conf file located in
|
[database]
|
||||||
# $SNAP/etc/cinder/cinder.conf needs to be overridden,
|
max_retries = -1
|
||||||
# it can be done with this file.
|
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
setup:
|
setup:
|
||||||
dirs:
|
dirs:
|
||||||
- "{snap_common}/etc/cinder/cinder.conf.d"
|
- "{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/sites-enabled"
|
||||||
- "{snap_common}/etc/nginx/snap/sites-enabled"
|
- "{snap_common}/etc/nginx/snap/sites-enabled"
|
||||||
- "{snap_common}/etc/uwsgi/snap"
|
- "{snap_common}/etc/uwsgi/snap"
|
||||||
|
- "{snap_common}/lib/volumes"
|
||||||
|
- "{snap_common}/lock"
|
||||||
|
- "{snap_common}/log"
|
||||||
|
- "{snap_common}/run"
|
||||||
templates:
|
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-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"
|
nginx.conf.j2: "{snap_common}/etc/nginx/snap/nginx.conf"
|
||||||
entry_points:
|
entry_points:
|
||||||
# This is where entry_points are defined for the OpenStack service. For example,
|
cinder-backup:
|
||||||
# the service may have a database command-line tool such as the following.
|
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:
|
cinder-manage:
|
||||||
binary: "{snap}/bin/cinder-manage"
|
binary: "{snap}/bin/cinder-manage"
|
||||||
config-files:
|
config-files:
|
||||||
@ -30,8 +30,24 @@ entry_points:
|
|||||||
- "{snap_common}/etc/cinder/cinder.conf"
|
- "{snap_common}/etc/cinder/cinder.conf"
|
||||||
config-dirs:
|
config-dirs:
|
||||||
- "{snap_common}/etc/cinder/cinder.conf.d"
|
- "{snap_common}/etc/cinder/cinder.conf.d"
|
||||||
# If the OpenStack service has an API that runs behind uwsgi+nginx, the
|
cinder-scheduler:
|
||||||
# following entry_point must be defined.
|
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:
|
cinder-uwsgi:
|
||||||
type: uwsgi
|
type: uwsgi
|
||||||
uwsgi-dir: "{snap_common}/etc/uwsgi/snap"
|
uwsgi-dir: "{snap_common}/etc/uwsgi/snap"
|
||||||
@ -46,8 +62,6 @@ entry_points:
|
|||||||
log-file: "{snap_common}/log/cinder-api.log"
|
log-file: "{snap_common}/log/cinder-api.log"
|
||||||
templates:
|
templates:
|
||||||
cinder-api.ini.j2: "{snap_common}/etc/uwsgi/snap/cinder-api.ini"
|
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:
|
cinder-nginx:
|
||||||
type: nginx
|
type: nginx
|
||||||
config-file: "{snap_common}/etc/nginx/snap/nginx.conf"
|
config-file: "{snap_common}/etc/nginx/snap/nginx.conf"
|
||||||
|
@ -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]
|
[uwsgi]
|
||||||
wsgi-file = {{ snap }}/bin/cinder-wsgi-file-name
|
wsgi-file = {{ snap }}/bin/cinder-wsgi
|
||||||
uwsgi-socket = {{ snap_common }}/run/api-name.sock
|
uwsgi-socket = {{ snap_common }}/run/cinder-api.sock
|
||||||
buffer-size = 65535
|
buffer-size = 65535
|
||||||
master = true
|
master = true
|
||||||
enable-threads = true
|
enable-threads = true
|
||||||
|
@ -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 {
|
server {
|
||||||
listen 1234;
|
listen 8776;
|
||||||
access_log {{ snap_common }}/log/nginx-access.log;
|
access_log {{ snap_common }}/log/nginx-access.log;
|
||||||
error_log {{ snap_common }}/log/nginx-error.log;
|
error_log {{ snap_common }}/log/nginx-error.log;
|
||||||
location / {
|
location / {
|
||||||
include uwsgi_params;
|
|
||||||
include {{ snap }}/usr/conf/uwsgi_params;
|
include {{ snap }}/usr/conf/uwsgi_params;
|
||||||
uwsgi_param SCRIPT_NAME '';
|
uwsgi_param SCRIPT_NAME '';
|
||||||
uwsgi_pass unix://{{ snap_common }}/run/api-name.sock;
|
uwsgi_pass unix://{{ snap_common }}/run/cinder-api.sock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
# Set state path to writable directory
|
# 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]
|
||||||
# Oslo Concurrency lock path
|
# Oslo Concurrency lock path
|
||||||
lock_path = /lock
|
lock_path = {{ snap_common }}/lock
|
||||||
|
@ -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;
|
user root root;
|
||||||
worker_processes auto;
|
worker_processes auto;
|
||||||
pid {{ snap_common }}/run/nginx.pid;
|
pid {{ snap_common }}/run/nginx.pid;
|
||||||
|
@ -2,42 +2,57 @@ name: cinder
|
|||||||
version: ocata
|
version: ocata
|
||||||
summary: OpenStack Block Storage Service (cinder)
|
summary: OpenStack Block Storage Service (cinder)
|
||||||
description: |
|
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
|
confinement: strict
|
||||||
grade: devel
|
grade: devel
|
||||||
|
|
||||||
apps:
|
apps:
|
||||||
# If the OpenStack service has an API that runs behind uwsgi+nginx, the folowing
|
|
||||||
# app is required.
|
|
||||||
uwsgi:
|
uwsgi:
|
||||||
command: snap-openstack cinder-uwsgi
|
command: snap-openstack cinder-uwsgi
|
||||||
daemon: simple
|
daemon: simple
|
||||||
plugs:
|
plugs:
|
||||||
- network-bind
|
- network-bind
|
||||||
# If the OpenStack service has an API that runs behind uwsgi+nginx, the folowing
|
|
||||||
# app is required.
|
|
||||||
nginx:
|
nginx:
|
||||||
command: snap-openstack cinder-nginx
|
command: snap-openstack cinder-nginx
|
||||||
daemon: forking
|
daemon: forking
|
||||||
plugs:
|
plugs:
|
||||||
- network-bind
|
- network-bind
|
||||||
# Following is an example of creating a command app.
|
backup:
|
||||||
|
command: snap-openstack cinder-backup
|
||||||
|
daemon: simple
|
||||||
|
plugs:
|
||||||
|
- network
|
||||||
manage:
|
manage:
|
||||||
command: snap-openstack cinder-manage
|
command: snap-openstack cinder-manage
|
||||||
plugs:
|
plugs:
|
||||||
- network
|
- network
|
||||||
|
scheduler:
|
||||||
|
command: snap-openstack cinder-scheduler
|
||||||
|
daemon: simple
|
||||||
|
plugs:
|
||||||
|
- network
|
||||||
|
volume:
|
||||||
|
command: snap-openstack cinder-volume
|
||||||
|
daemon: simple
|
||||||
|
plugs:
|
||||||
|
- network
|
||||||
|
|
||||||
parts:
|
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:
|
cinder:
|
||||||
plugin: python
|
plugin: python
|
||||||
python-version: python2
|
python-version: python2
|
||||||
source: http://tarballs.openstack.org/cinder/cinder-stable-ocata.tar.gz
|
source: http://tarballs.openstack.org/cinder/cinder-stable-ocata.tar.gz
|
||||||
python-packages:
|
python-packages:
|
||||||
# You may need to pull in additional python packages
|
|
||||||
- python-memcached
|
- python-memcached
|
||||||
- pymysql
|
- pymysql
|
||||||
# If the OpenStack service has an API that runs behind uwsgi+nginx, uwsgi is required.
|
|
||||||
- uwsgi
|
- uwsgi
|
||||||
- git+https://github.com/openstack/snap.openstack#egg=snap.openstack
|
- git+https://github.com/openstack/snap.openstack#egg=snap.openstack
|
||||||
constraints: https://raw.githubusercontent.com/openstack/requirements/stable/ocata/upper-constraints.txt
|
constraints: https://raw.githubusercontent.com/openstack/requirements/stable/ocata/upper-constraints.txt
|
||||||
@ -57,7 +72,6 @@ parts:
|
|||||||
after: [cinder]
|
after: [cinder]
|
||||||
plugin: dump
|
plugin: dump
|
||||||
source: snap
|
source: snap
|
||||||
# Following is an example of including the OpenStack project's config
|
|
||||||
config:
|
config:
|
||||||
after: [cinder]
|
after: [cinder]
|
||||||
plugin: dump
|
plugin: dump
|
||||||
@ -75,8 +89,6 @@ parts:
|
|||||||
- etc/cinder/*.templates
|
- etc/cinder/*.templates
|
||||||
stage: [$etc]
|
stage: [$etc]
|
||||||
prime: [$etc]
|
prime: [$etc]
|
||||||
# If the OpenStack service has an API that runs behind uwsgi+nginx, the following
|
|
||||||
# part is required.
|
|
||||||
nginx:
|
nginx:
|
||||||
source: http://www.nginx.org/download/nginx-1.13.0.tar.gz
|
source: http://www.nginx.org/download/nginx-1.13.0.tar.gz
|
||||||
plugin: autotools
|
plugin: autotools
|
||||||
@ -99,8 +111,6 @@ parts:
|
|||||||
export SNAP_ROOT="../../.."
|
export SNAP_ROOT="../../.."
|
||||||
export SNAP_SOURCE="$SNAP_ROOT/parts/nginx/build"
|
export SNAP_SOURCE="$SNAP_ROOT/parts/nginx/build"
|
||||||
patch -d $SNAP_SOURCE -p1 < $SNAP_ROOT/patches/drop-nginx-setgroups.patch
|
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:
|
libxml2:
|
||||||
source: http://xmlsoft.org/sources/libxml2-2.9.4.tar.gz
|
source: http://xmlsoft.org/sources/libxml2-2.9.4.tar.gz
|
||||||
plugin: autotools
|
plugin: autotools
|
||||||
|
Loading…
Reference in New Issue
Block a user