From 9588fd1d990a380d2bd9978009cd0cc161d78c3d Mon Sep 17 00:00:00 2001 From: Paul Bourke Date: Tue, 8 Mar 2016 16:37:36 +0000 Subject: [PATCH] Document how to use loopback devices for Swift People commonly want to use loopback devices to evaulate or develop on Swift. The steps for this are slightly different than those for physical block devices. Also make some small fix ups to the title formatting. Change-Id: I0c1cb4a261f264dc56bd065ab137e5ee79e773f8 --- doc/swift-guide.rst | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/doc/swift-guide.rst b/doc/swift-guide.rst index c159b05363..87bbdb1af2 100644 --- a/doc/swift-guide.rst +++ b/doc/swift-guide.rst @@ -11,8 +11,8 @@ Before running Swift we need to generate "rings", which are binary compressed files that at a high level let the various Swift services know where data is in the cluster. We hope to automate this process in a future release. -disks with partition table (recommended) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Disks with a partition table (recommended) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Swift also expects block devices to be available for storage. To prepare a disk for use as Swift storage device, a special partition name and filesystem label @@ -30,8 +30,22 @@ Follow the example below to add 3 disks for an AIO demo setup. (( index++ )) done -disks without partition table -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +For evaluation, loopback devices can be used in lieu of real disks: + +:: + + index=0 + for d in sdc sdd sde; do + free_device=$(losetup -f) + fallocate -l 1G /tmp/$d + losetup $free_device /tmp/$d + parted $free_device -s -- mklabel gpt mkpart KOLLA_SWIFT_DATA 1 -1 + sudo mkfs.xfs -f -L d${index} ${free_device}p1 + (( index++ )) + done + +Disks without a partition table +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Kolla also supports unpartitioned disk (filesystem on /dev/sdc instead of /dev/sdc1) detection purely based on filesystem label. This is generally not a @@ -46,7 +60,7 @@ ansible/roles/swift/defaults/main.yml swift_devices_match_mode: "prefix" swift_devices_name: "swd" -rings +Rings ~~~~~ Run following commands locally to generate Rings for AIO demo setup. The