2019-11-27 18:16:03 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# $1: scenario / ceph store type
|
|
|
|
|
|
|
|
set -o xtrace
|
|
|
|
set -o errexit
|
|
|
|
|
2017-05-22 10:03:36 -07:00
|
|
|
mkdir -p /opt/data/kolla
|
|
|
|
|
2020-02-05 18:25:18 +01:00
|
|
|
if [ $1 = 'zun' ]; then
|
|
|
|
# create cinder-volumes volume group for cinder lvm backend
|
2019-01-17 12:24:01 +00:00
|
|
|
free_device=$(losetup -f)
|
|
|
|
fallocate -l 5G /var/lib/cinder_data.img
|
|
|
|
losetup $free_device /var/lib/cinder_data.img
|
|
|
|
pvcreate $free_device
|
|
|
|
vgcreate cinder-volumes $free_device
|
2019-11-27 18:16:03 +01:00
|
|
|
elif [ $1 = 'swift' ]; then
|
|
|
|
# swift partition
|
|
|
|
free_device=$(losetup -f)
|
|
|
|
fallocate -l 5G /var/lib/swift_data.img
|
|
|
|
losetup $free_device /var/lib/swift_data.img
|
|
|
|
parted $free_device -s -- mklabel gpt mkpart KOLLA_SWIFT_DATA 1 -1
|
|
|
|
free_partition=${free_device}p1
|
|
|
|
mkfs.xfs -L d0 $free_partition
|
2019-08-14 09:13:29 +00:00
|
|
|
elif [ $1 = 'ceph-lvm' ]; then
|
|
|
|
free_device=$(losetup -f)
|
|
|
|
fallocate -l 10G /var/lib/ceph-osd1.img
|
|
|
|
losetup $free_device /var/lib/ceph-osd1.img
|
|
|
|
pvcreate $free_device
|
|
|
|
vgcreate cephvg $free_device
|
|
|
|
lvcreate -l 100%FREE -n cephlv cephvg
|
2019-11-27 18:16:03 +01:00
|
|
|
else
|
|
|
|
echo "Unknown type" >&2
|
|
|
|
exit 1
|
2018-11-23 15:44:40 +08:00
|
|
|
fi
|
2018-05-08 07:27:56 +00:00
|
|
|
|
|
|
|
partprobe
|