blob: 677d66b50dab920a6b4b40c6b1ed3738832d2604 [file] [log] [blame]
Sean Dagued0931212012-10-04 16:06:44 -04001# lib/tempest
Dean Troyer6d04fd72012-12-21 11:03:37 -06002# Install and configure Tempest
Sean Dagued0931212012-10-04 16:06:44 -04003
4# Dependencies:
5# ``functions`` file
Joe Gordon46400262013-06-30 04:32:27 -07006# ``lib/nova`` service is running
Sean Dagued0931212012-10-04 16:06:44 -04007# <list other global vars that are assumed to be defined>
Attila Fazekas3c529222013-01-21 06:50:33 +01008# - ``DEST``, ``FILES``
Attila Fazekas65c08462012-12-07 14:20:51 +01009# - ``ADMIN_PASSWORD``
10# - ``DEFAULT_IMAGE_NAME``
11# - ``S3_SERVICE_PORT``
12# - ``SERVICE_HOST``
13# - ``BASE_SQL_CONN`` ``lib/database`` declares
Maru Newby31c94ab2012-12-19 03:59:20 +000014# - ``PUBLIC_NETWORK_NAME``
15# - ``Q_USE_NAMESPACE``
16# - ``Q_ROUTER_NAME``
Attila Fazekas1d29d8b2013-01-07 15:51:32 +010017# - ``VIRT_DRIVER``
18# - ``LIBVIRT_TYPE``
Attila Fazekas97d3d202013-01-19 19:20:49 +010019# - ``KEYSTONE_SERVICE_PROTOCOL``, ``KEYSTONE_SERVICE_HOST`` from lib/keystone
Attila Fazekas2aa35172012-12-05 20:03:40 +010020# Optional Dependencies:
Attila Fazekas2aa35172012-12-05 20:03:40 +010021# ALT_* (similar vars exists in keystone_data.sh)
Attila Fazekas65c08462012-12-07 14:20:51 +010022# ``LIVE_MIGRATION_AVAILABLE``
23# ``USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION``
24# ``DEFAULT_INSTANCE_TYPE``
25# ``DEFAULT_INSTANCE_USER``
Giulio Fidente97e1bd02013-06-04 05:33:52 +020026# ``CINDER_MULTI_LVM_BACKEND``
Steve Bakerd5cccad2013-07-19 10:34:24 +120027# ``HEAT_CREATE_TEST_IMAGE``
Sean Dagued0931212012-10-04 16:06:44 -040028# ``stack.sh`` calls the entry points in this order:
29#
Attila Fazekas2aa35172012-12-05 20:03:40 +010030# install_tempest
31# configure_tempest
Attila Fazekas1d29d8b2013-01-07 15:51:32 +010032# init_tempest
Sean Dagued0931212012-10-04 16:06:44 -040033
34# Save trace setting
35XTRACE=$(set +o | grep xtrace)
36set +o xtrace
37
Dean Troyer6d04fd72012-12-21 11:03:37 -060038
Sean Dagued0931212012-10-04 16:06:44 -040039# Defaults
40# --------
41
Sean Dagued0931212012-10-04 16:06:44 -040042# Set up default directories
43TEMPEST_DIR=$DEST/tempest
Attila Fazekas2aa35172012-12-05 20:03:40 +010044TEMPEST_CONF_DIR=$TEMPEST_DIR/etc
45TEMPEST_CONF=$TEMPEST_CONF_DIR/tempest.conf
Matthew Treinish14ccba02013-07-29 16:15:53 -040046TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest}
Attila Fazekas2aa35172012-12-05 20:03:40 +010047
Dean Troyer6d04fd72012-12-21 11:03:37 -060048NOVA_SOURCE_DIR=$DEST/nova
49
Attila Fazekasbae02332013-05-09 09:24:49 +020050BUILD_INTERVAL=1
Attila Fazekas2aa35172012-12-05 20:03:40 +010051BUILD_TIMEOUT=400
Sean Dagued0931212012-10-04 16:06:44 -040052
Dean Troyer6d04fd72012-12-21 11:03:37 -060053
Scott Mosercde655a2013-02-20 12:33:39 -050054BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-0.3.1"
Attila Fazekas1d29d8b2013-01-07 15:51:32 +010055
Dean Troyercc6b4432013-04-08 15:38:03 -050056
57# Functions
58# ---------
Sean Dagued0931212012-10-04 16:06:44 -040059
Sean Dagued0931212012-10-04 16:06:44 -040060# configure_tempest() - Set config files, create data dirs, etc
61function configure_tempest() {
Matthew Treinish95fb0d42013-01-28 16:24:14 -050062 setup_develop $TEMPEST_DIR
Attila Fazekas65c08462012-12-07 14:20:51 +010063 local image_lines
64 local images
65 local num_images
66 local image_uuid
67 local image_uuid_alt
Attila Fazekas2aa35172012-12-05 20:03:40 +010068 local errexit
Attila Fazekas65c08462012-12-07 14:20:51 +010069 local password
70 local line
71 local flavors
72 local flavors_ref
73 local flavor_lines
Maru Newbya5c774e2012-12-10 10:40:01 +000074 local public_network_id
Maru Newby31c94ab2012-12-19 03:59:20 +000075 local public_router_id
Maru Newbya5c774e2012-12-10 10:40:01 +000076 local tenant_networks_reachable
Attila Fazekas1d29d8b2013-01-07 15:51:32 +010077 local boto_instance_type="m1.tiny"
Attila Fazekas386ae8c2013-10-21 09:27:18 +020078 local ssh_connect_method="fixed"
Attila Fazekas2aa35172012-12-05 20:03:40 +010079
Dean Troyer6d04fd72012-12-21 11:03:37 -060080 # TODO(afazekas):
Sean Dagued0931212012-10-04 16:06:44 -040081 # sudo python setup.py deploy
Attila Fazekas2aa35172012-12-05 20:03:40 +010082
83 # This function exits on an error so that errors don't compound and you see
Joe Gordon46400262013-06-30 04:32:27 -070084 # only the first error that occurred.
Attila Fazekas2aa35172012-12-05 20:03:40 +010085 errexit=$(set +o | grep errexit)
86 set -o errexit
87
Dean Troyer6d04fd72012-12-21 11:03:37 -060088 # Save IFS
Attila Fazekas2aa35172012-12-05 20:03:40 +010089 ifs=$IFS
90
91 # Glance should already contain images to be used in tempest
92 # testing. Here we simply look for images stored in Glance
93 # and set the appropriate variables for use in the tempest config
94 # We ignore ramdisk and kernel images, look for the default image
Attila Fazekas65c08462012-12-07 14:20:51 +010095 # ``DEFAULT_IMAGE_NAME``. If not found, we set the ``image_uuid`` to the
96 # first image returned and set ``image_uuid_alt`` to the second,
Attila Fazekas2aa35172012-12-05 20:03:40 +010097 # if there is more than one returned...
98 # ... Also ensure we only take active images, so we don't get snapshots in process
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -050099 declare -a images
100
101 while read -r IMAGE_NAME IMAGE_UUID; do
102 if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then
103 image_uuid="$IMAGE_UUID"
104 image_uuid_alt="$IMAGE_UUID"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100105 fi
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -0500106 images+=($IMAGE_UUID)
107 done < <(glance image-list --status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
108
109 case "${#images[*]}" in
110 0)
111 echo "Found no valid images to use!"
112 exit 1
113 ;;
114 1)
115 if [ -z "$image_uuid" ]; then
116 image_uuid=${images[0]}
117 image_uuid_alt=${images[0]}
118 fi
119 ;;
120 *)
121 if [ -z "$image_uuid" ]; then
122 image_uuid=${images[0]}
123 image_uuid_alt=${images[1]}
124 fi
125 ;;
126 esac
Attila Fazekas2aa35172012-12-05 20:03:40 +0100127
128 # Create tempest.conf from tempest.conf.sample
129 # copy every time, because the image UUIDS are going to change
130 cp $TEMPEST_CONF.sample $TEMPEST_CONF
131
Attila Fazekas65c08462012-12-07 14:20:51 +0100132 password=${ADMIN_PASSWORD:-secrete}
Attila Fazekas2aa35172012-12-05 20:03:40 +0100133
134 # See files/keystone_data.sh where alt_demo user
135 # and tenant are set up...
136 ALT_USERNAME=${ALT_USERNAME:-alt_demo}
137 ALT_TENANT_NAME=${ALT_TENANT_NAME:-alt_demo}
138
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100139 # If the ``DEFAULT_INSTANCE_TYPE`` not declared, use the new behavior
140 # Tempest creates instane types for himself
141 if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
Attila Fazekas02c0bcc2013-01-14 19:10:17 +0100142 nova flavor-create m1.nano 42 64 0 1
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100143 flavor_ref=42
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100144 boto_instance_type=m1.nano
Attila Fazekas02c0bcc2013-01-14 19:10:17 +0100145 nova flavor-create m1.micro 84 128 0 1
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100146 flavor_ref_alt=84
147 else
148 # Check Nova for existing flavors and, if set, look for the
149 # ``DEFAULT_INSTANCE_TYPE`` and use that.
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100150 boto_instance_type=$DEFAULT_INSTANCE_TYPE
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100151 flavor_lines=`nova flavor-list`
152 IFS=$'\r\n'
153 flavors=""
Dean Troyerceaa38b2012-12-12 17:09:57 -0600154 for line in $flavor_lines; do
155 f=$(echo $line | awk "/ $DEFAULT_INSTANCE_TYPE / { print \$2 }")
156 flavors="$flavors $f"
157 done
Attila Fazekas2aa35172012-12-05 20:03:40 +0100158
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100159 for line in $flavor_lines; do
160 flavors="$flavors `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`"
161 done
162
163 IFS=" "
164 flavors=($flavors)
165 num_flavors=${#flavors[*]}
166 echo "Found $num_flavors flavors"
167 if [[ $num_flavors -eq 0 ]]; then
168 echo "Found no valid flavors to use!"
169 exit 1
170 fi
171 flavor_ref=${flavors[0]}
172 flavor_ref_alt=$flavor_ref
Adalberto Medeiros63a71a22013-06-06 08:46:04 -0400173
174 # ensure flavor_ref and flavor_ref_alt have different values
175 # some resize instance in tempest tests depends on this.
176 for f in ${flavors[@]:1}; do
177 if [[ $f -ne $flavor_ref ]]; then
178 flavor_ref_alt=$f
179 break
180 fi
181 done
Attila Fazekas2aa35172012-12-05 20:03:40 +0100182 fi
183
Maru Newbya5c774e2012-12-10 10:40:01 +0000184 if [ "$Q_USE_NAMESPACE" != "False" ]; then
185 tenant_networks_reachable=false
Attila Fazekas386ae8c2013-10-21 09:27:18 +0200186 ssh_connect_method="floating"
Maru Newbya5c774e2012-12-10 10:40:01 +0000187 else
188 tenant_networks_reachable=true
189 fi
190
Attila Fazekas386ae8c2013-10-21 09:27:18 +0200191 ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method}
192
Maru Newbya5c774e2012-12-10 10:40:01 +0000193 if is_service_enabled q-l3; then
Mark McClainb05c8762013-07-06 23:29:39 -0400194 public_network_id=$(neutron net-list | grep $PUBLIC_NETWORK_NAME | \
Maru Newbya5c774e2012-12-10 10:40:01 +0000195 awk '{print $2}')
Maru Newby31c94ab2012-12-19 03:59:20 +0000196 if [ "$Q_USE_NAMESPACE" == "False" ]; then
197 # If namespaces are disabled, devstack will create a single
198 # public router that tempest should be configured to use.
Mark McClainb05c8762013-07-06 23:29:39 -0400199 public_router_id=$(neutron router-list | awk "/ $Q_ROUTER_NAME / \
Sean Dague101b4242013-10-22 08:47:11 -0400200 { print \$2 }")
Maru Newby31c94ab2012-12-19 03:59:20 +0000201 fi
Maru Newbya5c774e2012-12-10 10:40:01 +0000202 fi
203
Matthew Treinish859cc682013-07-26 15:22:44 -0400204 # Oslo
Matthew Treinish14ccba02013-07-29 16:15:53 -0400205 iniset $TEMPEST_CONF DEFAULT lock_path $TEMPEST_STATE_PATH
206 mkdir -p $TEMPEST_STATE_PATH
Matthew Treinish4ee4a012013-07-31 16:05:42 -0400207 iniset $TEMPEST_CONF DEFAULT use_stderr False
208 iniset $TEMPEST_CONF DEFAULT log_file tempest.log
Matthew Treinish385152c2013-08-09 11:13:28 -0400209 iniset $TEMPEST_CONF DEFAULT debug True
Matthew Treinish859cc682013-07-26 15:22:44 -0400210
Attila Fazekas2aa35172012-12-05 20:03:40 +0100211 # Timeouts
212 iniset $TEMPEST_CONF compute build_timeout $BUILD_TIMEOUT
213 iniset $TEMPEST_CONF volume build_timeout $BUILD_TIMEOUT
214 iniset $TEMPEST_CONF boto build_timeout $BUILD_TIMEOUT
215 iniset $TEMPEST_CONF compute build_interval $BUILD_INTERVAL
216 iniset $TEMPEST_CONF volume build_interval $BUILD_INTERVAL
217 iniset $TEMPEST_CONF boto build_interval $BUILD_INTERVAL
218 iniset $TEMPEST_CONF boto http_socket_timeout 5
219
Attila Fazekas97d3d202013-01-19 19:20:49 +0100220 # Identity
221 iniset $TEMPEST_CONF identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/"
222 iniset $TEMPEST_CONF identity password "$password"
223 iniset $TEMPEST_CONF identity alt_username $ALT_USERNAME
224 iniset $TEMPEST_CONF identity alt_password "$password"
225 iniset $TEMPEST_CONF identity alt_tenant_name $ALT_TENANT_NAME
226 iniset $TEMPEST_CONF identity admin_password "$password"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100227
Sean Daguec3771452013-06-13 14:23:37 -0400228 # Image
229 # for the gate we want to be able to override this variable so we aren't
230 # doing an HTTP fetch over the wide internet for this test
231 if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then
232 iniset $TEMPEST_CONF image http_image $TEMPEST_HTTP_IMAGE
233 fi
234
Attila Fazekas97d3d202013-01-19 19:20:49 +0100235 # Compute
Attila Fazekas2aa35172012-12-05 20:03:40 +0100236 iniset $TEMPEST_CONF compute change_password_available False
Sean Dague1c1aef02013-10-01 07:56:21 -0400237 # Note(nati) current tempest don't create network for each tenant
238 # so reuse same tenant for now
239 if is_service_enabled neutron; then
240 TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
241 fi
Nachi Ueno06fac372012-12-26 14:09:43 -0800242 iniset $TEMPEST_CONF compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
Attila Fazekas97d3d202013-01-19 19:20:49 +0100243 iniset $TEMPEST_CONF compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
Akihiro MOTOKI66afb472012-12-21 15:34:13 +0900244 iniset $TEMPEST_CONF compute network_for_ssh $PRIVATE_NETWORK_NAME
Attila Fazekas2aa35172012-12-05 20:03:40 +0100245 iniset $TEMPEST_CONF compute ip_version_for_ssh 4
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100246 iniset $TEMPEST_CONF compute ssh_timeout $BUILD_TIMEOUT
Attila Fazekas65c08462012-12-07 14:20:51 +0100247 iniset $TEMPEST_CONF compute image_ref $image_uuid
Attila Fazekas97d3d202013-01-19 19:20:49 +0100248 iniset $TEMPEST_CONF compute image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
Attila Fazekas65c08462012-12-07 14:20:51 +0100249 iniset $TEMPEST_CONF compute image_ref_alt $image_uuid_alt
Attila Fazekas97d3d202013-01-19 19:20:49 +0100250 iniset $TEMPEST_CONF compute image_alt_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
Attila Fazekas65c08462012-12-07 14:20:51 +0100251 iniset $TEMPEST_CONF compute flavor_ref $flavor_ref
252 iniset $TEMPEST_CONF compute flavor_ref_alt $flavor_ref_alt
Attila Fazekas2aa35172012-12-05 20:03:40 +0100253 iniset $TEMPEST_CONF compute live_migration_available ${LIVE_MIGRATION_AVAILABLE:-False}
Akihiro MOTOKI66afb472012-12-21 15:34:13 +0900254 iniset $TEMPEST_CONF compute use_block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
Attila Fazekas386ae8c2013-10-21 09:27:18 +0200255 iniset $TEMPEST_CONF compute ssh_connect_method $ssh_connect_method
Attila Fazekas97d3d202013-01-19 19:20:49 +0100256
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200257 # Compute admin
Attila Fazekas97d3d202013-01-19 19:20:49 +0100258 iniset $TEMPEST_CONF "compute-admin" password "$password" # DEPRECATED
Attila Fazekas2aa35172012-12-05 20:03:40 +0100259
Attila Fazekas2aa35172012-12-05 20:03:40 +0100260 iniset $TEMPEST_CONF network api_version 2.0
Maru Newbya5c774e2012-12-10 10:40:01 +0000261 iniset $TEMPEST_CONF network tenant_networks_reachable "$tenant_networks_reachable"
262 iniset $TEMPEST_CONF network public_network_id "$public_network_id"
Maru Newby31c94ab2012-12-19 03:59:20 +0000263 iniset $TEMPEST_CONF network public_router_id "$public_router_id"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100264
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200265 # boto
Attila Fazekas2aa35172012-12-05 20:03:40 +0100266 iniset $TEMPEST_CONF boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud"
267 iniset $TEMPEST_CONF boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100268 iniset $TEMPEST_CONF boto s3_materials_path "$BOTO_MATERIALS_PATH"
269 iniset $TEMPEST_CONF boto instance_type "$boto_instance_type"
270 iniset $TEMPEST_CONF boto http_socket_timeout 30
Attila Fazekas97d3d202013-01-19 19:20:49 +0100271 iniset $TEMPEST_CONF boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
Attila Fazekas2aa35172012-12-05 20:03:40 +0100272
Steve Bakerd5cccad2013-07-19 10:34:24 +1200273 # Orchestration test image
DennyZhang48e1bab2013-10-11 22:06:25 -0500274 if [[ "$HEAT_CREATE_TEST_IMAGE" = "True" ]]; then
Steve Bakerd5cccad2013-07-19 10:34:24 +1200275 disk_image_create /usr/share/tripleo-image-elements "vm fedora heat-cfntools" "i386" "fedora-vm-heat-cfntools-tempest"
276 iniset $TEMPEST_CONF orchestration image_ref "fedora-vm-heat-cfntools-tempest"
277 fi
278
William Marshall24d866e2013-07-02 12:26:31 -0500279 # Scenario
280 iniset $TEMPEST_CONF scenario img_dir "$FILES/images/cirros-0.3.1-x86_64-uec"
281
Joe Gordonbb8c6d42013-08-26 17:00:05 -0400282 # Large Ops Number
283 iniset $TEMPEST_CONF scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0}
284
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200285 # Volume
Giulio Fidente3632ab12013-09-10 02:51:26 +0200286 if is_service_enabled c-bak; then
287 iniset $TEMPEST_CONF volume volume_backup_enabled "True"
288 fi
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200289 CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND)
Ian Wienandc42ed252013-06-17 13:23:44 +1000290 if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200291 iniset $TEMPEST_CONF volume multi_backend_enabled "True"
292 iniset $TEMPEST_CONF volume backend1_name "LVM_iSCSI"
293 iniset $TEMPEST_CONF volume backend2_name "LVM_iSCSI_2"
294 fi
295
Julie Pichonfea70f82013-07-29 11:22:08 +0100296 # Dashboard
297 iniset $TEMPEST_CONF dashboard dashboard_url "http://$SERVICE_HOST/"
298 iniset $TEMPEST_CONF dashboard login_url "http://$SERVICE_HOST/auth/login/"
299
Ian Wienand7fa19022013-06-25 14:11:48 +1000300 # cli
301 iniset $TEMPEST_CONF cli cli_dir $NOVA_BIN_DIR
302
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400303 # service_available
Julie Pichonfea70f82013-07-29 11:22:08 +0100304 for service in nova cinder glance neutron swift heat horizon ; do
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400305 if is_service_enabled $service ; then
306 iniset $TEMPEST_CONF service_available $service "True"
307 else
308 iniset $TEMPEST_CONF service_available $service "False"
309 fi
310 done
311
Attila Fazekas2aa35172012-12-05 20:03:40 +0100312 echo "Created tempest configuration file:"
313 cat $TEMPEST_CONF
314
315 # Restore IFS
316 IFS=$ifs
317 #Restore errexit
318 $errexit
Sean Dagued0931212012-10-04 16:06:44 -0400319}
320
Sean Dagued0931212012-10-04 16:06:44 -0400321# install_tempest() - Collect source and prepare
322function install_tempest() {
323 git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
Sean Dagued0931212012-10-04 16:06:44 -0400324}
325
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100326# init_tempest() - Initialize ec2 images
327function init_tempest() {
Scott Mosercde655a2013-02-20 12:33:39 -0500328 local base_image_name=cirros-0.3.1-x86_64
329 # /opt/stack/devstack/files/images/cirros-0.3.1-x86_64-uec
Attila Fazekas3c529222013-01-21 06:50:33 +0100330 local image_dir="$FILES/images/${base_image_name}-uec"
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100331 local kernel="$image_dir/${base_image_name}-vmlinuz"
332 local ramdisk="$image_dir/${base_image_name}-initrd"
333 local disk_image="$image_dir/${base_image_name}-blank.img"
334 # if the cirros uec downloaded and the system is uec capable
335 if [ -f "$kernel" -a -f "$ramdisk" -a -f "$disk_image" -a "$VIRT_DRIVER" != "openvz" \
Sean Dague101b4242013-10-22 08:47:11 -0400336 -a \( "$LIBVIRT_TYPE" != "lxc" -o "$VIRT_DRIVER" != "libvirt" \) ]; then
337 echo "Prepare aki/ari/ami Images"
338 ( #new namespace
339 # tenant:demo ; user: demo
340 source $TOP_DIR/accrc/demo/demo
341 euca-bundle-image -i "$kernel" --kernel true -d "$BOTO_MATERIALS_PATH"
342 euca-bundle-image -i "$ramdisk" --ramdisk true -d "$BOTO_MATERIALS_PATH"
343 euca-bundle-image -i "$disk_image" -d "$BOTO_MATERIALS_PATH"
344 ) 2>&1 </dev/null | cat
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100345 else
346 echo "Boto materials are not prepared"
347 fi
348}
349
Sean Dagued0931212012-10-04 16:06:44 -0400350# Restore xtrace
351$XTRACE
Sean Dague584d90e2013-03-29 14:34:53 -0400352
353# Local variables:
354# mode: shell-script
355# End: