Restart openvswitch-vswitch when requested
Restart requests can be sent by related charms. A request to restart services did not previously restart openvswitch. This change adds the ability to restart it. Closes-Bug: 1628093 Change-Id: I0f57d84e2cdaa103c18a1cdacd996f9421fba46c
This commit is contained in:
parent
7e4bd68494
commit
4463c334ca
@ -155,13 +155,14 @@ BASE_RESOURCE_MAP = OrderedDict([
|
|||||||
}),
|
}),
|
||||||
(OVS_DEFAULT, {
|
(OVS_DEFAULT, {
|
||||||
'services': ['openvswitch-switch'],
|
'services': ['openvswitch-switch'],
|
||||||
'contexts': [neutron_ovs_context.OVSDPDKDeviceContext()],
|
'contexts': [neutron_ovs_context.OVSDPDKDeviceContext(),
|
||||||
|
neutron_ovs_context.RemoteRestartContext(
|
||||||
|
['neutron-plugin', 'neutron-control'])],
|
||||||
}),
|
}),
|
||||||
(DPDK_INTERFACES, {
|
(DPDK_INTERFACES, {
|
||||||
'services': ['dpdk'],
|
'services': ['dpdk'],
|
||||||
'contexts': [neutron_ovs_context.DPDKDeviceContext()],
|
'contexts': [neutron_ovs_context.DPDKDeviceContext()],
|
||||||
}),
|
}),
|
||||||
|
|
||||||
(PHY_NIC_MTU_CONF, {
|
(PHY_NIC_MTU_CONF, {
|
||||||
'services': ['os-charm-phy-nic-mtu'],
|
'services': ['os-charm-phy-nic-mtu'],
|
||||||
'contexts': [context.PhyNICMTUContext()],
|
'contexts': [context.PhyNICMTUContext()],
|
||||||
@ -293,14 +294,9 @@ def resource_map():
|
|||||||
'neutron-openvswitch-agent'
|
'neutron-openvswitch-agent'
|
||||||
)
|
)
|
||||||
if not use_dpdk():
|
if not use_dpdk():
|
||||||
# NOTE; /etc/default/openvswitch only used for
|
|
||||||
# DPDK configuration so drop if DPDK not
|
|
||||||
# in use
|
|
||||||
del resource_map[OVS_DEFAULT]
|
|
||||||
del resource_map[DPDK_INTERFACES]
|
del resource_map[DPDK_INTERFACES]
|
||||||
else:
|
else:
|
||||||
del resource_map[OVS_CONF]
|
del resource_map[OVS_CONF]
|
||||||
del resource_map[OVS_DEFAULT]
|
|
||||||
del resource_map[DPDK_INTERFACES]
|
del resource_map[DPDK_INTERFACES]
|
||||||
return resource_map
|
return resource_map
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
# [ WARNING ]
|
# [ WARNING ]
|
||||||
# Configuration file maintained by Juju. Local changes may be overwritten.
|
# Configuration file maintained by Juju. Local changes may be overwritten.
|
||||||
# Configuration managed by neutron-openvswitch charm
|
# Configuration managed by neutron-openvswitch charm
|
||||||
|
# Service restart triggered by remote application: {{ restart_trigger }}
|
||||||
|
# {{ restart_trigger_ovs }}
|
||||||
###############################################################################
|
###############################################################################
|
||||||
{% if dpdk_enabled -%}
|
{% if dpdk_enabled -%}
|
||||||
DPDK_OPTS='--dpdk -c {{ cpu_mask }} -n 4 --socket-mem {{ socket_memory }} {{ device_whitelist }} --vhost-owner libvirt-qemu:kvm --vhost-perm 0660'
|
DPDK_OPTS='--dpdk -c {{ cpu_mask }} -n 4 --socket-mem {{ socket_memory }} {{ device_whitelist }} --vhost-owner libvirt-qemu:kvm --vhost-perm 0660'
|
||||||
|
@ -205,6 +205,7 @@ class TestNeutronOVSUtils(CharmTestCase):
|
|||||||
_regconfs = nutils.register_configs()
|
_regconfs = nutils.register_configs()
|
||||||
confs = ['/etc/neutron/neutron.conf',
|
confs = ['/etc/neutron/neutron.conf',
|
||||||
'/etc/neutron/plugins/ml2/ml2_conf.ini',
|
'/etc/neutron/plugins/ml2/ml2_conf.ini',
|
||||||
|
'/etc/default/openvswitch-switch',
|
||||||
'/etc/init/os-charm-phy-nic-mtu.conf']
|
'/etc/init/os-charm-phy-nic-mtu.conf']
|
||||||
self.assertItemsEqual(_regconfs.configs, confs)
|
self.assertItemsEqual(_regconfs.configs, confs)
|
||||||
|
|
||||||
@ -225,6 +226,7 @@ class TestNeutronOVSUtils(CharmTestCase):
|
|||||||
_regconfs = nutils.register_configs()
|
_regconfs = nutils.register_configs()
|
||||||
confs = ['/etc/neutron/neutron.conf',
|
confs = ['/etc/neutron/neutron.conf',
|
||||||
'/etc/neutron/plugins/ml2/openvswitch_agent.ini',
|
'/etc/neutron/plugins/ml2/openvswitch_agent.ini',
|
||||||
|
'/etc/default/openvswitch-switch',
|
||||||
'/etc/init/os-charm-phy-nic-mtu.conf']
|
'/etc/init/os-charm-phy-nic-mtu.conf']
|
||||||
self.assertItemsEqual(_regconfs.configs, confs)
|
self.assertItemsEqual(_regconfs.configs, confs)
|
||||||
|
|
||||||
@ -280,6 +282,7 @@ class TestNeutronOVSUtils(CharmTestCase):
|
|||||||
expect = OrderedDict([
|
expect = OrderedDict([
|
||||||
(nutils.NEUTRON_CONF, ['neutron-plugin-openvswitch-agent']),
|
(nutils.NEUTRON_CONF, ['neutron-plugin-openvswitch-agent']),
|
||||||
(ML2CONF, ['neutron-plugin-openvswitch-agent']),
|
(ML2CONF, ['neutron-plugin-openvswitch-agent']),
|
||||||
|
(nutils.OVS_DEFAULT, ['openvswitch-switch']),
|
||||||
(nutils.PHY_NIC_MTU_CONF, ['os-charm-phy-nic-mtu'])
|
(nutils.PHY_NIC_MTU_CONF, ['os-charm-phy-nic-mtu'])
|
||||||
])
|
])
|
||||||
self.assertEqual(expect, _restart_map)
|
self.assertEqual(expect, _restart_map)
|
||||||
|
Loading…
Reference in New Issue
Block a user