kolla/devenv/get-image.sh
Daneyon Hansen cdb97831f5 Updates Heat Template for M3 Release
Updates the following:

1. Replaces Docker copr pkgs with binary
2. Updates docs
3. Adds compose from sdake GH repo
4. Adds required ebtables kernel module for nova-network
5. Adds container net/subnet info required for correct nova
networking functionality.
6. Consolidates pkgs installs from get-image script to the
heat template.

Change-Id: Ibec2dd5909bb8379c193b5cdbad665a5b6c2e8f8
2015-03-24 00:38:59 +00:00

34 lines
893 B
Bash
Executable File

#!/bin/bash
# This script expects the following to be installed:
# curl, libguestfs-tools-c
IMAGE_URL=http://archive.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64
IMAGE=Fedora-Cloud-Base-20141203-21.x86_64.qcow2
TARGET_DIR=/var/lib/libvirt/images
TARGET=fedora-21-x86_64
if ! [ -f "$IMAGE" ]; then
echo "Downloading $IMAGE"
curl -L -O $IMAGE_URL/$IMAGE
fi
echo "Copying $IMAGE to $TARGET"
cp "$IMAGE" $TARGET_DIR/$TARGET
virt-customize \
--add $TARGET_DIR/$TARGET \
--run-command "cat > /etc/sysconfig/network-scripts/ifcfg-eth1 <<EOF
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
DEFROUTE=no
EOF" \
# SELinux relabeling requires virt-customize to have networking disabled
# https://bugzilla.redhat.com/show_bug.cgi?id=1122907
virt-customize --add $TARGET_DIR/$TARGET --selinux-relabel --no-network
echo "Finished building image:"
ls -l $TARGET_DIR/$TARGET