2 ##############################################################################
3 # Copyright (c) 2017 Nokia
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 # modified image (yardstick-vsperf) must be uploaded to OpenStack
13 # must have a proper flavor (vsperf-flavor) for the image e.g.
14 # nova flavor-create vsperf-flavor auto 8192 80 6
15 # nova flavor-key vsperf-flavor set hw:numa_nodes=1
16 # nova flavor-key vsperf-flavor set hw:mem_page_size=1GB
17 # nova flavor-key vsperf-flavor set hw:cpu_policy=dedicated
18 # nova flavor-key vsperf-flavor set hw:vif_multiqueue_enabled=true
20 stackname="vsperf-install-stack"
21 template=vsperf_install.yml
22 new_image_name="yardstick-vsperf-server"
24 openstack stack create $stackname -f yaml -t $template
27 while [ "$progress" != "CREATE_COMPLETE" ]
30 echo "check stack status......."
31 show_output=$(openstack stack show $stackname)
32 progress=$(echo $show_output | sed 's/^.*stack_status . \([^ ]*\).*$/\1/')
34 if [ "$progress" == "CREATE_FAILED" ];then
35 echo "create $stackname failed"
40 # has to stop the instance before taking 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