Created
January 5, 2015 23:20
-
-
Save staybuzz/d871fd3d01438a34a70a to your computer and use it in GitHub Desktop.
Register Baremetal image created diskimage-builder for OpenStack Ironic with Glance
This file contains hidden or 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
# 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