Increase Swift disk size up to 2GB if Glance is enabled
Minimum Cinder volume size is 1GB so if Swift backend for Glance is only
1GB we can not upload volume to image.
Change-Id: Ifd4cb42bf96367ff3ada0c065fa258fa5ba635d9
diff --git a/lib/swift b/lib/swift
index 8a96615..5005ba0 100644
--- a/lib/swift
+++ b/lib/swift
@@ -64,11 +64,19 @@
S3_SERVICE_PORT=${S3_SERVICE_PORT:-8080}
fi
-# DevStack will create a loop-back disk formatted as XFS to store the
-# swift data. Set ``SWIFT_LOOPBACK_DISK_SIZE`` to the disk size in
-# kilobytes.
-# Default is 1 gigabyte.
-SWIFT_LOOPBACK_DISK_SIZE_DEFAULT=1G
+if is_service_enabled g-api; then
+ # Minimum Cinder volume size is 1G so if Swift backend for Glance is
+ # only 1G we can not upload volume to image.
+ # Increase Swift disk size up to 2G
+ SWIFT_LOOPBACK_DISK_SIZE_DEFAULT=2G
+else
+ # DevStack will create a loop-back disk formatted as XFS to store the
+ # swift data. Set ``SWIFT_LOOPBACK_DISK_SIZE`` to the disk size in
+ # kilobytes.
+ # Default is 1 gigabyte.
+ SWIFT_LOOPBACK_DISK_SIZE_DEFAULT=1G
+fi
+
# if tempest enabled the default size is 6 Gigabyte.
if is_service_enabled tempest; then
SWIFT_LOOPBACK_DISK_SIZE_DEFAULT=${SWIFT_LOOPBACK_DISK_SIZE:-6G}