Skip to content

How to Run Containerized OpenSDS for Testing Work

Leon Wang edited this page Feb 6, 2018 · 19 revisions

Pre-configuration

Before you start, some configurations are required:

mkdir -p /etc/opensds && sudo cat > /etc/opensds/opensds.conf <<OPENSDS_GLOABL_CONFIG_DOC
[osdslet]
api_endpoint = localhost:50040
graceful = True
log_file = /var/log/opensds/osdslet.log
socket_order = inc

[osdsdock]
api_endpoint = localhost:50050
log_file = /var/log/opensds/osdsdock.log
# Enabled backend types, such as 'sample', 'lvm', 'ceph', 'cinder', etc.
enabled_backends = sample

[sample]
name = sample
description = Sample backend for testing
driver_name = default

[database]
# Enabled database types, such as etcd, mysql, fake, etc.
driver = etcd
endpoint = 127.0.0.1:2379,127.0.0.1:2380
OPENSDS_GLOABL_CONFIG_DOC

OpenSDS Service Installation

If you are a lazy one, just like me, you probably want to do this:(docker-compose required)

wget https://raw.githubusercontent.com/opensds/opensds/master/docker-compose.yml

docker-compose up

Or you can do this:

docker run -d --net=host -v /usr/share/ca-certificates/:/etc/ssl/certs quay.io/coreos/etcd:latest

docker run -d --net=host -v /etc/opensds:/etc/opensds opensdsio/opensds-controller:latest

docker run -d --net=host -v /etc/opensds:/etc/opensds opensdsio/opensds-dock:latest

If you are a smart guy, you probably need to configure your service ip and database endpoint:

docker run -d --net=host -v /etc/opensds:/etc/opensds opensdsio/opensds-controller:latest /usr/bin/osdslet --api-endpoint=127.0.0.1:50040 --db-endpoint=127.0.0.1:2379,127.0.0.1:2380

docker run -d --net=host -v /etc/opensds:/etc/opensds opensdsio/opensds-dock:latest /usr/bin/osdsdock --api-endpoint=127.0.0.1:50050 --db-endpoint=127.0.0.1:2379,127.0.0.1:2380

Test

Download cli tool.

curl -sSL https://raw.githubusercontent.com/opensds/opensds/master/osdsctl/bin/osdsctl | mv osdsctl /usr/local/bin/

export OPENSDS_ENDPOINT=http://127.0.0.1:50040
osdsctl pool list

Create a default profile firstly.

osdsctl profile create '{"name": "default", "description": "default policy"}'

Create a volume.

osdsctl volume create 1 --name=test-001

List all volumes.

osdsctl volume list

Delete the volume.

osdsctl volume delete <your_volume_id>

After this is done, just enjoy it!

Clone this wiki locally