Skip to content

Instantly share code, notes, and snippets.

@johnsom
Created August 1, 2016 15:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnsom/e08a3b7cb44391952a0b2de3e71ba881 to your computer and use it in GitHub Desktop.
Save johnsom/e08a3b7cb44391952a0b2de3e71ba881 to your computer and use it in GitHub Desktop.
#!/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