diff --git a/doc/source/admin/cpu-topologies.rst b/doc/source/admin/cpu-topologies.rst index f75bc95925a1..14fd95012328 100644 --- a/doc/source/admin/cpu-topologies.rst +++ b/doc/source/admin/cpu-topologies.rst @@ -31,13 +31,13 @@ Simultaneous Multi-Threading (SMT) CPUs on the system and can execute workloads in parallel. However, as with NUMA, threads compete for shared resources. -Non Uniform I/O Access (NUMA I/O) +Non-Uniform I/O Access (NUMA I/O) In a NUMA system, I/O to a device mapped to a local memory region is more efficient than I/O to a remote device. A device connected to the same socket providing the CPU and memory offers lower latencies for I/O operations due to its physical proximity. This generally manifests itself in devices connected to the PCIe bus, such as NICs or vGPUs, but applies to any device support - memory mapped I/O. + memory-mapped I/O. In OpenStack, SMP CPUs are known as *cores*, NUMA cells or nodes are known as *sockets*, and SMT CPUs are known as *threads*. For example, a quad-socket, diff --git a/nova/compute/api.py b/nova/compute/api.py index 6e20e6df22da..652f15c166b3 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -818,9 +818,8 @@ class API(base.Base): # InstancePCIRequests object pci_request_info = pci_request.get_pci_requests_from_flavor( instance_type) - - network_metadata = self.network_api.create_resource_requests(context, - requested_networks, pci_request_info) + network_metadata = self.network_api.create_resource_requests( + context, requested_networks, pci_request_info) base_options = { 'reservation_id': reservation_id, diff --git a/nova/network/neutronv2/api.py b/nova/network/neutronv2/api.py index 760b8af2e2d5..62e08fb402ed 100644 --- a/nova/network/neutronv2/api.py +++ b/nova/network/neutronv2/api.py @@ -1753,9 +1753,6 @@ class API(base_api.NetworkAPI): segments, the first segment that defines a physnet value will be used for the physnet name. """ - def is_tunneled(net): - return net.get('provider:network_type') in L3_NETWORK_TYPES - if self._has_multi_provider_extension(context, neutron=neutron): network = neutron.show_network(net_id, fields='segments').get('network') @@ -1772,7 +1769,7 @@ class API(base_api.NetworkAPI): # physical networks. physnet_name = net.get('provider:physical_network') if physnet_name: - return physnet_name, is_tunneled(net) + return physnet_name, False # Raising here as at least one segment should # have a physical network provided. @@ -1784,7 +1781,8 @@ class API(base_api.NetworkAPI): net = neutron.show_network( net_id, fields=['provider:physical_network', 'provider:network_type']).get('network') - return net.get('provider:physical_network'), is_tunneled(net) + return (net.get('provider:physical_network'), + net.get('provider:network_type') in L3_NETWORK_TYPES) @staticmethod def _get_trusted_mode_from_port(port): diff --git a/nova/objects/fields.py b/nova/objects/fields.py index 06b596eb2f35..0e03b5d0afa5 100644 --- a/nova/objects/fields.py +++ b/nova/objects/fields.py @@ -78,7 +78,6 @@ PCIAddressField = fields.PCIAddressField Enum = fields.Enum Field = fields.Field FieldType = fields.FieldType -String = fields.String Set = fields.Set Dict = fields.Dict List = fields.List @@ -92,7 +91,7 @@ IPV6Network = fields.IPV6Network class SetOfStringsField(AutoTypedField): - AUTO_TYPE = Set(String()) + AUTO_TYPE = Set(fields.String()) class BaseNovaEnum(Enum): diff --git a/nova/objects/network_metadata.py b/nova/objects/network_metadata.py index e01afb384e2c..5a8913e5bbf4 100644 --- a/nova/objects/network_metadata.py +++ b/nova/objects/network_metadata.py @@ -18,7 +18,7 @@ from nova.objects import fields @base.NovaObjectRegistry.register class NetworkMetadata(base.NovaObject): - """Hold aggregate metadata for a collection on networks. + """Hold aggregate metadata for a collection of networks. This object holds aggregate information for a collection of neutron networks. There are two types of network collections we care about and use diff --git a/nova/tests/unit/conf/test_neutron.py b/nova/tests/unit/conf/test_neutron.py index b784486f9d46..0c272a9d35fc 100644 --- a/nova/tests/unit/conf/test_neutron.py +++ b/nova/tests/unit/conf/test_neutron.py @@ -31,3 +31,5 @@ class NeutronConfTestCase(test.NoDBTestCase): self.assertIn('neutron_physnet_foo', CONF) self.assertIn('neutron_physnet_bar', CONF) + self.assertIn('neutron_tunnel', CONF) + self.assertIn('numa_nodes', CONF.neutron_tunnel) diff --git a/nova/tests/unit/virt/test_hardware.py b/nova/tests/unit/virt/test_hardware.py index 13b0ce8e6ba4..6fd4be409ce6 100644 --- a/nova/tests/unit/virt/test_hardware.py +++ b/nova/tests/unit/virt/test_hardware.py @@ -3451,7 +3451,7 @@ class NetworkRequestSupportTestCase(test.NoDBTestCase): def test_multiple_networks(self): """Validate behavior with multiple networks. - If a we request multiple networks that are spread across host NUMA + If we request multiple networks that are spread across host NUMA nodes, we're going to need to use multiple host instances. """ network_metadata = objects.NetworkMetadata(