3 ##############################################################################
4 # Copyright (c) 2016 Red Hat Inc.
5 # Michael Chapman <michapma@redhat.com>, Tim Rozet <trozet@redhat.com>
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
13 RAMDISK=${ROLE}-bm-deploy-ramdisk
15 if [ -f $ROLE-overcloud-full.qcow2 ]; then
16 echo "Uploading ${RAMDISK}"
17 glance image-create --name ${RAMDISK} --disk-format ari --container-format ari --file ${ROLE}-ironic-python-agent.initramfs --is-public True
18 echo "Uploading $ROLE-overcloud-full.qcow2 "
19 KERNEL=$(glance image-show overcloud-full | grep 'kernel_id' | cut -d '|' -f 3 | xargs)
20 RAMDISK_ID=$(glance image-show ${RAMDISK} | grep id | awk {'print $4'})
21 glance image-create --name $ROLE-overcloud-full --disk-format qcow2 --file $ROLE-overcloud-full.qcow2 --container-format bare --property ramdisk_id=$RAMDISK_ID --property kernel_id=$KERNEL --is-public True
24 if [ "$ROLE" == "Controller" ]; then
25 sed -i "s/overcloud-full/Controller-overcloud-full/" opnfv-environment.yaml
26 sed -i '/OvercloudControlFlavor:/c\ OvercloudControlFlavor: control' opnfv-environment.yaml
29 if [ "$ROLE" == "Compute" ]; then
30 sudo sed -i "s/NovaImage: .*/NovaImage: Compute-overcloud-full/" /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
31 sudo sed -i '/OvercloudComputeFlavor:/c\ OvercloudComputeFlavor: compute' /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
34 if [ "$ROLE" == "BlockStorage" ]; then
35 sudo sed -i "s/BlockStorageImage: .*/BlockStorageImage: BlockStorage-overcloud-full/" /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
38 RAMDISK_ID=$(glance image-show ${RAMDISK} | grep id | awk {'print $4'})
39 nodes=$(ironic node-list | awk {'print $2'} | grep -Eo [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})
40 role=$(echo $ROLE | awk '{print tolower($0)}')
41 if [ "$role" == "controller" ]; then
44 for node in $nodes; do
45 if ironic node-show $node | grep profile:${role}; then
46 ironic node-update $node replace driver_info/deploy_ramdisk=${RAMDISK_ID}