From 00d177e86e4b44b57f66cb549425195cf29a121b Mon Sep 17 00:00:00 2001 From: jerry Date: Thu, 28 Dec 2017 18:05:43 +0800 Subject: [PATCH 1/2] Fixed some bugs in opensdd-lvm script --- script/cluster/opensds-lvm.sh | 82 ++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/script/cluster/opensds-lvm.sh b/script/cluster/opensds-lvm.sh index e0de1b9cc..568d1b339 100755 --- a/script/cluster/opensds-lvm.sh +++ b/script/cluster/opensds-lvm.sh @@ -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 @@ -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 @@ -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} From 816f912d57d4e224245a7ae02b4d0bd30f64047f Mon Sep 17 00:00:00 2001 From: leonwanghui Date: Fri, 29 Dec 2017 10:16:41 +0800 Subject: [PATCH 2/2] Add issue and pull request draft template --- .github/ISSUE_TEMPLATE.md | 25 +++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 15 +++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..f34d7fe60 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,25 @@ + + +**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: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..fb9f65379 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,15 @@ + + +**What this PR does / why we need it**: + +**Which issue this PR fixes** *(optional, in `fixes #(, fixes #, ...)` format, will close that issue when PR gets merged)*: fixes # + +**Special notes for your reviewer**: + +**Release note**: + +```release-note +```