Created
August 1, 2016 15:33
-
-
Save johnsom/e08a3b7cb44391952a0b2de3e71ba881 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export OCTAVIA_DIR=/opt/stack/octavia | |
# Out with the old | |
OLD_IMAGE=$(glance image-list | awk '/ amphora-x64-haproxy / {print $2}') | |
glance image-delete $OLD_IMAGE | |
sudo modprobe nbd | |
sudo qemu-nbd -c /dev/nbd0 $OCTAVIA_DIR/diskimage-create/amphora-x64-haproxy.qcow2 | |
sudo mount /dev/nbd0p1 /mnt | |
sudo bash | |
sudo umount /mnt | |
sudo qemu-nbd -d /dev/nbd0 | |
# Load me up a new one | |
glance image-create --name amphora-x64-haproxy --tags amphora --disk-format qcow2 --container-format bare --visibility public --file $OCTAVIA_DIR/diskimage-create/amphora-x64-haproxy.qcow2 --progress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment