summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2016-08-09 00:39:41 -0700
committerGuo Ruijing <ruijing.guo@intel.com>2016-08-09 00:41:15 -0700
commit62d85e89b0f8bf5b5c3d04186d3c754f8f30488f (patch)
treef505a61d8822f32ed29f509ceb0252e5ca2d907d
parente3814c93624fd510454462613eda10a4db61081c (diff)
Support DPDK & non-DPDK since DPDK needs special cpu features
Change-Id: I1a2d704bf66aafa66d81a1f233ea4312430d809a Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Notes
Notes (review): Code-Review+2: Ruijing <ruijing.guo@intel.com> Workflow+1: Ruijing <ruijing.guo@intel.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 09 Aug 2016 07:52:38 +0000 Reviewed-on: https://review.openstack.org/352753 Project: openstack/fuel-plugin-ovs Branch: refs/heads/master
-rwxr-xr-xdemo/04_setup_fuel.sh24
-rw-r--r--demo/fuel-slave-dpdk.xml102
-rw-r--r--demo/fuel-slave.xml12
3 files changed, 119 insertions, 19 deletions
diff --git a/demo/04_setup_fuel.sh b/demo/04_setup_fuel.sh
index 34b942d..63d1578 100755
--- a/demo/04_setup_fuel.sh
+++ b/demo/04_setup_fuel.sh
@@ -1,6 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2 2
3DNS_SERVER=${DNS_SERVER:-10.248.2.1} 3DNS_SERVER=${DNS_SERVER:-10.248.2.1}
4SUPPORT_DPDK=${SUPPORT_DPDK:-false}
4 5
5#setup ntp server 6#setup ntp server
6sudo service ntp restart 7sudo service ntp restart
@@ -17,9 +18,12 @@ sudo brctl delbr br-eth1
17sudo brctl addbr br-eth1 18sudo brctl addbr br-eth1
18sudo ifconfig br-eth1 172.16.0.1/24 up 19sudo ifconfig br-eth1 172.16.0.1/24 up
19 20
20sudo ifconfig br-dpdk down 21if [ $SUPPORT_DPDK = 'true' ]
21sudo brctl delbr br-dpdk 22then
22sudo brctl addbr br-dpdk 23 sudo ifconfig br-dpdk down
24 sudo brctl delbr br-dpdk
25 sudo brctl addbr br-dpdk
26fi
23 27
24sudo iptables -t nat -D PREROUTING -j PRE_FUEL 28sudo iptables -t nat -D PREROUTING -j PRE_FUEL
25sudo iptables -t nat -N PRE_FUEL 29sudo iptables -t nat -N PRE_FUEL
@@ -74,13 +78,19 @@ do
74 sleep 20 78 sleep 20
75done 79done
76 80
81if [ $SUPPORT_DPDK = 'true' ]
82then
83 fuel_slave='fuel-slave-dpdk'
84else
85 fuel_slave='fuel-slave'
86fi
77#setup slave 87#setup slave
78for i in {1..4}; do 88for i in {1..4}; do
79 sudo virsh destroy fuel-slave-$i 89 sudo virsh destroy fuel-slave-$i
80 sudo rm -rf /var/lib/libvirt/images/fuel-slave-${i}.img 90 sudo rm -rf /var/lib/libvirt/images/$fuel_slave-${i}.img
81 sudo qemu-img create -f qcow2 /var/lib/libvirt/images/fuel-slave-${i}.img 200G 91 sudo qemu-img create -f qcow2 /var/lib/libvirt/images/$fuel_slave-${i}.img 200G
82 sed "s/FUEL_SLAVE/fuel-slave-$i/g" fuel-slave.xml > vms/fuel-slave-${i}.xml 92 sed "s/FUEL_SLAVE/fuel-slave-$i/g" $fuel_slave.xml > vms/$fuel_slave-${i}.xml
83 sudo virsh create vms/fuel-slave-${i}.xml 93 sudo virsh create vms/$fuel_slave-${i}.xml
84done 94done
85 95
86#setup web browser 96#setup web browser
diff --git a/demo/fuel-slave-dpdk.xml b/demo/fuel-slave-dpdk.xml
new file mode 100644
index 0000000..bd1f4d7
--- /dev/null
+++ b/demo/fuel-slave-dpdk.xml
@@ -0,0 +1,102 @@
1<domain type='kvm' id='75'>
2 <name>FUEL_SLAVE</name>
3 <memory unit='KiB'>4194304</memory>
4 <currentMemory unit='KiB'>4194304</currentMemory>
5 <vcpu placement='static'>4</vcpu>
6 <resource>
7 <partition>/machine</partition>
8 </resource>
9 <os>
10 <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
11 <boot dev='network'/>
12 <bootmenu enable='no' />
13 </os>
14 <features>
15 <acpi/>
16 <apic/>
17 <pae/>
18 </features>
19 <cpu mode='custom' match='exact'>
20 <model fallback='allow'>SandyBridge</model>
21 <vendor>Intel</vendor>
22 <feature policy='require' name='aes'/>
23 <feature policy='require' name='avx'/>
24 <feature policy='require' name='avx2'/>
25 <feature policy='require' name='f16c'/>
26 <feature policy='require' name='fsgsbase'/>
27 <feature policy='require' name='pclmuldq'/>
28 <feature policy='require' name='rdrand'/>
29 <feature policy='require' name='sse'/>
30 <feature policy='require' name='sse2'/>
31 <feature policy='require' name='ssse3'/>
32 <feature policy='require' name='sse4.1'/>
33 <feature policy='require' name='sse4.2'/>
34 </cpu>
35 <clock offset='utc'/>
36 <on_poweroff>destroy</on_poweroff>
37 <on_reboot>restart</on_reboot>
38 <on_crash>restart</on_crash>
39 <devices>
40 <emulator>/usr/bin/qemu-system-x86_64</emulator>
41 <disk type='file' device='disk'>
42 <driver name='qemu' type='qcow2'/>
43 <source file='/var/lib/libvirt/images/FUEL_SLAVE.img'/>
44 <target dev='vda' bus='virtio'/>
45 <alias name='virtio-disk0'/>
46 <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
47 </disk>
48 <controller type='usb' index='0'>
49 <alias name='usb0'/>
50 <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
51 </controller>
52 <controller type='pci' index='0' model='pci-root'>
53 <alias name='pci.0'/>
54 </controller>
55 <interface type='bridge'>
56 <source bridge='br-eth0'/>
57 <model type='e1000' />
58 <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
59 </interface>
60 <interface type='bridge'>
61 <source bridge='br-eth1'/>
62 <model type='e1000' />
63 <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
64 </interface>
65 <interface type='bridge'>
66 <source bridge='br-dpdk'/>
67 <model type='e1000' />
68 <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
69 </interface>
70 <serial type='pty'>
71 <source path='/dev/pts/20'/>
72 <target port='0'/>
73 <alias name='serial0'/>
74 </serial>
75 <console type='pty' tty='/dev/pts/20'>
76 <source path='/dev/pts/20'/>
77 <target type='serial' port='0'/>
78 <alias name='serial0'/>
79 </console>
80 <input type='mouse' bus='ps2'/>
81 <input type='keyboard' bus='ps2'/>
82 <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
83 <listen type='address' address='127.0.0.1'/>
84 </graphics>
85 <sound model='ich6'>
86 <alias name='sound0'/>
87 <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
88 </sound>
89 <video>
90 <model type='cirrus' vram='9216' heads='1'/>
91 <alias name='video0'/>
92 <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
93 </video>
94 <memballoon model='virtio'>
95 <alias name='balloon0'/>
96 <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
97 </memballoon>
98 </devices>
99 <seclabel type='dynamic' model='apparmor' relabel='yes'>
100 </seclabel>
101</domain>
102
diff --git a/demo/fuel-slave.xml b/demo/fuel-slave.xml
index bd1f4d7..68741c1 100644
--- a/demo/fuel-slave.xml
+++ b/demo/fuel-slave.xml
@@ -19,18 +19,6 @@
19 <cpu mode='custom' match='exact'> 19 <cpu mode='custom' match='exact'>
20 <model fallback='allow'>SandyBridge</model> 20 <model fallback='allow'>SandyBridge</model>
21 <vendor>Intel</vendor> 21 <vendor>Intel</vendor>
22 <feature policy='require' name='aes'/>
23 <feature policy='require' name='avx'/>
24 <feature policy='require' name='avx2'/>
25 <feature policy='require' name='f16c'/>
26 <feature policy='require' name='fsgsbase'/>
27 <feature policy='require' name='pclmuldq'/>
28 <feature policy='require' name='rdrand'/>
29 <feature policy='require' name='sse'/>
30 <feature policy='require' name='sse2'/>
31 <feature policy='require' name='ssse3'/>
32 <feature policy='require' name='sse4.1'/>
33 <feature policy='require' name='sse4.2'/>
34 </cpu> 22 </cpu>
35 <clock offset='utc'/> 23 <clock offset='utc'/>
36 <on_poweroff>destroy</on_poweroff> 24 <on_poweroff>destroy</on_poweroff>