2 ##############################################################################
3 # Copyright (c) 2017 ZTE corporation and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
12 # installs dpdk and pktgen packages on modified image
15 # modified image (yardstick-wily-server) must be uploaded to OpenStack
16 # heat must be installed: apt-get install python-heatclient, python-glanceclient, python-nova
17 # must have a public yardstick-key uploaded in openstack
18 # must have a proper flavor for the image (i.e. m1.small)
21 stackname="yardstick-modify-stack"
22 template=dpdk_install.yml
23 new_image_name="yardstick-image-pktgen-ready"
25 openstack stack create $stackname -f yaml -t $template
28 while [ "$progress" != "CREATE_COMPLETE" ]
31 echo "check stack status......."
32 show_output=$(openstack stack show $stackname)
33 progress=$(echo $show_output | sed 's/^.*stack_status . \([^ ]*\).*$/\1/')
35 if [ "$progress" == "CREATE_FAILED" ];then
36 echo "create $stackname failed"
41 # workaround: Without wait time, the file size of pktgen is zero in the snapshot.
44 status=$(nova image-create --poll $stackname $new_image_name)
45 if [[ "$status" =~ "Finished" ]];then
46 echo "$new_image_name finished"
49 nova delete $stackname
51 openstack stack delete --yes $stackname