diff --git a/contrib/block-box/.gitignore b/contrib/block-box/.gitignore deleted file mode 100644 index 7b717e8caf5..00000000000 --- a/contrib/block-box/.gitignore +++ /dev/null @@ -1 +0,0 @@ -./.db_data/* diff --git a/contrib/block-box/LICENSE b/contrib/block-box/LICENSE deleted file mode 100644 index 8dada3edaf5..00000000000 --- a/contrib/block-box/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/contrib/block-box/Makefile b/contrib/block-box/Makefile deleted file mode 100644 index 4176752dd89..00000000000 --- a/contrib/block-box/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -CINDER_BRANCH ?= master# master, stable/ocata, refs/changes/67/418167/1 -NAME_PREFIX ?= "" -PLATFORM ?= debian:stretch# ubuntu:xenial, centos:7 -TAG ?= debian-cinder:latest - -all: base lvm -blockbox: base lvm - -base: - docker build https://git.openstack.org/openstack/loci.git \ - --build-arg PROJECT=cinder \ - --build-arg FROM=$(PLATFORM) \ - --build-arg PROJECT_REF=$(CINDER_BRANCH) \ - --tag $(TAG) -lvm: - docker build https://git.openstack.org/openstack/loci.git \ - --build-arg PROJECT=cinder \ - --build-arg FROM=$(PLATFORM) \ - --build-arg PROJECT_REF=$(CINDER_BRANCH) \ - --build-arg PROFILES="lvm" \ - --tag lvm-$(TAG) diff --git a/contrib/block-box/README.CVOL-LVM.md b/contrib/block-box/README.CVOL-LVM.md deleted file mode 100644 index 9b8b74752c1..00000000000 --- a/contrib/block-box/README.CVOL-LVM.md +++ /dev/null @@ -1,49 +0,0 @@ -You'll need to modify how you're doing things to get to the iscsi Target. -Specifically, using a Docker network hoses everything because the IP of the -target is the internal containers IP NOT the IP of the host. - -Setting `network_mode: host` solves this, but that creates a new problem. -Can't use `link` when using network_mode: host. - -Sigh... so; docker run has "add-host=host:IP" that we should be able to find -equivalent in compose. We just need to define a network and assign IP's to the -other containers, then this should work. - -Compose looks like this: - extra_hosts: - - "hostname:1.1.1.1" - - "anotherhost:2.2.2.2" - -This just adds entries to /etc/hosts for you. Kinda handy - -So, if we create a network and assign IP's to the supporting cast (rabbit, -mariadb api etc etc) we can then just use this to make them accessible instead -of using `link` - -OHHHH! Add `ipc_mode: host`, shared memory; may speed things up a bit? - -Finally... for reference; The docker run command for this looks something -like: - `docker run -it \ - -v /dev/:/dev/ \ - -v /run/:/run/:shared -v - /etc/localtime:/etc/localtime:ro \ - --net host \ - --privileged cinder_debian \ - bash` - -### https://wiki.debian.org/LVM -vim /etc/lvm/lvm.conf - # disable udev_ stuff -/usr/sbin/tgtd -tgtadm --lld iscsi --op show --mode target -tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2001-04.com.example:storage.disk2.amiens.sys1.xyz -tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b /dev/vg-group/lv -tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL - -## Notes here: https://wiki.debian.org/SAN/iSCSI/open-iscsi - -### Initiator side -iscsiadm -m discovery -t sendtargets -p -iscsiadm -m node --targetname= --login - diff --git a/contrib/block-box/README.md b/contrib/block-box/README.md deleted file mode 100644 index 54c5c0ff92c..00000000000 --- a/contrib/block-box/README.md +++ /dev/null @@ -1,176 +0,0 @@ -# block-box -Standalone Cinder Containerized using Docker Compose - -** This was a proof of concept for running Cinder services in containers -and is no longer supported.** - -There are several projects that support containerized services now. A good -place to start may be the [LOCI Project](https://opendev.org/openstack/loci). - -## Cinder -Provides Block Storage as a service as part of the OpenStack Project. -This project deploys Cinder in containers using docker-compose and -also enabled the use of Cinder's noauth option which eliminates the -need for keystone. One could also easily add keystone into the -compose file along with an init script to set up endpoints. - -## LOCI (Lightweight Open Compute Initiative) -The block-box uses OpenStack Loci to build a base Cinder image to use -for each service. The examples use Debian as the base OS, but you can -choose between Debian, CentOS and Ubuntu. - -We're currently using Cinder's noauth option, but this pattern provides -flexibility to add a Keystone service if desired. - -## To build -Start by building the required images. This repo includes a Makefile to -enable building of openstack/loci images of Cinder. The -Makefile includes variables to select between platform (debian, ubuntu or -centos) and also allows which branch of each project to build the image from. -This includes master, stable/xyz as well as patch versions. Additional -variables are provided and can be passed to make using the `-e` option to -control things like naming and image tags. See the Makefile for more info. - -If you're going to utilize an external storage device (ie not using LVM), all -you need to build is the base Cinder image. Set the variable in the Makefile -to choose the Cinder Branch you'd like to use and Platform then simply run: - -```make base``` - -You can also build an image to run LVM (**NOTE**: This is dependent on the base cinder image): - -```make lvm``` - -To build both the base and lvm enabled image -```make blockbox``` - -All we're doing here is a ```docker build``` utilizing the loci -Dockerfile and bindeps. Currently loci images are not published -regulary (although they will be in the future) so we require you -to build images before running docker-compose up. - -For more information and options, check out the openstack/loci page -on [opendev.org](https://opendev.org/openstack/loci). - -**NOTE** The loci project is moving fairly quickly, and it may or may not -continue to be a straight forward light weight method of building container -Images. The build has been known to now work at times, and if it becomes -bloated or burdensome it's easy to swap in another image builder (or write your -own even). - -### cinder -Creates a base image with cinder installed via source. This base image is -enough to run all of the services including api, scheduler and volume with -the exception of cinder-volume with the LVM driver which needs some extra -packages installed like LVM2 and iSCSI target driver. - -Each Cinder service has an executable entrypoint at /usr/local/bin. - -**NOTE** If you choose to build images from something other than the default Debian -base, you'll need to modify the Makefile for this image as well. - -### cinder-lvm -This is a special image that is built from the base cinder image and adds the -necessary packages for LVM and iSCSI. - -## Accessing via cinderclient -You can of course build a cinderclient container with a `cinder` entrypoint and -use that for access, but in order to take advantage of things like the -local-attach extension, you'll need to install the client tools on the host. - -Before using, you must specify these env variables at least, -``OS_AUTH_TYPE``, ``CINDER_ENDPOINT``, ``OS_PROJECT_ID``, ``OS_USERNAME``. -You can utilize our sample file ``cinder.rc``, then you can use client -to communicate with your containerized cinder deployment with noauth!! - - -Remember, to perform local-attach/local-detach of volumes you'll need to use -sudo. To preserve your env variables don't forget to use `sudo -E cinder xxxxx` - -## To run -docker-compose up -d - -Don't forget to modify the `etc-cinder/cinder.conf` file as needed for your -specific driver. The current default setup should give you the ability to -quickly deploy a fully functional stand-alone cinder deployment with LVM. -If you'd like to add your own external driver, it's quite simple, and we've -included an example for adding an additional volume service to the base -deployment/compose. See the section below for more details. - -**Note**: If you use ``cinder-lvm`` image, you must guarantee the required -volume group which is specified in the ``cinder.conf`` already exists in -the host environment before starting the service. - -## Adding your own driver -We don't do multi-backend in this type of environment; instead we just add -another container running the backend we want. We can easily add to the base -service we've create using additional compose files. - -The file `docker-compose-add-vol-service.yml` provides an example additional -compose file that will create another cinder-volume service configured to run -the SolidFire backend. - -After launching the main compose file: -```shell -docker-compose up -d -``` - -Once the services are initialized and the database is synchronized, you can add -another backend by running: -```shell -docker-compose -f ./docker-compose-add-vol-service.yml up -d -``` - -Note that things like network settings and ports are IMPORTANT here!! - -## Access using the cinderclient container - -You can use your own cinderclient and openrc, or use the provided cinderclient -container. You'll need to make sure and specify to use the same network -that was used by compose. - -```shell -docker run -it -e OS_AUTH_TYPE=noauth \ - -e CINDERCLIENT_BYPASS_URL=http://cinder-api:8776/v3 \ - -e OS_PROJECT_ID=foo \ - -e OS_VOLUME_API_VERSION=3.27 \ - --network blockbox_default cinderclient list -``` - -# Make sure the environment vars match the startup script for your database host -docker run -d -p 5000:5000 \ - -p 35357:35357 \ - --link mariadb \ - --name keystone \ - --hostname keystone \ - -e OS_PASSWORD=password \ - -e DEMO_PASSWORD=password \ - -e DB_HOST=mariadb \ - -e DB_PASSWORD=password \ - keystone - -docker run -d -p 5672:5672 --name rabbitmq --hostname rabbitmq rabbitmq - -docker run -d -p 8776:8776 \ - --link mariadb \ - --link rabbitmq \ - --name cinder-api \ - --hostname cinder-api \ - -v ~/block-box/etc-cinder:/etc/cinder \ - -v ~/block-box/init-scripts:/init-scripts - cinder_debian sh /init-scripts/cinder-api.sh - -docker run -d --name cinder-scheduler \ - --hostname cinder-scheduler \ - --link mariadb \ - --link rabbitmq \ - -v ~/block-box/etc-cinder:/etc/cinder \ - cinder_debian cinder-scheduler - -docker run -d --name cinder-volume \ - --hostname cinder-volume \ - --link mariadb \ - --link rabbitmq \ - -v ~/block-box/etc-cinder:/etc/cinder \ - cinder-debian cinder-volume -``` diff --git a/contrib/block-box/cinder.rc b/contrib/block-box/cinder.rc deleted file mode 100644 index d7f10f2a618..00000000000 --- a/contrib/block-box/cinder.rc +++ /dev/null @@ -1,5 +0,0 @@ -export OS_AUTH_SYSTEM=noauth -export CINDER_ENDPOINT=http://127.0.0.1:8776/v3 -export OS_PROJECT_ID=myproject -export OS_USERNAME=bubba -export OS_VOLUME_API_VERSION=3.44 diff --git a/contrib/block-box/contrib/cinderflex b/contrib/block-box/contrib/cinderflex deleted file mode 100644 index 020d8193404..00000000000 --- a/contrib/block-box/contrib/cinderflex +++ /dev/null @@ -1,208 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Based on this excellent blog post by Ivan - http://blog.e0ne.info/post/Attach-Cinder-Volume-to-the-Ironic-Instance-without-Nova.aspx - -export OS_PROJECT_DOMAIN_ID=default -export OS_USER_DOMAIN_ID=default -export OS_PROJECT_NAME=admin -export OS_PASSWORD=secret -export OS_AUTH_URL=http://10.0.0.2/identity -export OS_USERNAME=admin -export PATH=$PATH:/lib/udev - -# Notes: -# - Please install "jq" package before using this driver. -usage() { - err "Invalid usage. Usage: " - err "\t$0 init" - err "\t$0 attach " - err "\t$0 detach " - err "\t$0 waitforattach " - err "\t$0 mountdevice " - err "\t$0 unmountdevice " - err "\t$0 getvolumename " - err "\t$0 isattached " - exit 1 -} - -err() { - echo -ne $* 1>&2 -} - -log() { - echo -ne $* >&1 -} - -ismounted() { - MOUNT=`findmnt -n ${MNTPATH} 2>/dev/null | cut -d' ' -f1` - if [ "${MOUNT}" == "${MNTPATH}" ]; then - echo "1" - else - echo "0" - fi -} - -getdevice() { - VOLUMEID=$(echo ${JSON_PARAMS} | jq -r '.volumeID') - DMDEV="/dev/disk/by-path/$(ls -1 /dev/disk/by-path/ | grep $VOLUMEID)" - echo ${DMDEV} -} - -attach() { - JSON_PARAMS=$1 - SIZE=$(echo $1 | jq -r '.size') - - VOLUMEID=$(echo ${JSON_PARAMS} | jq -r '.volumeID') - sudo -E PATH=$PATH cinder local-attach $VOLUMEID >> /tmp/cinder2.log 2>&1 - - DMDEV=$(getdevice) - if [ ! -b "${DMDEV}" ]; then - err "{\"status\": \"Failure\", \"message\": \"Volume ${VOLUMEID} does not exist\"}" - exit 1 - fi - log "{\"status\": \"Success\", \"device\":\"${DMDEV}\"}" - exit 0 -} - -detach() { - log "{\"status\": \"Success\"}" - exit 0 -} - -waitforattach() { - #shift - #attach $* - log "{\"status\": \"Success\"}" - exit 0 - -} - -domountdevice() { - MNTPATH=$1 - JSON_PARAMS=$2 - DMDEV=$(getdevice) - FSTYPE=$(echo $JSON_PARAMS|jq -r '.["kubernetes.io/fsType"]') - - if [ ! -b "${DMDEV}" ]; then - err "{\"status\": \"Failure\", \"message\": \"${DMDEV} does not exist\"}" - exit 1 - fi - - if [ $(ismounted) -eq 1 ] ; then - log "{\"status\": \"Success\"}" - exit 0 - fi - - VOLFSTYPE=`blkid -o udev ${DMDEV} 2>/dev/null|grep "ID_FS_TYPE"|cut -d"=" -f2` - if [ "${VOLFSTYPE}" == "" ]; then - mkfs -t ${FSTYPE} ${DMDEV} >/dev/null 2>&1 - if [ $? -ne 0 ]; then - err "{ \"status\": \"Failure\", \"message\": \"Failed to create fs ${FSTYPE} on device ${DMDEV}\"}" - exit 1 - fi - fi - - mkdir -p ${MNTPATH} &> /dev/null - - mount ${DMDEV} ${MNTPATH} &> /dev/null - if [ $? -ne 0 ]; then - err "{ \"status\": \"Failure\", \"message\": \"Failed to mount device ${DMDEV} at ${MNTPATH}\"}" - exit 1 - fi - log "{\"status\": \"Success\"}" - exit 0 -} - -unmountdevice() { - MNTPATH=$1 - if [ ! -d ${MNTPATH} ]; then - log "{\"status\": \"Success\"}" - exit 0 - fi - - if [ $(ismounted) -eq 0 ] ; then - log "{\"status\": \"Success\"}" - exit 0 - fi - - umount ${MNTPATH} &> /dev/null - if [ $? -ne 0 ]; then - err "{ \"status\": \"Failed\", \"message\": \"Failed to unmount volume at ${MNTPATH}\"}" - exit 1 - fi - - $VOLUMEID=$(echo ${MNTPATH} | sed -r "s/^.*volume-(.*)-lun.*/\1/") - sudo -E PATH=$PATH cinder local-detach $VOLUMEID >> /tmp/cinder2.log 2>&1 - - log "{\"status\": \"Success\"}" - exit 0 -} - -getvolumename() { - JSON_PARAMS=$1 - UUID=$(echo ${JSON_PARAMS} | jq -r '.volumeID') - - log "{\"status\": \"Success\", \"volumeName\":\"${UUID}\"}" - exit 0 -} - -isattached() { - log "{\"status\": \"Success\", \"attached\":true}" - exit 0 -} - -op=$1 - -if [ "$op" = "init" ]; then - log "{\"status\": \"Success\"}" - exit 0 -fi - -if [ $# -lt 2 ]; then - usage -fi - -shift - -case "$op" in - attach) - attach $* - ;; - detach) - detach $* - ;; - waitforattach) - waitforattach $* - ;; - mountdevice) - domountdevice $* - ;; - unmountdevice) - unmountdevice $* - ;; - getvolumename) - getvolumename $* - ;; - isattached) - isattached $* - ;; - *) - err "{ \"status\": \"Not supported\" }" - exit 1 -esac - -exit 1 diff --git a/contrib/block-box/docker-compose-add-vol-service.yml b/contrib/block-box/docker-compose-add-vol-service.yml deleted file mode 100644 index 8977f6162b6..00000000000 --- a/contrib/block-box/docker-compose-add-vol-service.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: "2" -services: - cinder-volume-sf: - image: cinder - hostname: cinder-volume-sf - privileged: true - volumes: - - ./etc:/etc/cinder - - /dev/:/dev/ - - /run/:/run/:shared - - /etc/localtime:/etc/localtime:ro - - /lib/modules:/lib/modules:ro - extra_hosts: - - "rabbitmq:172.49.49.5" - - "mariadb:172.49.49.6" - networks: - cindernet: - ipv4_address: 172.49.49.10 - command: bash -c "cinder-volume -d --config-file /etc/cinder/cinder.conf.sf" - -networks: - cindernet: - driver: bridge - ipam: - driver: default - config: - - - subnet: 172.49.49.0/24 diff --git a/contrib/block-box/docker-compose.yml b/contrib/block-box/docker-compose.yml deleted file mode 100644 index 733bab061aa..00000000000 --- a/contrib/block-box/docker-compose.yml +++ /dev/null @@ -1,87 +0,0 @@ -version: "2" -services: - rabbitmq: - image: rabbitmq - ports: - - "5672:5672" - hostname: rabbitmq - networks: - cindernet: - ipv4_address: 172.49.49.5 - mariadb: - image: mariadb - hostname: mariadb - environment: - - MYSQL_ROOT_PASSWORD=password - ports: - - 3306:3306 - networks: - cindernet: - ipv4_address: 172.49.49.6 - volumes: - - ~/.blockbox/db_data:/var/lib/mysql - - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - cinder-api: - image: debian-cinder - hostname: cinder-api - volumes: - - ./etc:/etc/cinder - - ./scripts:/scripts - network_mode: "host" - ports: - - 8776:8776 - depends_on: - - mariadb - extra_hosts: - - "rabbitmq:172.49.49.5" - - "mariadb:172.49.49.6" - environment: - - INIT_DB=true - command: sh /scripts/cinder-api.sh - cinder-scheduler: - image: debian-cinder - hostname: cinder-scheduler - volumes: - - ./etc:/etc/cinder - depends_on: - - mariadb - - rabbitmq - - cinder-api - extra_hosts: - - "rabbitmq:172.49.49.5" - - "mariadb:172.49.49.6" - network_mode: "host" - depends_on: - - cinder-api - restart: on-failure - command: cinder-scheduler - cinder-volume: - image: lvm-debian-cinder - hostname: cinder-lvm - privileged: true - volumes: - - ./etc:/etc/cinder - - /dev/:/dev/ - - /run/:/run/:shared - - /etc/localtime:/etc/localtime:ro - - /lib/modules:/lib/modules:ro - - ./scripts:/scripts - depends_on: - - cinder-scheduler - ports: - - 3260:3260 - extra_hosts: - - "rabbitmq:172.49.49.5" - - "mariadb:172.49.49.6" - network_mode: "host" - restart: on-failure - command: bash -c "/scripts/lvm-service.sh" - -networks: - cindernet: - driver: bridge - ipam: - driver: default - config: - - - subnet: 172.49.49.0/24 diff --git a/contrib/block-box/docker-entrypoint-initdb.d/script.sql b/contrib/block-box/docker-entrypoint-initdb.d/script.sql deleted file mode 100755 index 3b0f123fd37..00000000000 --- a/contrib/block-box/docker-entrypoint-initdb.d/script.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE DATABASE cinder; -GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \ - IDENTIFIED BY 'password'; -GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' \ -IDENTIFIED BY 'password'; diff --git a/contrib/block-box/etc/api-paste.ini b/contrib/block-box/etc/api-paste.ini deleted file mode 100644 index 58bc48fd38e..00000000000 --- a/contrib/block-box/etc/api-paste.ini +++ /dev/null @@ -1,55 +0,0 @@ -############# -# OpenStack # -############# - -[composite:osapi_volume] -use = call:cinder.api:root_app_factory -/: apiversions -/v3: openstack_volume_api_v3 - -[composite:openstack_volume_api_v3] -use = call:cinder.api.middleware.auth:pipeline_factory -noauth = cors http_proxy_to_wsgi request_id faultwrap sizelimit osprofiler noauth apiv3 -keystone = cors http_proxy_to_wsgi request_id faultwrap sizelimit osprofiler authtoken keystonecontext apiv3 -keystone_nolimit = cors http_proxy_to_wsgi request_id faultwrap sizelimit osprofiler authtoken keystonecontext apiv3 - -[filter:request_id] -paste.filter_factory = oslo_middleware.request_id:RequestId.factory - -[filter:http_proxy_to_wsgi] -paste.filter_factory = oslo_middleware.http_proxy_to_wsgi:HTTPProxyToWSGI.factory - -[filter:cors] -paste.filter_factory = oslo_middleware.cors:filter_factory -oslo_config_project = cinder - -[filter:faultwrap] -paste.filter_factory = cinder.api.middleware.fault:FaultWrapper.factory - -[filter:osprofiler] -paste.filter_factory = osprofiler.web:WsgiMiddleware.factory - -[filter:noauth] -paste.filter_factory = cinder.api.middleware.auth:NoAuthMiddleware.factory - -[filter:sizelimit] -paste.filter_factory = oslo_middleware.sizelimit:RequestBodySizeLimiter.factory - -[app:apiv3] -paste.app_factory = cinder.api.v3.router:APIRouter.factory - -[pipeline:apiversions] -pipeline = cors http_proxy_to_wsgi faultwrap osvolumeversionapp - -[app:osvolumeversionapp] -paste.app_factory = cinder.api.versions:Versions.factory - -########## -# Shared # -########## - -[filter:keystonecontext] -paste.filter_factory = cinder.api.middleware.auth:CinderKeystoneContext.factory - -[filter:authtoken] -paste.filter_factory = keystonemiddleware.auth_token:filter_factory diff --git a/contrib/block-box/etc/cinder.conf b/contrib/block-box/etc/cinder.conf deleted file mode 100644 index faf6b376669..00000000000 --- a/contrib/block-box/etc/cinder.conf +++ /dev/null @@ -1,26 +0,0 @@ -[DEFAULT] -rootwrap_config = /etc/cinder/rootwrap.conf -api_paste_confg = /etc/cinder/api-paste.ini -volume_name_template = volume-%s -volume_group = cinder-volumes -verbose = True -auth_strategy = noauth -state_path = /var/lib/cinder -lock_path = /var/lock/cinder -volumes_dir = /var/lib/cinder/volumes -rabbit_host = rabbitmq -enabled_backends = lvm - -[key_manager] -backend = cinder.keymgr.conf_key_mgr.ConfKeyManager - -[database] -connection = mysql+pymysql://cinder:password@mariadb/cinder?charset=utf8 - -[lvm] -lvm_type = thin -volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver -volume_group = cinder-volumes -target_protocol = iscsi -target_helper = tgtadm -volume_backend_name=lvm diff --git a/contrib/block-box/etc/cinder.conf.keystone b/contrib/block-box/etc/cinder.conf.keystone deleted file mode 100644 index f165022e992..00000000000 --- a/contrib/block-box/etc/cinder.conf.keystone +++ /dev/null @@ -1,35 +0,0 @@ -[DEFAULT] -rootwrap_config = /etc/cinder/rootwrap.conf -api_paste_confg = /etc/cinder/api-paste.ini -target_helper = tgtadm -volume_name_template = volume-%s -volume_group = cinder-volumes -verbose = True -auth_strategy = keystone -state_path = /var/lib/cinder -lock_path = /var/lock/cinder -volumes_dir = /var/lib/cinder/volumes -rabbit_host = rabbitmq -enabled_backends = solidfire - -[database] -connection = mysql+pymysql://cinder:password@mariadb/cinder?charset=utf8 - -[keystone_authtoken] -www_authenticate_uri = http://keystone:5000 -auth_url = http://keystone:5000 -memcached_servers = keystone:11211 -auth_type = password -project_domain_name = default -user_domain_name = default -project_name = service -username = cinder -password = password - -[solidfire] -volume_driver=cinder.volume.drivers.solidfire.SolidFireDriver -san_ip=10.117.36.101 -san_login=admin -san_password=admin -volume_backend_name=solidfire -sf_allow_template_caching=false diff --git a/contrib/block-box/etc/cinder.conf.sf b/contrib/block-box/etc/cinder.conf.sf deleted file mode 100644 index 9817ae2e53d..00000000000 --- a/contrib/block-box/etc/cinder.conf.sf +++ /dev/null @@ -1,24 +0,0 @@ -[DEFAULT] -rootwrap_config = /etc/cinder/rootwrap.conf -api_paste_confg = /etc/cinder/api-paste.ini -target_helper = tgtadm -volume_name_template = volume-%s -volume_group = cinder-volumes -verbose = True -auth_strategy = noauth -state_path = /var/lib/cinder -lock_path = /var/lock/cinder -volumes_dir = /var/lib/cinder/volumes -rabbit_host = rabbitmq -enabled_backends = solidfire - -[database] -connection = mysql+pymysql://cinder:password@mariadb/cinder?charset=utf8 - -[solidfire] -volume_driver=cinder.volume.drivers.solidfire.SolidFireDriver -san_ip=10.117.36.101 -san_login=admin -san_password=admin -volume_backend_name=solidfire -sf_allow_template_caching=false diff --git a/contrib/block-box/etc/cinder.conf.solidfire b/contrib/block-box/etc/cinder.conf.solidfire deleted file mode 100644 index 2cbe4392b8e..00000000000 --- a/contrib/block-box/etc/cinder.conf.solidfire +++ /dev/null @@ -1,23 +0,0 @@ -[DEFAULT] -rootwrap_config = /etc/cinder/rootwrap.conf -api_paste_confg = /etc/cinder/api-paste.ini -volume_name_template = volume-%s -volume_group = cinder-volumes -verbose = True -auth_strategy = noauth -state_path = /var/lib/cinder -lock_path = /var/lock/cinder -volumes_dir = /var/lib/cinder/volumes -rabbit_host = rabbitmq -enabled_backends = solidfire - -[database] -connection = mysql+pymysql://cinder:password@mariadb/cinder?charset=utf8 - -[solidfire] -volume_driver=cinder.volume.drivers.solidfire.SolidFireDriver -san_ip=10.117.36.51 -san_login=admin -san_password=admin -volume_backend_name=solidfire -sf_allow_template_caching=false diff --git a/contrib/block-box/etc/logging.conf b/contrib/block-box/etc/logging.conf deleted file mode 100644 index 476425b8b52..00000000000 --- a/contrib/block-box/etc/logging.conf +++ /dev/null @@ -1,76 +0,0 @@ -[loggers] -keys = root, cinder - -[handlers] -keys = stderr, stdout, watchedfile, syslog, null - -[formatters] -keys = legacycinder, default - -[logger_root] -level = WARNING -handlers = null - -[logger_cinder] -level = INFO -handlers = stderr -qualname = cinder - -[logger_amqplib] -level = WARNING -handlers = stderr -qualname = amqplib - -[logger_sqlalchemy] -level = WARNING -handlers = stderr -qualname = sqlalchemy -# "level = INFO" logs SQL queries. -# "level = DEBUG" logs SQL queries and results. -# "level = WARNING" logs neither. (Recommended for production systems.) - -[logger_boto] -level = WARNING -handlers = stderr -qualname = boto - -[logger_suds] -level = INFO -handlers = stderr -qualname = suds - -[logger_eventletwsgi] -level = WARNING -handlers = stderr -qualname = eventlet.wsgi.server - -[handler_stderr] -class = StreamHandler -args = (sys.stderr,) -formatter = legacycinder - -[handler_stdout] -class = StreamHandler -args = (sys.stdout,) -formatter = legacycinder - -[handler_watchedfile] -class = handlers.WatchedFileHandler -args = ('cinder.log',) -formatter = legacycinder - -[handler_syslog] -class = handlers.SysLogHandler -args = ('/dev/log', handlers.SysLogHandler.LOG_USER) -formatter = legacycinder - -[handler_null] -class = cinder.log.NullHandler -formatter = default -args = () - -[formatter_legacycinder] -class = cinder.log.LegacyCinderFormatter - -[formatter_default] -format = %(message)s diff --git a/contrib/block-box/etc/policy.json b/contrib/block-box/etc/policy.json deleted file mode 100644 index 6a651220e89..00000000000 --- a/contrib/block-box/etc/policy.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "admin_or_owner": "is_admin:True or (role:admin and is_admin_project:True) or project_id:%(project_id)s", - "default": "rule:admin_or_owner", - - "admin_api": "is_admin:True or (role:admin and is_admin_project:True)", - - "volume:create": "", - "volume:create_from_image": "", - "volume:delete": "rule:admin_or_owner", - "volume:force_delete": "rule:admin_api", - "volume:get": "rule:admin_or_owner", - "volume:get_all": "rule:admin_or_owner", - "volume:get_volume_metadata": "rule:admin_or_owner", - "volume:create_volume_metadata": "rule:admin_or_owner", - "volume:delete_volume_metadata": "rule:admin_or_owner", - "volume:update_volume_metadata": "rule:admin_or_owner", - "volume:get_volume_admin_metadata": "rule:admin_api", - "volume:update_volume_admin_metadata": "rule:admin_api", - "volume:get_snapshot": "rule:admin_or_owner", - "volume:get_all_snapshots": "rule:admin_or_owner", - "volume:create_snapshot": "rule:admin_or_owner", - "volume:delete_snapshot": "rule:admin_or_owner", - "volume:update_snapshot": "rule:admin_or_owner", - "volume:get_snapshot_metadata": "rule:admin_or_owner", - "volume:delete_snapshot_metadata": "rule:admin_or_owner", - "volume:update_snapshot_metadata": "rule:admin_or_owner", - "volume:extend": "rule:admin_or_owner", - "volume:update_readonly_flag": "rule:admin_or_owner", - "volume:retype": "rule:admin_or_owner", - "volume:update": "rule:admin_or_owner", - - "volume_extension:types_manage": "rule:admin_api", - "volume_extension:types_extra_specs": "rule:admin_api", - "volume_extension:access_types_qos_specs_id": "rule:admin_api", - "volume_extension:access_types_extra_specs": "rule:admin_api", - "volume_extension:volume_type_access": "rule:admin_or_owner", - "volume_extension:volume_type_access:addProjectAccess": "rule:admin_api", - "volume_extension:volume_type_access:removeProjectAccess": "rule:admin_api", - "volume_extension:volume_type_encryption": "rule:admin_api", - "volume_extension:volume_encryption_metadata": "rule:admin_or_owner", - "volume_extension:extended_snapshot_attributes": "rule:admin_or_owner", - "volume_extension:volume_image_metadata": "rule:admin_or_owner", - - "volume_extension:quotas:show": "", - "volume_extension:quotas:update": "rule:admin_api", - "volume_extension:quotas:delete": "rule:admin_api", - "volume_extension:quota_classes": "rule:admin_api", - "volume_extension:quota_classes:validate_setup_for_nested_quota_use": "rule:admin_api", - - "volume_extension:volume_admin_actions:reset_status": "rule:admin_api", - "volume_extension:snapshot_admin_actions:reset_status": "rule:admin_api", - "volume_extension:backup_admin_actions:reset_status": "rule:admin_api", - "volume_extension:volume_admin_actions:force_delete": "rule:admin_api", - "volume_extension:volume_admin_actions:force_detach": "rule:admin_api", - "volume_extension:snapshot_admin_actions:force_delete": "rule:admin_api", - "volume_extension:backup_admin_actions:force_delete": "rule:admin_api", - "volume_extension:volume_admin_actions:migrate_volume": "rule:admin_api", - "volume_extension:volume_admin_actions:migrate_volume_completion": "rule:admin_api", - - "volume_extension:volume_actions:upload_public": "rule:admin_api", - "volume_extension:volume_actions:upload_image": "rule:admin_or_owner", - - "volume_extension:volume_host_attribute": "rule:admin_api", - "volume_extension:volume_tenant_attribute": "rule:admin_or_owner", - "volume_extension:volume_mig_status_attribute": "rule:admin_api", - "volume_extension:hosts": "rule:admin_api", - "volume_extension:services:index": "rule:admin_api", - "volume_extension:services:update" : "rule:admin_api", - - "volume_extension:volume_manage": "rule:admin_api", - "volume_extension:volume_unmanage": "rule:admin_api", - "volume_extension:list_manageable": "rule:admin_api", - - "volume_extension:capabilities": "rule:admin_api", - - "volume:create_transfer": "rule:admin_or_owner", - "volume:accept_transfer": "", - "volume:delete_transfer": "rule:admin_or_owner", - "volume:get_transfer": "rule:admin_or_owner", - "volume:get_all_transfers": "rule:admin_or_owner", - - "volume:failover_host": "rule:admin_api", - "volume:freeze_host": "rule:admin_api", - "volume:thaw_host": "rule:admin_api", - - "backup:create" : "", - "backup:delete": "rule:admin_or_owner", - "backup:get": "rule:admin_or_owner", - "backup:get_all": "rule:admin_or_owner", - "backup:restore": "rule:admin_or_owner", - "backup:backup-import": "rule:admin_api", - "backup:backup-export": "rule:admin_api", - "backup:update": "rule:admin_or_owner", - "backup:backup_project_attribute": "rule:admin_api", - - "snapshot_extension:snapshot_actions:update_snapshot_status": "", - "snapshot_extension:snapshot_manage": "rule:admin_api", - "snapshot_extension:snapshot_unmanage": "rule:admin_api", - "snapshot_extension:list_manageable": "rule:admin_api", - - "consistencygroup:create" : "group:nobody", - "consistencygroup:delete": "group:nobody", - "consistencygroup:update": "group:nobody", - "consistencygroup:get": "group:nobody", - "consistencygroup:get_all": "group:nobody", - - "consistencygroup:create_cgsnapshot" : "group:nobody", - "consistencygroup:delete_cgsnapshot": "group:nobody", - "consistencygroup:get_cgsnapshot": "group:nobody", - "consistencygroup:get_all_cgsnapshots": "group:nobody", - - "group:group_types_manage": "rule:admin_api", - "group:group_types_specs": "rule:admin_api", - "group:access_group_types_specs": "rule:admin_api", - "group:group_type_access": "rule:admin_or_owner", - - "group:create" : "", - "group:delete": "rule:admin_or_owner", - "group:update": "rule:admin_or_owner", - "group:get": "rule:admin_or_owner", - "group:get_all": "rule:admin_or_owner", - - "group:create_group_snapshot": "", - "group:delete_group_snapshot": "rule:admin_or_owner", - "group:update_group_snapshot": "rule:admin_or_owner", - "group:get_group_snapshot": "rule:admin_or_owner", - "group:get_all_group_snapshots": "rule:admin_or_owner", - "group:reset_group_snapshot_status":"rule:admin_api", - "group:reset_status":"rule:admin_api", - - "scheduler_extension:scheduler_stats:get_pools" : "rule:admin_api", - "message:delete": "rule:admin_or_owner", - "message:get": "rule:admin_or_owner", - "message:get_all": "rule:admin_or_owner", - - "clusters:get": "rule:admin_api", - "clusters:get_all": "rule:admin_api", - "clusters:update": "rule:admin_api", - - "workers:cleanup": "rule:admin_api" -} diff --git a/contrib/block-box/etc/rootwrap.conf b/contrib/block-box/etc/rootwrap.conf deleted file mode 100644 index 4d280eae5c8..00000000000 --- a/contrib/block-box/etc/rootwrap.conf +++ /dev/null @@ -1,27 +0,0 @@ -# Configuration for cinder-rootwrap -# This file should be owned by (and only-writeable by) the root user - -[DEFAULT] -# List of directories to load filter definitions from (separated by ','). -# These directories MUST all be only writeable by root ! -filters_path=/etc/cinder/rootwrap.d,/usr/share/cinder/rootwrap - -# List of directories to search executables in, in case filters do not -# explicitely specify a full path (separated by ',') -# If not specified, defaults to system PATH environment variable. -# These directories MUST all be only writeable by root ! -exec_dirs=/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin - -# Enable logging to syslog -# Default value is False -use_syslog=False - -# Which syslog facility to use. -# Valid values include auth, authpriv, syslog, local0, local1... -# Default value is 'syslog' -syslog_log_facility=syslog - -# Which messages to log. -# INFO means log all usage -# ERROR means only log unsuccessful attempts -syslog_log_level=ERROR diff --git a/contrib/block-box/scripts/cinder-api.sh b/contrib/block-box/scripts/cinder-api.sh deleted file mode 100755 index a26df009371..00000000000 --- a/contrib/block-box/scripts/cinder-api.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -INIT_DB=${INIT_DB:-true} - -if [ "$INIT_DB" = "true" ]; then -/bin/sh -c "cinder-manage db sync" -fi -cinder-api -d diff --git a/contrib/block-box/scripts/lvm-service.sh b/contrib/block-box/scripts/lvm-service.sh deleted file mode 100755 index d120aa28d0d..00000000000 --- a/contrib/block-box/scripts/lvm-service.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -YUM = $(which yum) -APT = $(which apt-get) - -# There's a few things that aren't in the older LOCI images, -# we'll add them here just to be safe -if [[ ! -z $YUM ]]; then - yum install -y epel-release - yum update -y - yum install -y scsi-target-utils -elif [[ ! -z $APT ]]; then - apt-get update -y - apt-get install -y thin-provisioning-tools - -else: - echo "I don't know how to install with this package manager" - exit 1; -fi - -sed -i -e 's/udev_sync = 1/udev_sync = 0/g' /etc/lvm/lvm.conf -sed -i -e 's/udev_rules = 1/udev_rules = 0/g' /etc/lvm/lvm.conf -sed -i -e 's/use_lvmetad = 0/use_lvmetad =1/g' /etc/lvm/lvm.conf -echo "include /var/lib/cinder/volumes/*" >> /etc/tgt/targets.conf -/usr/sbin/tgtd -cinder-volume -d