[CEPH] Update dev scripts for ceph to handle loopback devices
This is to update loopback devices creation script to take device names from developers in case if default devices are busy. Change-Id: Ie368ebdfdc64ea00ccf62cf61010beddcc2cf4ce
This commit is contained in:
parent
dac7c4f8bd
commit
385c0775b9
@ -2,6 +2,11 @@
|
||||
Deployment With Ceph
|
||||
====================
|
||||
|
||||
This script will create two loopback devices for ceph as one disk for OSD data and other disk for
|
||||
block DB and block WAL.
|
||||
If loop0 and loop1 devices are busy in your case , feel free to change them in
|
||||
parameters.
|
||||
|
||||
.. note::
|
||||
For other deployment options, select appropriate ``Deployment with ...``
|
||||
option from `Index <../developer/index.html>`__ page.
|
||||
@ -17,7 +22,7 @@ Alternatively, this step can be performed by running the script directly:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
./tools/deployment/developer/ceph/040-ceph.sh
|
||||
./tools/deployment/developer/ceph/040-ceph.sh /dev/loop0 /dev/loop1
|
||||
|
||||
Activate the OpenStack namespace to be able to use Ceph
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -109,10 +109,12 @@ Create loopback devices for CEPH
|
||||
|
||||
Create two loopback devices for ceph as one disk for OSD data and other disk for
|
||||
block DB and block WAL.
|
||||
If loop0 and loop1 devices are busy in your case , feel free to change them in parameters
|
||||
by using --ceph-osd-data and --ceph-osd-dbwal options.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
ansible all -i /opt/openstack-helm-infra/tools/gate/devel/multinode-inventory.yaml -m shell -s -a "/opt/openstack-helm/tools/deployment/common/setup-ceph-loopback-device.sh"
|
||||
ansible all -i /opt/openstack-helm-infra/tools/gate/devel/multinode-inventory.yaml -m shell -s -a "/opt/openstack-helm/tools/deployment/common/setup-ceph-loopback-device.sh --ceph-osd-data /dev/loop0 --ceph-osd-dbwal /dev/loop1"
|
||||
|
||||
Deploy Ceph
|
||||
-----------
|
||||
|
@ -1,13 +1,30 @@
|
||||
#!/bin/bash
|
||||
set -xe
|
||||
|
||||
sudo df -lh
|
||||
sudo lsblk
|
||||
sudo mkdir -p /var/lib/openstack-helm/ceph
|
||||
sudo truncate -s 10G /var/lib/openstack-helm/ceph/ceph-osd-data-loopbackfile.img
|
||||
sudo truncate -s 8G /var/lib/openstack-helm/ceph/ceph-osd-db-wal-loopbackfile.img
|
||||
sudo losetup /dev/loop0 /var/lib/openstack-helm/ceph/ceph-osd-data-loopbackfile.img
|
||||
sudo losetup /dev/loop1 /var/lib/openstack-helm/ceph/ceph-osd-db-wal-loopbackfile.img
|
||||
#lets verify the devices
|
||||
sudo df -lh
|
||||
sudo lsblk
|
||||
function setup_loopback_devices() {
|
||||
osd_data_device="$1"
|
||||
osd_wal_db_device="$2"
|
||||
sudo df -lh
|
||||
sudo lsblk
|
||||
sudo mkdir -p /var/lib/openstack-helm/ceph
|
||||
sudo truncate -s 10G /var/lib/openstack-helm/ceph/ceph-osd-data-loopbackfile.img
|
||||
sudo truncate -s 8G /var/lib/openstack-helm/ceph/ceph-osd-db-wal-loopbackfile.img
|
||||
sudo losetup $osd_data_device /var/lib/openstack-helm/ceph/ceph-osd-data-loopbackfile.img
|
||||
sudo losetup $osd_wal_db_device /var/lib/openstack-helm/ceph/ceph-osd-db-wal-loopbackfile.img
|
||||
#lets verify the devices
|
||||
sudo df -lh
|
||||
sudo lsblk
|
||||
}
|
||||
|
||||
while [[ "$#" > 0 ]]; do case $1 in
|
||||
-d|--ceph-osd-data) OSD_DATA_DEVICE="$2"; shift;shift;;
|
||||
-w|--ceph-osd-dbwal) OSD_DB_WAL_DEVICE="$2";shift;shift;;
|
||||
-v|--verbose) VERBOSE=1;shift;;
|
||||
*) echo "Unknown parameter passed: $1"; shift; shift;;
|
||||
esac; done
|
||||
|
||||
# verify params
|
||||
if [ -z "$OSD_DATA_DEVICE" ]; then OSD_DATA_DEVICE=/dev/loop0; echo "Ceph osd data device is not set so using ${OSD_DATA_DEVICE}"; fi
|
||||
if [ -z "$OSD_DB_WAL_DEVICE" ]; then OSD_DB_WAL_DEVICE=/dev/loop1; echo "Ceph osd db/wal device is not set so using ${OSD_DB_WAL_DEVICE}"; fi
|
||||
|
||||
|
||||
setup_loopback_devices $OSD_DATA_DEVICE $OSD_DB_WAL_DEVICE
|
||||
|
@ -169,8 +169,6 @@ pod:
|
||||
mds: 1
|
||||
mgr: 1
|
||||
rgw: 1
|
||||
deploy:
|
||||
tool: "ceph-volume"
|
||||
|
||||
EOF
|
||||
|
||||
|
@ -14,17 +14,10 @@
|
||||
|
||||
set -xe
|
||||
|
||||
export CEPH_OSD_DATA_DEVICE="$1"
|
||||
export CEPH_OSD_DB_WAL_DEVICE="$2"
|
||||
# Create loop back devices for ceph osds.
|
||||
sudo df -lh
|
||||
sudo lsblk
|
||||
sudo mkdir -p /var/lib/openstack-helm/ceph
|
||||
sudo truncate -s 10G /var/lib/openstack-helm/ceph/ceph-osd-data-loopbackfile.img
|
||||
sudo truncate -s 8G /var/lib/openstack-helm/ceph/ceph-osd-db-wal-loopbackfile.img
|
||||
sudo losetup /dev/loop0 /var/lib/openstack-helm/ceph/ceph-osd-data-loopbackfile.img
|
||||
sudo losetup /dev/loop1 /var/lib/openstack-helm/ceph/ceph-osd-db-wal-loopbackfile.img
|
||||
# lets check the devices
|
||||
sudo df -lh
|
||||
sudo lsblk
|
||||
./tools/deployment/common/setup-ceph-loopback-device.sh --ceph-osd-data ${CEPH_OSD_DATA_DEVICE} --ceph-osd-dbwal ${CEPH_OSD_DB_WAL_DEVICE}
|
||||
|
||||
#NOTE: Lint and package chart
|
||||
export HELM_CHART_ROOT_PATH="${HELM_CHART_ROOT_PATH:="${OSH_INFRA_PATH:="../openstack-helm-infra"}"}"
|
||||
|
Loading…
Reference in New Issue
Block a user