diff --git a/controllerconfig/controllerconfig/controllerconfig/configassistant.py b/controllerconfig/controllerconfig/controllerconfig/configassistant.py index 68cdb39c7a..0b0a9ea918 100644 --- a/controllerconfig/controllerconfig/controllerconfig/configassistant.py +++ b/controllerconfig/controllerconfig/controllerconfig/configassistant.py @@ -486,7 +486,7 @@ class ConfigAssistant(): # HTTPS self.enable_https = False # Network config - self.vswitch_type = "ovs-dpdk" + self.vswitch_type = "none" # Authentication config self.admin_username = "admin" diff --git a/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/manifests/manifest.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/manifests/manifest.yaml index ca443b8c6e..3485c562ab 100644 --- a/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/manifests/manifest.yaml +++ b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/manifests/manifest.yaml @@ -589,6 +589,42 @@ data: - helm-toolkit --- schema: armada/Chart/v1 +metadata: + schema: metadata/Document/v1 + name: openstack-openvswitch +data: + chart_name: openvswitch + release: openstack-openvswitch + namespace: openstack + # If we deploy ovs-dpdk on the host, ovs pod will not be created. + # We can use "native wait" instead. But it's not supported in current armada version. + # Before we upgrade armada to new version, we comment the wait + # https://github.com/openstack/airship-armada/blob/master/armada/schemas/armada-chart-schema.yaml#L81-L111 + #wait: + # timeout: 1800 + install: + no_hooks: false + upgrade: + no_hooks: false + pre: + delete: + - type: job + labels: + release_group: osh-openstack-openvswitch + values: + labels: + ovs: + node_selector_key: openvswitch + node_selector_value: enabled + source: + type: tar + location: http://172.17.0.1/helm_charts/openvswitch-0.1.0.tgz + subpath: openvswitch + reference: master + dependencies: + - helm-toolkit +--- +schema: armada/Chart/v1 metadata: schema: metadata/Document/v1 name: openstack-nova @@ -2761,6 +2797,7 @@ data: sequenced: false chart_group: - openstack-libvirt + - openstack-openvswitch - openstack-nova - openstack-nova-api-proxy - openstack-neutron diff --git a/puppet-manifests/src/modules/platform/manifests/vswitch.pp b/puppet-manifests/src/modules/platform/manifests/vswitch.pp index 674b0006dc..194ae9a5c2 100644 --- a/puppet-manifests/src/modules/platform/manifests/vswitch.pp +++ b/puppet-manifests/src/modules/platform/manifests/vswitch.pp @@ -11,11 +11,12 @@ class platform::vswitch Class[$name] -> Class['::platform::network'] - $enable_unsafe_noiommu_mode = bool2num(!$iommu_enabled) - - exec {'vfio-iommu-mode': - command => "echo ${enable_unsafe_noiommu_mode} > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode", - require => Kmod::Load[$driver_type], + if $::platform::params::vswitch_type != 'none' { + $enable_unsafe_noiommu_mode = bool2num(!$iommu_enabled) + exec {'vfio-iommu-mode': + command => "echo ${enable_unsafe_noiommu_mode} > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode", + require => Kmod::Load[$driver_type], + } } include $vswitch_class diff --git a/sysinv/sysinv/sysinv/sysinv/common/constants.py b/sysinv/sysinv/sysinv/sysinv/common/constants.py index 20b3a19a04..2695d56263 100644 --- a/sysinv/sysinv/sysinv/sysinv/common/constants.py +++ b/sysinv/sysinv/sysinv/sysinv/common/constants.py @@ -280,6 +280,7 @@ VXLAN_MTU_OVERHEAD = 74 # Supported worker node vswitch types VSWITCH_TYPE_OVS_DPDK = "ovs-dpdk" VSWITCH_TYPE_NUAGE_VRS = "nuage_vrs" +VSWITCH_TYPE_NONE = "none" # Partition default sizes DEFAULT_IMAGE_STOR_SIZE = 10 diff --git a/sysinv/sysinv/sysinv/sysinv/common/utils.py b/sysinv/sysinv/sysinv/sysinv/common/utils.py index 65f3ee6ced..983a49bcc6 100644 --- a/sysinv/sysinv/sysinv/sysinv/common/utils.py +++ b/sysinv/sysinv/sysinv/sysinv/common/utils.py @@ -1952,3 +1952,8 @@ def has_openstack_compute(labels): # We haven't found the openstack compute node key. Return False return False + + +def get_vswitch_type(dbapi): + system = dbapi.isystem_get_one() + return system.capabilities.get('vswitch_type', None) diff --git a/sysinv/sysinv/sysinv/sysinv/helm/neutron.py b/sysinv/sysinv/sysinv/sysinv/helm/neutron.py index 981a695ba5..9bf672e990 100644 --- a/sysinv/sysinv/sysinv/sysinv/helm/neutron.py +++ b/sysinv/sysinv/sysinv/sysinv/helm/neutron.py @@ -200,6 +200,10 @@ class NeutronHelm(openstack.OpenstackBaseHelm): } } } + # if ovs runs on host, auto bridge add is covered by sysinv + if utils.get_vswitch_type(self.dbapi) == constants.VSWITCH_TYPE_NONE: + host_neutron['conf'].update({ + 'auto_bridge_add': self._get_host_bridges(host)}) host_list.append(host_neutron) return host_list @@ -216,6 +220,30 @@ class NeutronHelm(openstack.OpenstackBaseHelm): else: # if iface['iftype'] == constants.INTERFACE_TYPE_VLAN: return 2, iface['ifname'] + def _get_datapath_type(self): + if (utils.get_vswitch_type(self.dbapi) == + constants.VSWITCH_TYPE_OVS_DPDK): + return "netdev" + else: + return "system" + + def _get_host_bridges(self, host): + bridges = {} + index = 0 + for iface in sorted(self.dbapi.iinterface_get_by_ihost(host.id), + key=self._interface_sort_key): + if self._is_data_network_type(iface): + if any(dn.datanetwork_network_type in + [constants.DATANETWORK_TYPE_FLAT, + constants.DATANETWORK_TYPE_VLAN] for dn in + self._get_interface_datanets(iface)): + # obtain the assigned bridge for interface + brname = 'br-phy%d' % index + port_name = self._get_interface_port_name(iface) + bridges[brname] = port_name + index += 1 + return bridges + def _get_dynamic_ovs_agent_config(self, host): local_ip = None tunnel_types = None @@ -229,21 +257,24 @@ class NeutronHelm(openstack.OpenstackBaseHelm): if brname: datanets = self._get_interface_datanets(iface) for datanet in datanets: + dn_name = datanet['datanetwork_name'].strip() LOG.debug('_get_dynamic_ovs_agent_config ' - 'host=%s datanet=%s', host.hostname, datanet) - address = self._get_interface_primary_address( - self.context, host, iface) - if address: - local_ip = address + 'host=%s datanet=%s', host.hostname, dn_name) + if (datanet.datanetwork_network_type == + constants.DATANETWORK_TYPE_VXLAN): + local_ip = self._get_interface_primary_address( + self.context, host, iface) tunnel_types = constants.DATANETWORK_TYPE_VXLAN - else: - bridge_mappings += ('%s:%s,' % (datanet, brname)) - index += 1 + elif (datanet.datanetwork_network_type in + [constants.DATANETWORK_TYPE_FLAT, + constants.DATANETWORK_TYPE_VLAN]): + bridge_mappings += ('%s:%s,' % (dn_name, brname)) + index += 1 agent = {} ovs = { 'integration_bridge': 'br-int', - 'datapath_type': 'netdev', + 'datapath_type': self._get_datapath_type(), 'vhostuser_socket_dir': '/var/run/openvswitch', } @@ -277,7 +308,8 @@ class NeutronHelm(openstack.OpenstackBaseHelm): datanets = self._get_interface_datanets(iface) port_name = self._get_interface_port_name(iface) for datanet in datanets: - physical_device_mappings += ('%s:%s,' % (datanet, port_name)) + dn_name = datanet['datanetwork_name'].strip() + physical_device_mappings += ('%s:%s,' % (dn_name, port_name)) sriov_nic = { 'physical_device_mappings': str(physical_device_mappings), } @@ -330,7 +362,7 @@ class NeutronHelm(openstack.OpenstackBaseHelm): ifdatanets = self.dbapi.interface_datanetwork_get_by_interface( iface.uuid) - return [ifdn['datanetwork_name'].strip() for ifdn in ifdatanets] + return ifdatanets def _get_interface_port_name(self, iface): """ diff --git a/sysinv/sysinv/sysinv/sysinv/helm/openvswitch.py b/sysinv/sysinv/sysinv/sysinv/helm/openvswitch.py index e9e8699fd9..c2dbca81e3 100644 --- a/sysinv/sysinv/sysinv/sysinv/helm/openvswitch.py +++ b/sysinv/sysinv/sysinv/sysinv/helm/openvswitch.py @@ -6,6 +6,7 @@ from sysinv.common import constants from sysinv.common import exception +from sysinv.common import utils from sysinv.openstack.common import log as logging from sysinv.helm import common from sysinv.helm import openstack @@ -19,8 +20,18 @@ class OpenvswitchHelm(openstack.OpenstackBaseHelm): CHART = constants.HELM_CHART_OPENVSWITCH def get_overrides(self, namespace=None): + # helm has an issue with installing release of no pod + # https://github.com/helm/helm/issues/4295 + # once this is fixed, we can use 'manifests' instead of 'label' to + # control ovs enable or not overrides = { common.HELM_NS_OPENSTACK: { + 'labels': { + 'ovs': { + 'node_selector_key': 'openvswitch', + 'node_selector_value': self._ovs_label_value(), + } + } } } @@ -31,3 +42,9 @@ class OpenvswitchHelm(openstack.OpenstackBaseHelm): namespace=namespace) else: return overrides + + def _ovs_label_value(self): + if utils.get_vswitch_type(self.dbapi) == constants.VSWITCH_TYPE_NONE: + return "enabled" + else: + return "none"