Skip to content

Commit 85081ef

Browse files
authored
Merge pull request #5 from bobuhiro11/support_ovs
Support ovs
2 parents 5e947a1 + 7714645 commit 85081ef

6 files changed

Lines changed: 221 additions & 34 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,47 @@ index b292da25..8514dd22 100644
1111
# service is not started by default
1212
start_service $MYSQL_SERVICE_NAME
1313
elif is_ubuntu; then
14+
diff --git a/lib/dstat b/lib/dstat
15+
index eb03ae0f..4e2f609e 100644
16+
--- a/lib/dstat
17+
+++ b/lib/dstat
18+
@@ -19,33 +19,17 @@ set +o xtrace
19+
20+
# install_dstat() - Install prerequisites for dstat services
21+
function install_dstat {
22+
- if is_service_enabled memory_tracker; then
23+
- # Install python libraries required by tools/mlock_report.py
24+
- pip_install_gr psutil
25+
- fi
26+
+ true
27+
}
28+
29+
# start_dstat() - Start running processes
30+
function start_dstat {
31+
- # A better kind of sysstat, with the top process per time slice
32+
- run_process dstat "$TOP_DIR/tools/dstat.sh $LOGDIR"
33+
-
34+
- # To enable memory_tracker add:
35+
- # enable_service memory_tracker
36+
- # to your localrc
37+
- run_process memory_tracker "$TOP_DIR/tools/memory_tracker.sh" "" "root"
38+
-
39+
- # TODO(jh): Fail when using the old service name otherwise consumers might
40+
- # never notice that is has been removed.
41+
- if is_service_enabled peakmem_tracker; then
42+
- die $LINENO "The peakmem_tracker service has been removed, use memory_tracker instead"
43+
- fi
44+
+ true
45+
}
46+
47+
# stop_dstat() stop dstat process
48+
function stop_dstat {
49+
- stop_process dstat
50+
- stop_process memory_tracker
51+
+ true
52+
}
53+
54+
# Restore xtrace
1455
diff --git a/lib/neutron_plugins/ovs_base b/lib/neutron_plugins/ovs_base
1556
index cc41a8cd..c64861d3 100644
1657
--- a/lib/neutron_plugins/ovs_base

compute/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ RUN apt-get update \
88
&& apt-get install -y --no-install-recommends \
99
ca-certificates=20211016~20.04.1 \
1010
patch=2.7.6-6 \
11-
systemd=245.4-4ubuntu3.18 \
11+
systemd=245.4-4ubuntu3.19 \
1212
sudo=1.8.31-1ubuntu1.2 \
1313
iproute2=5.5.0-1ubuntu1 \
1414
lsb=11.1.0ubuntu2 \
1515
git=1:2.25.1-1ubuntu3.6 \
1616
curl=7.68.0-1ubuntu2.14 \
1717
init=1.57 \
18+
ebtables=2.0.11-3build1 \
1819
&& apt-get -y clean \
1920
&& rm -rf /var/lib/apt/lists/* \
2021
&& curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /bin/wait-for-it.sh \
@@ -30,9 +31,9 @@ RUN git clone https://github.com/openstack/devstack.git \
3031

3132
COPY compute/local.conf /opt/stack/devstack/
3233
COPY compute/devstack.service /etc/systemd/system/
33-
COPY 0001-devstack-disable-ovs.patch /opt/stack/
34+
COPY 0001-devstack-disable-dstat.patch /opt/stack/
3435

35-
RUN patch -d ./devstack -p1 < 0001-devstack-disable-ovs.patch \
36+
RUN patch -d ./devstack -p1 < 0001-devstack-disable-dstat.patch \
3637
&& systemctl enable devstack
3738

3839
STOPSIGNAL SIGRTMIN+3

compute/local.conf

Lines changed: 64 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,72 @@
1+
#
2+
# Sample DevStack local.conf for Neutron ML2 OVS in compute node.
3+
#
4+
# This sample file is intended to be used for your typical DevStack environment
5+
# that's running all of OpenStack on a single host. This can also be used as
6+
# the first host of a multi-host test environment.
7+
#
8+
19
[[local|localrc]]
2-
ADMIN_PASSWORD=nomoresecret
3-
DATABASE_PASSWORD=stackdb
4-
RABBIT_PASSWORD=stackqueue
5-
SERVICE_PASSWORD=$ADMIN_PASSWORD
6-
LOGFILE=$DEST/logs/stack.sh.log
7-
LOGDAYS=2
8-
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
9-
SWIFT_REPLICAS=1
10-
SWIFT_DATA_DIR=$DEST/data
11-
12-
ENABLED_SERVICES=n-cpu,placement-client
1310

11+
GIT_BASE=https://github.com
12+
13+
DATABASE_PASSWORD=password
14+
RABBIT_PASSWORD=password
15+
SERVICE_PASSWORD=password
16+
SERVICE_TOKEN=password
17+
ADMIN_PASSWORD=password
18+
19+
Q_AGENT=openvswitch
20+
NEUTRON_AGENT=$Q_AGENT
21+
22+
# If your stack get failed with error: "Could not determine host ip address.
23+
# See local.conf for suggestions on setting HOST_IP." Try to uncomment
24+
# this line to set the proper host IP.
25+
#HOST_IP=<CHANGE_TO_YOUR_HOST_IP>
26+
27+
# Set the controller's IP
1428
SERVICE_HOST=172.28.0.2
1529
MYSQL_HOST=$SERVICE_HOST
1630
RABBIT_HOST=$SERVICE_HOST
31+
Q_HOST=$SERVICE_HOST
1732
GLANCE_HOSTPORT=$SERVICE_HOST:9292
1833

19-
GIT_BASE=https://github.com
34+
VNCSERVER_PROXYCLIENT_ADDRESS=$HOST_IP
35+
VNCSERVER_LISTEN=0.0.0.0
36+
37+
NOVNCPROXY_URL=${NOVNCPROXY_URL:-"http://$HOST_IP:6080/vnc_auto.html"}
38+
XVPVNCPROXY_URL=${XVPVNCPROXY_URL:-"http://$HOST_IP:6081/console"}
39+
40+
# Enable Compute and network services
41+
ENABLED_SERVICES=n-cpu,n-novnc,neutron,q-agt,q-l3,q-meta,q-dhcp
42+
# Enable network services only for network node
43+
#ENABLED_SERVICES=neutron,q-agt,q-l3,q-meta,q-dhcp
44+
45+
[[post-config|/$Q_PLUGIN_CONF_FILE]]
46+
[ovs]
47+
local_ip=$HOST_IP
48+
49+
[agent]
50+
tunnel_types=vxlan,gre
51+
# You can add more config options here for neutron-openvswith-agent, for instance
52+
# you can uncomment the followings settings to enable related functions.
53+
#l2_population=True
54+
#arp_responder=True
55+
#enable_distributed_routing=True
56+
# Uncomment the following to enable distributed DHCP for openvswitch agent
57+
# for your compute node.
58+
#extensions = dhcp
59+
60+
[[post-config|$Q_L3_CONF_FILE]]
61+
[DEFAULT]
62+
debug = False
63+
verbose = True
64+
65+
# You can add more config options here for neutron-l3-agent, for instance
66+
# you can uncomment the followings to enable dvr L3 agent mode.
67+
# You can also set agent mode to legacy or dvr_snat for your network node.
68+
#agent_mode=dvr
2069

21-
[[post-config|$NOVA_CONF]]
70+
# Uncomment the followings to anable fip_qos agent extension for L3 agent.
71+
#[agent]
72+
#extensions = fip_qos

controller/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ RUN apt-get update \
88
&& apt-get install -y --no-install-recommends \
99
ca-certificates=20211016~20.04.1 \
1010
patch=2.7.6-6 \
11-
systemd=245.4-4ubuntu3.18 \
11+
systemd=245.4-4ubuntu3.19 \
1212
sudo=1.8.31-1ubuntu1.2 \
1313
iproute2=5.5.0-1ubuntu1 \
1414
lsb=11.1.0ubuntu2 \
1515
git=1:2.25.1-1ubuntu3.6 \
1616
curl=7.68.0-1ubuntu2.14 \
1717
init=1.57 \
18+
ebtables=2.0.11-3build1 \
1819
&& apt-get -y clean \
1920
&& rm -rf /var/lib/apt/lists/* \
2021
&& curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /bin/wait-for-it.sh \
@@ -30,9 +31,9 @@ RUN git clone https://github.com/openstack/devstack.git \
3031

3132
COPY controller/local.conf /opt/stack/devstack/
3233
COPY controller/devstack.service /etc/systemd/system/
33-
COPY 0001-devstack-disable-ovs.patch /opt/stack/
34+
COPY 0001-devstack-disable-dstat.patch /opt/stack/
3435

35-
RUN patch -d ./devstack -p1 < 0001-devstack-disable-ovs.patch \
36+
RUN patch -d ./devstack -p1 < 0001-devstack-disable-dstat.patch \
3637
&& systemctl enable devstack
3738

3839
STOPSIGNAL SIGRTMIN+3

controller/local.conf

Lines changed: 87 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,91 @@
1+
#
2+
# Sample DevStack local.conf for Neutron ML2 OVS.
3+
#
4+
# This sample file is intended to be used for your typical DevStack environment
5+
# that's running all of OpenStack on a single host. This can also be used as
6+
# the first host of a multi-host test environment.
7+
#
8+
19
[[local|localrc]]
2-
ADMIN_PASSWORD=nomoresecret
3-
DATABASE_PASSWORD=stackdb
4-
RABBIT_PASSWORD=stackqueue
5-
SERVICE_PASSWORD=$ADMIN_PASSWORD
6-
LOGFILE=$DEST/logs/stack.sh.log
7-
LOGDAYS=2
8-
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
9-
SWIFT_REPLICAS=1
10-
SWIFT_DATA_DIR=$DEST/data
11-
12-
ENABLED_SERVICES=rabbit,mysql,key
13-
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cond,n-sch,placement-api,placement-client
14-
ENABLED_SERVICES+=,g-api,g-reg
15-
ENABLED_SERVICES+=,horizon
1610

1711
GIT_BASE=https://github.com
1812

19-
[[post-config|$NOVA_CONF]]
13+
DATABASE_PASSWORD=password
14+
RABBIT_PASSWORD=password
15+
SERVICE_PASSWORD=password
16+
SERVICE_TOKEN=password
17+
ADMIN_PASSWORD=password
18+
19+
# If your stack get failed with error: "Could not determine host ip address.
20+
# See local.conf for suggestions on setting HOST_IP." Try to uncomment
21+
# this line to set the proper host IP.
22+
#HOST_IP=<CHANGE_TO_YOUR_HOST_IP>
23+
24+
# Horizon (the web UI) is enabled by default. You may want to disable
25+
# it here to speed up DevStack a bit.
26+
enable_service horizon
27+
#disable_service horizon
28+
29+
# Cinder (OpenStack Block Storage) is disabled by default to speed up
30+
# DevStack a bit. You may enable it here if you would like to use it.
31+
disable_service cinder c-sch c-api c-vol
32+
33+
# Disable Tempest - The OpenStack Integration Test Suite.
34+
disable_service tempest
35+
36+
# Disable OpenStack Swift - the object/blob store service.
37+
disable_service swift
38+
39+
# Disable ML2 OVN plugin, driver and services
40+
disable_service ovn
41+
disable_service ovn-controller
42+
disable_service ovn-northd
43+
disable_service q-ovn-metadata-agent
44+
45+
# Use openvswitch as the ml2 plugin driver
46+
Q_AGENT=openvswitch
47+
48+
# Enable Neutron services neutron-server, neutron-openvswitch-agent,
49+
# neutron-dhcp-agent, neutron-l3-agent and neutron-metadata-agent
50+
enable_service q-svc
51+
enable_service q-agt
52+
enable_service q-dhcp
53+
enable_service q-l3
54+
enable_service q-meta
55+
56+
[[post-config|$NEUTRON_CONF]]
57+
[DEFAULT]
58+
debug = True
59+
verbose = True
60+
61+
# Features available for ML2 OVS, uncomment to enforce DVR and L3 HA
62+
#router_distributed=True
63+
#l3_ha = True
64+
65+
# You can add more config options here for neutron.conf
66+
# to achive more precise control of the functions for neutron server.
67+
68+
[[post-config|/$Q_PLUGIN_CONF_FILE]]
69+
[ml2]
70+
type_drivers=flat,gre,vlan,vxlan
71+
tenant_network_types=vxlan
72+
mechanism_drivers=openvswitch,l2population
73+
74+
[agent]
75+
tunnel_types=vxlan,gre
76+
77+
# You can add more config options here for ml2_conf.ini, for instance
78+
# you can uncomment the followings to set the segment ID ranges for
79+
# various tenant network types.
80+
81+
#[ml2_type_vxlan]
82+
#vni_ranges=1:10000
83+
84+
#[ml2_type_flat]
85+
#flat_networks = *
86+
87+
#[ml2_type_gre]
88+
#tunnel_id_ranges = 1:10000
89+
90+
#[ml2_type_vlan]
91+
#network_vlan_ranges = tenant:1:1000

docker-compose.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ services:
88
dockerfile: controller/Dockerfile
99
privileged: true
1010
tty: true
11+
volumes:
12+
- '/lib/modules:/lib/modules'
13+
sysctls:
14+
net.ipv6.conf.all.disable_ipv6: 0
15+
net.ipv6.conf.default.disable_ipv6: 0
16+
environment:
17+
- HOST_IP=172.28.0.2
1118
networks:
1219
management_network:
1320
ipv4_address: 172.28.0.2
@@ -19,6 +26,13 @@ services:
1926
dockerfile: compute/Dockerfile
2027
privileged: true
2128
tty: true
29+
volumes:
30+
- '/lib/modules:/lib/modules'
31+
sysctls:
32+
net.ipv6.conf.all.disable_ipv6: 0
33+
net.ipv6.conf.default.disable_ipv6: 0
34+
environment:
35+
- HOST_IP=172.28.0.3
2236
networks:
2337
management_network:
2438
ipv4_address: 172.28.0.3
@@ -30,6 +44,13 @@ services:
3044
dockerfile: compute/Dockerfile
3145
privileged: true
3246
tty: true
47+
volumes:
48+
- '/lib/modules:/lib/modules'
49+
sysctls:
50+
net.ipv6.conf.all.disable_ipv6: 0
51+
net.ipv6.conf.default.disable_ipv6: 0
52+
environment:
53+
- HOST_IP=172.28.0.4
3354
networks:
3455
management_network:
3556
ipv4_address: 172.28.0.4

0 commit comments

Comments
 (0)