Add glance client
* python-glanceclient overrides the old client shipped with glance in /usr/local/bin * start adding exercises Change-Id: I460ed5749bca69425f23d328c0537c2ef91f84a4
This commit is contained in:
parent
4fcab6d0cf
commit
45495258d6
@ -51,7 +51,7 @@ DEFAULT_FLOATING_POOL=${DEFAULT_FLOATING_POOL:-nova}
|
|||||||
# =================
|
# =================
|
||||||
|
|
||||||
# Grab the id of the image to launch
|
# Grab the id of the image to launch
|
||||||
IMAGE=`glance -f index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
|
IMAGE=`glance image-list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1`
|
||||||
die_if_not_set IMAGE "Failure getting image"
|
die_if_not_set IMAGE "Failure getting image"
|
||||||
|
|
||||||
# Instance and volume names
|
# Instance and volume names
|
||||||
|
@ -46,7 +46,9 @@ unset OS_AUTH_URL
|
|||||||
|
|
||||||
# Common authentication args
|
# Common authentication args
|
||||||
TENANT_ARG="--os_tenant_name=$x_TENANT_NAME"
|
TENANT_ARG="--os_tenant_name=$x_TENANT_NAME"
|
||||||
|
TENANT_ARG_DASH="--os-tenant-name=$x_TENANT_NAME"
|
||||||
ARGS="--os_username=$x_USERNAME --os_password=$x_PASSWORD --os_auth_url=$x_AUTH_URL"
|
ARGS="--os_username=$x_USERNAME --os_password=$x_PASSWORD --os_auth_url=$x_AUTH_URL"
|
||||||
|
ARGS_DASH="--os-username=$x_USERNAME --os-password=$x_PASSWORD --os-auth-url=$x_AUTH_URL"
|
||||||
|
|
||||||
# Set global return
|
# Set global return
|
||||||
RETURN=0
|
RETURN=0
|
||||||
@ -94,7 +96,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
|
|||||||
STATUS_GLANCE="Skipped"
|
STATUS_GLANCE="Skipped"
|
||||||
else
|
else
|
||||||
echo -e "\nTest Glance"
|
echo -e "\nTest Glance"
|
||||||
if glance $TENANT_ARG $ARGS index; then
|
if glance $TENANT_ARG_DASH $ARGS_DASH image-list; then
|
||||||
STATUS_GLANCE="Succeeded"
|
STATUS_GLANCE="Succeeded"
|
||||||
else
|
else
|
||||||
STATUS_GLANCE="Failed"
|
STATUS_GLANCE="Failed"
|
||||||
|
@ -107,7 +107,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
|
|||||||
STATUS_GLANCE="Skipped"
|
STATUS_GLANCE="Skipped"
|
||||||
else
|
else
|
||||||
echo -e "\nTest Glance"
|
echo -e "\nTest Glance"
|
||||||
if glance index; then
|
if glance image-list; then
|
||||||
STATUS_GLANCE="Succeeded"
|
STATUS_GLANCE="Succeeded"
|
||||||
else
|
else
|
||||||
STATUS_GLANCE="Failed"
|
STATUS_GLANCE="Failed"
|
||||||
|
@ -63,10 +63,10 @@ nova list
|
|||||||
nova image-list
|
nova image-list
|
||||||
|
|
||||||
# But we recommend using glance directly
|
# But we recommend using glance directly
|
||||||
glance -f index
|
glance image-list
|
||||||
|
|
||||||
# Grab the id of the image to launch
|
# Grab the id of the image to launch
|
||||||
IMAGE=`glance -f index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
|
IMAGE=$(glance image-list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
|
||||||
|
|
||||||
# Security Groups
|
# Security Groups
|
||||||
# ---------------
|
# ---------------
|
||||||
|
@ -53,10 +53,10 @@ nova list
|
|||||||
nova image-list
|
nova image-list
|
||||||
|
|
||||||
# But we recommend using glance directly
|
# But we recommend using glance directly
|
||||||
glance -f index
|
glance image-list
|
||||||
|
|
||||||
# Grab the id of the image to launch
|
# Grab the id of the image to launch
|
||||||
IMAGE=`glance -f index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
|
IMAGE=$(glance image-list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
|
||||||
|
|
||||||
# determinine instance type
|
# determinine instance type
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
@ -30,7 +30,7 @@ catalog.RegionOne.s3.internalURL = http://%SERVICE_HOST%:%S3_SERVICE_PORT%
|
|||||||
catalog.RegionOne.s3.name = S3 Service
|
catalog.RegionOne.s3.name = S3 Service
|
||||||
|
|
||||||
|
|
||||||
catalog.RegionOne.image.publicURL = http://%SERVICE_HOST%:9292/v1
|
catalog.RegionOne.image.publicURL = http://%SERVICE_HOST%:9292
|
||||||
catalog.RegionOne.image.adminURL = http://%SERVICE_HOST%:9292/v1
|
catalog.RegionOne.image.adminURL = http://%SERVICE_HOST%:9292
|
||||||
catalog.RegionOne.image.internalURL = http://%SERVICE_HOST%:9292/v1
|
catalog.RegionOne.image.internalURL = http://%SERVICE_HOST%:9292
|
||||||
catalog.RegionOne.image.name = Image Service
|
catalog.RegionOne.image.name = Image Service
|
||||||
|
15
stack.sh
15
stack.sh
@ -201,6 +201,7 @@ OFFLINE=`trueorfalse False $OFFLINE`
|
|||||||
NOVA_DIR=$DEST/nova
|
NOVA_DIR=$DEST/nova
|
||||||
HORIZON_DIR=$DEST/horizon
|
HORIZON_DIR=$DEST/horizon
|
||||||
GLANCE_DIR=$DEST/glance
|
GLANCE_DIR=$DEST/glance
|
||||||
|
GLANCECLIENT_DIR=$DEST/python-glanceclient
|
||||||
KEYSTONE_DIR=$DEST/keystone
|
KEYSTONE_DIR=$DEST/keystone
|
||||||
NOVACLIENT_DIR=$DEST/python-novaclient
|
NOVACLIENT_DIR=$DEST/python-novaclient
|
||||||
KEYSTONECLIENT_DIR=$DEST/python-keystoneclient
|
KEYSTONECLIENT_DIR=$DEST/python-keystoneclient
|
||||||
@ -643,6 +644,7 @@ git_clone $NOVA_REPO $NOVA_DIR $NOVA_BRANCH
|
|||||||
# python client library to nova that horizon (and others) use
|
# python client library to nova that horizon (and others) use
|
||||||
git_clone $KEYSTONECLIENT_REPO $KEYSTONECLIENT_DIR $KEYSTONECLIENT_BRANCH
|
git_clone $KEYSTONECLIENT_REPO $KEYSTONECLIENT_DIR $KEYSTONECLIENT_BRANCH
|
||||||
git_clone $NOVACLIENT_REPO $NOVACLIENT_DIR $NOVACLIENT_BRANCH
|
git_clone $NOVACLIENT_REPO $NOVACLIENT_DIR $NOVACLIENT_BRANCH
|
||||||
|
git_clone $GLANCECLIENT_REPO $GLANCECLIENT_DIR $GLANCECLIENT_BRANCH
|
||||||
|
|
||||||
# glance, swift middleware and nova api needs keystone middleware
|
# glance, swift middleware and nova api needs keystone middleware
|
||||||
if is_service_enabled key g-api n-api swift; then
|
if is_service_enabled key g-api n-api swift; then
|
||||||
@ -715,6 +717,9 @@ if is_service_enabled melange; then
|
|||||||
cd $MELANGECLIENT_DIR; sudo python setup.py develop
|
cd $MELANGECLIENT_DIR; sudo python setup.py develop
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Do this _after_ glance is installed to override the old binary
|
||||||
|
cd $GLANCECLIENT_DIR; sudo python setup.py develop
|
||||||
|
|
||||||
|
|
||||||
# Syslog
|
# Syslog
|
||||||
# ------
|
# ------
|
||||||
@ -1854,21 +1859,19 @@ if is_service_enabled g-reg; then
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$CONTAINER_FORMAT" = "bare" ]; then
|
if [ "$CONTAINER_FORMAT" = "bare" ]; then
|
||||||
glance add --silent-upload -A $TOKEN name="$IMAGE_NAME" is_public=true container_format=$CONTAINER_FORMAT disk_format=$DISK_FORMAT < <(zcat --force "${IMAGE}")
|
glance --os-auth-token $TOKEN --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME" --public --container-format=$CONTAINER_FORMAT --disk-format $DISK_FORMAT < <(zcat --force "${IMAGE}")
|
||||||
else
|
else
|
||||||
# Use glance client to add the kernel the root filesystem.
|
# Use glance client to add the kernel the root filesystem.
|
||||||
# We parse the results of the first upload to get the glance ID of the
|
# We parse the results of the first upload to get the glance ID of the
|
||||||
# kernel for use when uploading the root filesystem.
|
# kernel for use when uploading the root filesystem.
|
||||||
KERNEL_ID=""; RAMDISK_ID="";
|
KERNEL_ID=""; RAMDISK_ID="";
|
||||||
if [ -n "$KERNEL" ]; then
|
if [ -n "$KERNEL" ]; then
|
||||||
RVAL=`glance add --silent-upload -A $TOKEN name="$IMAGE_NAME-kernel" is_public=true container_format=aki disk_format=aki < "$KERNEL"`
|
KERNEL_ID=$(glance --os-auth-token $TOKEN --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME-kernel" --public --container-format aki --disk-format aki < "$KERNEL" | grep ' id ' | get_field 2)
|
||||||
KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
|
|
||||||
fi
|
fi
|
||||||
if [ -n "$RAMDISK" ]; then
|
if [ -n "$RAMDISK" ]; then
|
||||||
RVAL=`glance add --silent-upload -A $TOKEN name="$IMAGE_NAME-ramdisk" is_public=true container_format=ari disk_format=ari < "$RAMDISK"`
|
RAMDISK_ID=$(glance --os-auth-token $TOKEN --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME-ramdisk" --public --container-format ari --disk-format ari < "$RAMDISK" | grep ' id ' | get_field 2)
|
||||||
RAMDISK_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
|
|
||||||
fi
|
fi
|
||||||
glance add -A $TOKEN name="${IMAGE_NAME%.img}" is_public=true container_format=ami disk_format=ami ${KERNEL_ID:+kernel_id=$KERNEL_ID} ${RAMDISK_ID:+ramdisk_id=$RAMDISK_ID} < <(zcat --force "${IMAGE}")
|
glance --os-auth-token $TOKEN --os-image-url http://$GLANCE_HOSTPORT image-create --name "${IMAGE_NAME%.img}" --public --container-format ami --disk-format ami ${KERNEL_ID:+--property kernel_id=$KERNEL_ID} ${RAMDISK_ID:+--property ramdisk_id=$RAMDISK_ID} < "${IMAGE}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
8
stackrc
8
stackrc
@ -17,14 +17,14 @@ NOVA_BRANCH=master
|
|||||||
SWIFT_REPO=https://github.com/openstack/swift.git
|
SWIFT_REPO=https://github.com/openstack/swift.git
|
||||||
SWIFT_BRANCH=master
|
SWIFT_BRANCH=master
|
||||||
|
|
||||||
# swift and keystone integration
|
|
||||||
SWIFT_KEYSTONE_REPO=https://github.com/cloudbuilders/swift-keystone2.git
|
|
||||||
SWIFT_KEYSTONE_BRANCH=master
|
|
||||||
|
|
||||||
# image catalog service
|
# image catalog service
|
||||||
GLANCE_REPO=https://github.com/openstack/glance.git
|
GLANCE_REPO=https://github.com/openstack/glance.git
|
||||||
GLANCE_BRANCH=master
|
GLANCE_BRANCH=master
|
||||||
|
|
||||||
|
# python glance client library
|
||||||
|
GLANCECLIENT_REPO=https://github.com/openstack/python-glanceclient
|
||||||
|
GLANCECLIENT_BRANCH=master
|
||||||
|
|
||||||
# unified auth system (manages accounts/tokens)
|
# unified auth system (manages accounts/tokens)
|
||||||
KEYSTONE_REPO=https://github.com/openstack/keystone.git
|
KEYSTONE_REPO=https://github.com/openstack/keystone.git
|
||||||
KEYSTONE_BRANCH=master
|
KEYSTONE_BRANCH=master
|
||||||
|
Loading…
Reference in New Issue
Block a user