Skip to content

Commit

Permalink
Merge pull request #226 from opensds/master
Browse files Browse the repository at this point in the history
Fix some bugs
  • Loading branch information
leonwanghui committed Dec 29, 2017
2 parents 91d2674 + 816f912 commit fabbab8
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 40 deletions.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- This form is for bug reports and feature requests! -->

**Is this a BUG REPORT or FEATURE REQUEST?**:

> Uncomment only one, leave it on its own line:
>
> /kind bug
> /kind feature

**What happened**:

**What you expected to happen**:

**How to reproduce it (as minimally and precisely as possible)**:


**Anything else we need to know?**:

**Environment**:
- Hotpot(release/branch) version:
- OS (e.g. from /etc/os-release):
- Kernel (e.g. `uname -a`):
- Install tools:
- Others:
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Thanks for sending a pull request! -->

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:
<!-- Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access)
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`.
-->
```release-note
```
82 changes: 42 additions & 40 deletions script/cluster/opensds-lvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
ETCD_DIR=etcd-v3.2.0-linux-amd64
OPENSDS_DIR=${HOME}/gopath/src/github.com/opensds/opensds
IMAGE_PATH=${HOME}/lvm.img
DEIVCE_PATH=/dev/loop1
VG_NAME=vg001
DEIVCE_PATH=$(losetup -f)
VG_NAME=opensds-vg001

# Install some lvm tools.
sudo apt-get install -y lvm2
Expand All @@ -28,18 +28,21 @@ if [ -z $HOME ];then
exit
fi

pvoutput=`pvdisplay`
vgoutput=`vgdisplay`

if [ ! -f ${IMAGE_PATH} ]; then
dd if=/dev/zero of=${IMAGE_PATH} bs=1GB count=20
fi
if [ ! -n "$pvoutput" ]; then

if losetup -a|grep -w "${HOME}/lvm.img"; then
DEIVCE_PATH=$(losetup -a|grep "${HOME}/lvm.img"| awk -F ':' '{print $1}')
fi

if ! pvs $DEIVCE_PATH; then
# Create a new physical volume.
losetup ${DEIVCE_PATH} ${IMAGE_PATH}
pvcreate ${DEIVCE_PATH}
fi
if [ ! -n "$vgoutput" ]; then

if ! vgs $VG_NAME; then
# Add pv in volume group.
vgcreate ${VG_NAME} ${DEIVCE_PATH}
fi
Expand All @@ -50,41 +53,40 @@ nohup sudo ./etcd > nohup.out 2> nohup.err < /dev/null &

# Create opensds config dir.
mkdir -p /etc/opensds
mkdir -p /etc/opensds/driver

# Config opensds backend info.
if [ ! -f /etc/opensds/opensds.conf ]; then
echo '
[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
# Specify which backends should be enabled, sample,ceph,cinder,lvm and so on.
enabled_backends = lvm
[lvm]
name = lvm
description = LVM Test
driver_name = lvm
config_path = /etc/opensds/driver/lvm.yaml
[database]
endpoint = localhost:2379,localhost:2380
driver = etcd
' >> /etc/opensds/opensds.conf
fi
if [ ! -f /etc/opensds/driver/lvm.yaml ]; then
echo '
pool:
vg001:
diskType: SSD
AZ: default
' >> /etc/opensds/driver/lvm.yaml
fi

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
# Specify which backends should be enabled, sample,ceph,cinder,lvm and so on.
enabled_backends = lvm
[lvm]
name = lvm
description = LVM Test
driver_name = lvm
config_path = /etc/opensds/driver/lvm.yaml
[database]
endpoint = localhost:2379,localhost:2380
driver = etcd
OPENSDS_GLOABL_CONFIG_DOC

cat > /etc/opensds/driver/lvm.yaml << OPENSDS_LVM_CONFIG_DOC
pool:
$VG_NAME:
diskType: NL-SAS
AZ: default
OPENSDS_LVM_CONFIG_DOC

# Run osdsdock and osdslet daemon in background.
cd ${OPENSDS_DIR}
Expand Down

0 comments on commit fabbab8

Please sign in to comment.