Skip to content

Instantly share code, notes, and snippets.

@staybuzz
Created January 5, 2015 23:20
Show Gist options
  • Save staybuzz/d871fd3d01438a34a70a to your computer and use it in GitHub Desktop.
Save staybuzz/d871fd3d01438a34a70a to your computer and use it in GitHub Desktop.
Register Baremetal image created diskimage-builder for OpenStack Ironic with Glance
# Usage:
# ./bm-image-register.sh [NAME]
# [NAME] -> except extension
# ex) ubuntu-image.(vmlinuz|initrd|qcow2) -> ubuntu-image
NAME=$1
BMKERNEL=$(glance image-create --name $NAME --public --disk-format aki < $NAME.vmlinuz | awk '/id/ {print $4}')
BMRAMDISK=$(glance image-create --name $NAME --public --disk-format ari < $NAME.initrd | awk '/id/ {print $4}')
glance image-create --name $NAME --public --disk-format qcow2 --container-format bare --property kernel_id=$BMKERNEL --property ramdisk_id=$BMRAMDISK < $NAME.qcow2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment