参考链接:https://www.mirantis.com/blog/mirantis-openstack-7-0-nfvi-deployment-guide-numacpu-pinning/


Nova已经有这个功能了,主要注意下qemu的版本

yum reinstall centos-release
yum install centos-release-qemu-ev
yum update qemu-kvm-ev

MariaDB [nova]> use nova;
MariaDB [nova]> select * from compute_nodes\G;       # 能获取到numa_topology的信息就表示正常了
*************************** 2. row ***************************
          created_at: 2016-08-19 06:55:26
          updated_at: 2016-08-22 14:52:51
          deleted_at: NULL
                  id: 2
          service_id: NULL
               vcpus: 4
           memory_mb: 7823
            local_gb: 99
          vcpus_used: 0
      memory_mb_used: 2048
       local_gb_used: 2
     hypervisor_type: QEMU
  hypervisor_version: 2003000
            cpu_info: {"vendor": "Intel", "model": "Haswell-noTSX", "arch": "x86_64", "features": ["pge", "avx", "clflush", "sep", "syscall", "vme", "invpcid", "tsc", "fsgsbase", "xsave", "erms", "cmov", "smep", "pcid", "pat", "lm", "msr", "nx", "fxsr", "sse4.1", "pae", "sse4.2", "pclmuldq", "fma", "tsc-deadline", "mmx", "osxsave", "cx8", "mce", "de", "rdtscp", "mca", "pse", "lahf_lm", "abm", "popcnt", "pdpe1gb", "apic", "sse", "f16c", "pni", "aes", "avx2", "sse2", "ss", "hypervisor", "bmi1", "bmi2", "ssse3", "fpu", "cx16", "pse36", "mtrr", "movbe", "rdrand", "x2apic"], "topology": {"cores": 1, "cells": 1, "threads": 1, "sockets": 4}}
disk_available_least: 99
         free_ram_mb: 5775
        free_disk_gb: 97
    current_workload: 0
         running_vms: 0
 hypervisor_hostname: controller1
             deleted: 0
             host_ip: 172.16.40.128
 supported_instances: [["i686", "qemu", "hvm"], ["x86_64", "qemu", "hvm"]]
           pci_stats: NULL
             metrics: []
     extra_resources: []
               stats: {}
       numa_topology: {"nova_object.version": "1.2", "nova_object.changes": ["cells"], "nova_object.name": "NUMATopology", "nova_object.data": {"cells": [{"nova_object.version": "1.2", "nova_object.changes": ["cpu_usage", "memory_usage", "cpuset", "mempages", "pinned_cpus", "memory", "siblings", "id"], "nova_object.name": "NUMACell", "nova_object.data": {"cpu_usage": 0, "memory_usage": 0, "cpuset": [0, 1, 2, 3], "pinned_cpus": [], "siblings": [], "memory": 8191, "mempages": [{"nova_object.version": "1.0", "nova_object.changes": ["total", "size_kb", "used"], "nova_object.name": "NUMAPagesTopology", "nova_object.data": {"total": 2097052, "used": 0, "size_kb": 4}, "nova_object.namespace": "nova"}, {"nova_object.version": "1.0", "nova_object.changes": ["total", "size_kb", "used"], "nova_object.name": "NUMAPagesTopology", "nova_object.data": {"total": 0, "used": 0, "size_kb": 2048}, "nova_object.namespace": "nova"}, {"nova_object.version": "1.0", "nova_object.changes": ["total", "size_kb", "used"], "nova_object.name": "NUMAPagesTopology", "nova_object.data": {"total": 0, "used": 0, "size_kb": 1048576}, "nova_object.namespace": "nova"}], "id": 0}, "nova_object.namespace": "nova"}]}, "nova_object.namespace": "nova"}
                host: controller1
ram_allocation_ratio: 1
cpu_allocation_ratio: 2
*************************** 3. row ***************************