aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/networking/ping6_setup.bash
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark/scenarios/networking/ping6_setup.bash')
-rw-r--r--yardstick/benchmark/scenarios/networking/ping6_setup.bash84
1 files changed, 84 insertions, 0 deletions
diff --git a/yardstick/benchmark/scenarios/networking/ping6_setup.bash b/yardstick/benchmark/scenarios/networking/ping6_setup.bash
new file mode 100644
index 000000000..2a54da2ba
--- /dev/null
+++ b/yardstick/benchmark/scenarios/networking/ping6_setup.bash
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# download and create image
+source /opt/admin-openrc.sh
+wget https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-22-20150521.x86_64.qcow2
+glance image-create --name 'Fedora22' --disk-format qcow2 \
+--container-format bare --file ./Fedora-Cloud-Base-22-20150521.x86_64.qcow2
+
+# create external network
+neutron net-create net04_ext --router:external --provider:physical_network physnet \
+--provider:network_type vlan --provider:segmentation_id 1411
+neutron subnet-create net04_ext 10.145.140.0/24 --name net04_ext__subnet \
+--allocation-pool start=10.145.140.13,end=10.145.140.20 --disable-dhcp --gateway 10.145.140.1
+
+# create router
+neutron router-create ipv4-router
+neutron router-create ipv6-router
+
+
+# create (ipv4,ipv6)router and net and subnet
+neutron net-create --port_security_enabled=False ipv4-int-network1
+neutron net-create --port_security_enabled=False ipv6-int-network2
+
+# Create IPv4 subnet and associate it to ipv4-router
+neutron subnet-create --name ipv4-int-subnet1 \
+--dns-nameserver 8.8.8.8 ipv4-int-network1 20.0.0.0/24
+neutron router-interface-add ipv4-router ipv4-int-subnet1
+
+# Associate the net04_ext to the Neutron routers
+neutron router-gateway-set ipv6-router net04_ext
+neutron router-gateway-set ipv4-router net04_ext
+
+# Create two subnets, one IPv4 subnet ipv4-int-subnet2 and
+# one IPv6 subnet ipv6-int-subnet2 in ipv6-int-network2, and associate both subnets to ipv6-router
+neutron subnet-create --name ipv4-int-subnet2 --dns-nameserver 8.8.8.8 ipv6-int-network2 10.0.0.0/24
+neutron subnet-create --name ipv6-int-subnet2 \
+ --ip-version 6 --ipv6-ra-mode slaac --ipv6-address-mode slaac ipv6-int-network2 2001:db8:0:1::/64
+
+
+neutron router-interface-add ipv6-router ipv4-int-subnet2
+neutron router-interface-add ipv6-router ipv6-int-subnet2
+
+
+# create key
+nova keypair-add vRouterKey > ~/vRouterKey
+
+# Create ports for vRouter
+neutron port-create --name eth0-vRouter --mac-address fa:16:3e:11:11:11 ipv6-int-network2
+neutron port-create --name eth1-vRouter --mac-address fa:16:3e:22:22:22 ipv4-int-network1
+
+# Create ports for VM1 and VM2.
+neutron port-create --name eth0-VM1 --mac-address fa:16:3e:33:33:33 ipv4-int-network1
+neutron port-create --name eth0-VM2 --mac-address fa:16:3e:44:44:44 ipv4-int-network1
+
+# Update ipv6-router with routing information to subnet 2001:db8:0:2::/64
+neutron router-update ipv6-router \
+ --routes type=dict list=true destination=2001:db8:0:2::/64,nexthop=2001:db8:0:1:f816:3eff:fe11:1111
+
+# vRouter boot
+nova boot --image Fedora22 --flavor m1.small \
+--user-data ./metadata.txt \
+--nic port-id=$(neutron port-list | grep -w eth0-vRouter | awk '{print $2}') \
+--nic port-id=$(neutron port-list | grep -w eth1-vRouter | awk '{print $2}') \
+--key-name vRouterKey vRouter
+
+# VM create
+nova boot --image Fedora22 --flavor m1.small \
+--nic port-id=$(neutron port-list | grep -w eth0-VM1 | awk '{print $2}') \
+--key-name vRouterKey VM1
+
+nova boot --image Fedora22 --flavor m1.small \
+--nic port-id=$(neutron port-list | grep -w eth0-VM2 | awk '{print $2}') \
+--key-name vRouterKey VM2
+
+nova list