1 ##############################################################################
2 # Copyright (c) 2017 Nokia
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 heat_template_version: 2015-04-30
12 Used to run VMs with Vsperf
17 description: Name of the image
18 default: yardstick-vsperf
22 default: vsperf-flavor
26 description: Timeout in seconds for WaitCondition, depends on your image and environment
31 description: Name of the external network which management network will connect to
36 type: OS::Neutron::Net
41 type: OS::Neutron::Subnet
46 network: { get_resource: network }
49 type: OS::Neutron::Router
51 name: management_router
52 external_gateway_info:
53 network: { get_param: external_net_name }
55 management_router_interface:
56 type: OS::Neutron::RouterInterface
58 router: { get_resource: management_router }
59 subnet: { get_resource: subnet }
62 type: OS::Neutron::FloatingIP
64 floating_network: { get_param: external_net_name }
66 floating_ip_association:
67 type: OS::Nova::FloatingIPAssociation
69 floating_ip: { get_resource: floating_ip }
70 server_id: {get_resource: vsperf_vm}
73 type: OS::Nova::KeyPair
76 public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD0RkXfW6pksd1cZmXuvXZF/Mlqqq3ahIGcGoULOC97XMpu0vdxMpcUwdjwGqMwEXTVyfHidu0l99bLqOCpSUKCmbWx3ONJ+1kqFx4HwsKEWLiyDYqsuMrDeZT1eFjC5avCoTcrIw2wq5NaBb00lDGagNZOeopaL5YIa4+PizEY23+cir24D67NU21Fg3JE92AIeGlNa4j66L3a+lL0hZq74Dilmp42wm4GsbplRO6KJfyaraowHb1X+TmhCjBgHk6M/OJ9yPAroZyJNcwjMAuuxhAYWRuT3SdbnoUR0RG2VhfDh0qNid7vOqLbhKPeaLLFmzkN+9w3WdCp6LbSYt87 yardstick@yardstick.opnfv.org
79 type: OS::Heat::WaitConditionHandle
82 type: OS::Heat::WaitCondition
84 handle: { get_resource: wait_handle }
86 timeout: { get_param: timeout }
89 type: OS::Nova::Server
90 depends_on: [subnet, keypair]
92 name: { get_param: "OS::stack_name" }
93 image: { get_param: image }
94 flavor: { get_param: flavor }
95 key_name: {get_resource: keypair}
97 - network: { get_resource: network }
99 user_data_format : RAW
104 cat <<'CEOF' > /tmp/vsperf_post_build.sh
105 echo "Install vswitchperf"
106 mv /root/vswitchperf /home/ubuntu
107 chown -R ubuntu:ubuntu /home/ubuntu/vswitchperf
108 cd /home/ubuntu/vswitchperf/systems
109 sudo -H -u ubuntu ./build_base_machine.sh
110 echo "Set password less access to MoonGen server"
111 sudo -H -u ubuntu ssh-keygen -b 2048 -t rsa -f /home/ubuntu/.ssh/id_rsa -N ''
112 sudo -H -u ubuntu touch /home/ubuntu/.cloud-warnings.skip
113 echo "Enable 1GB huge pages"
115 $NOTIFY --data-binary '{"status": "SUCCESS"}'
117 chmod +x /tmp/vsperf_post_build.sh
118 nohup /tmp/vsperf_post_build.sh &
120 $NOTIFY: { get_attr: ['wait_handle', 'curl_cli'] }
124 description: uuid of the VM
125 value: { get_attr: [ vsperf_vm, show,id ] }