diff --git a/nodepool/elements/README.rst b/nodepool/elements/README.rst index cb98263bcc..72b809a7c2 100644 --- a/nodepool/elements/README.rst +++ b/nodepool/elements/README.rst @@ -12,7 +12,7 @@ Install the dependencies: :: - sudo apt-get install kpartx qemu-utils curl + sudo apt-get install kpartx qemu-utils curl python-yaml Install diskimage-builder: @@ -28,9 +28,15 @@ Building an image is simple, we have a script! :: - bash tools/build-image.sh + DISTRO="ubuntu" bash tools/build-image.sh -You should be left with a file called devstack-gate-precise.qcow2. +See the script for environment variables to set distribution, etc. +You should be left with a .qcow2 image file of your selected +distribution. + +It is a good idea to set ``TMP_DIR`` to somewhere with plenty of space +to avoid the disappointment of a full-disk mid-way through the script +run. Mounting the image ------------------ diff --git a/nodepool/elements/cache-devstack/extra-data.d/55-cache-devstack-repos b/nodepool/elements/cache-devstack/extra-data.d/55-cache-devstack-repos index bb2afee4de..4aaa85f4b0 100755 --- a/nodepool/elements/cache-devstack/extra-data.d/55-cache-devstack-repos +++ b/nodepool/elements/cache-devstack/extra-data.d/55-cache-devstack-repos @@ -20,8 +20,20 @@ import os import subprocess import sys +# this is a bit weird; we want to get the filter to use on the +# devstack lib/[apt|rpm] files to pre-install them. So we have to +# swizzle things around +RELEASE=None +if 'DIB_RELEASE' in os.environ: + RELEASE=os.environ['DIB_RELEASE'] +if 'DISTRO_NAME' in os.environ: + if os.environ['DISTRO_NAME'] == 'centos7': + # centos7 matches as rhel7 in devstack + RELEASE='rhel7' +if not RELEASE: + print "Can not determine RELEASE" + sys.exit(1) -RELEASE = os.environ['DIB_RELEASE'] TMP_MOUNT_PATH = os.environ['TMP_MOUNT_PATH'] TMP_HOOKS_PATH = os.environ['TMP_HOOKS_PATH']