<div dir="ltr"><ul><li>Is there any isolation done at the Kernel level of the compute OS?</li><li>What does your flavor look like right now? Is the behavior different if you remove the numa constraint?</li></ul><div>You seem to have 4 NUMA as well, but only two physical sockets (8CPUx2threads - 16 vCPUs per socket x 2 = 32)</div><div><br></div><div>The generated XML seems to be set for a 4 socket topology?</div><div><br></div><div> <cpu mode='custom' match='exact' check='partial'><br>    <model fallback='allow'>Opteron_G5</model><br>    <topology sockets='4' cores='2' threads='1'/><br>  </cpu><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 29, 2021 at 12:41 PM Ammad Syed <<a href="mailto:syedammad83@gmail.com">syedammad83@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Stephen,<div><br></div><div>I have checked all cpus are online.</div><div><br></div><div>root@kvm10-a1-khi01:/etc/nova# lscpu<br>Architecture:                    x86_64<br>CPU op-mode(s):                  32-bit, 64-bit<br>Byte Order:                      Little Endian<br>Address sizes:                   48 bits physical, 48 bits virtual<br>CPU(s):                          32<br>On-line CPU(s) list:             0-31<br>Thread(s) per core:              2<br>Core(s) per socket:              8<br>Socket(s):                       2<br>NUMA node(s):                    4<br>Vendor ID:                       AuthenticAMD<br>CPU family:                      21<br></div><div><br></div><div>I have made below configuration in nova.conf.</div><div><br></div><div>[compute]<br><br>cpu_shared_set = 2-7,10-15,18-23,26-31<br></div><div><br></div><div>Below is the xml in nova logs that nova is trying to create domain.</div><div><br></div><div>2021-06-29 16:30:56.576 2819 ERROR nova.virt.libvirt.guest [req-c76c6809-1775-43a8-bfb1-70f6726cad9d 2af528fdf3244e15b4f3f8fcfc0889c5 890eb2b7d1b8488aa88de7c34d08817a - default default] Error launching a defined domain with XML: <domain type='kvm'><br>  <name>instance-0000026d</name><br>  <uuid>06ff4fd5-b21f-4f64-9dde-55e86dd15da6</uuid><br>  <metadata><br>    <nova:instance xmlns:nova="<a href="http://openstack.org/xmlns/libvirt/nova/1.1" target="_blank">http://openstack.org/xmlns/libvirt/nova/1.1</a>"><br>      <nova:package version="23.0.0"/><br>      <nova:name>cpu</nova:name><br>      <nova:creationTime>2021-06-29 16:30:50</nova:creationTime><br>      <nova:flavor name="RC-16G"><br>        <nova:memory>16384</nova:memory><br>        <nova:disk>5</nova:disk><br>        <nova:swap>0</nova:swap><br>        <nova:ephemeral>0</nova:ephemeral><br>        <nova:vcpus>8</nova:vcpus><br>      </nova:flavor><br>      <nova:owner><br>        <nova:user uuid="2af528fdf3244e15b4f3f8fcfc0889c5">admin</nova:user><br>        <nova:project uuid="890eb2b7d1b8488aa88de7c34d08817a">admin</nova:project><br>      </nova:owner><br>      <nova:root type="image" uuid="1024317b-0db6-418c-bc39-de9b61d8ce59"/><br>      <nova:ports><br>        <nova:port uuid="dccf68a2-ec48-4985-94ce-b3487cfc99f3"><br>          <nova:ip type="fixed" address="192.168.100.106" ipVersion="4"/><br>        </nova:port><br>      </nova:ports><br>    </nova:instance><br>  </metadata><br>  <memory unit='KiB'>16777216</memory><br>  <currentMemory unit='KiB'>16777216</currentMemory><br>  <vcpu placement='static' cpuset='2-7,10-15,18-23,26-31'>8</vcpu><br>  <cputune><br>    <shares>8192</shares><br>  </cputune><br>  <sysinfo type='smbios'><br>    <system><br>      <entry name='manufacturer'>OpenStack Foundation</entry><br>      <entry name='product'>OpenStack Nova</entry><br>      <entry name='version'>23.0.0</entry><br>      <entry name='serial'>06ff4fd5-b21f-4f64-9dde-55e86dd15da6</entry><br>      <entry name='uuid'>06ff4fd5-b21f-4f64-9dde-55e86dd15da6</entry><br>      <entry name='family'>Virtual Machine</entry><br>    </system><br>  </sysinfo><br>  <os><br>    <type arch='x86_64' machine='pc-i440fx-4.2'>hvm</type><br>    <boot dev='hd'/><br>    <smbios mode='sysinfo'/><br>  </os><br>  <features><br>    <acpi/><br>    <apic/><br>  </features><br>  <cpu mode='custom' match='exact' check='partial'><br>    <model fallback='allow'>Opteron_G5</model><br>    <topology sockets='4' cores='2' threads='1'/><br>  </cpu><br>  <clock offset='utc'><br>    <timer name='pit' tickpolicy='delay'/><br>    <timer name='rtc' tickpolicy='catchup'/><br>    <timer name='hpet' present='no'/><br>  </clock><br>  <on_poweroff>destroy</on_poweroff><br>  <on_reboot>restart</on_reboot><br>  <on_crash>destroy</on_crash><br>  <devices><br>    <emulator>/usr/bin/qemu-system-x86_64</emulator><br>    <disk type='file' device='disk'><br>      <driver name='qemu' type='qcow2' cache='none'/><br>      <source file='/var/lib/nova/instances/06ff4fd5-b21f-4f64-9dde-55e86dd15da6/disk'/><br>      <target dev='sda' bus='scsi'/><br>      <address type='drive' controller='0' bus='0' target='0' unit='0'/><br>    </disk><br>    <controller type='scsi' index='0' model='virtio-scsi'><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/><br>    </controller><br>    <controller type='usb' index='0' model='piix3-uhci'><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/><br>    </controller><br>    <controller type='pci' index='0' model='pci-root'/><br>    <interface type='bridge'><br>      <mac address='fa:16:3e:f5:46:7d'/><br>      <source bridge='br-int'/><br>      <virtualport type='openvswitch'><br>        <parameters interfaceid='dccf68a2-ec48-4985-94ce-b3487cfc99f3'/><br>      </virtualport><br>      <target dev='tapdccf68a2-ec'/><br>      <model type='virtio'/><br>      <driver name='vhost' queues='8'/><br>      <mtu size='1442'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/><br>    </interface><br>    <serial type='pty'><br>      <log file='/var/lib/nova/instances/06ff4fd5-b21f-4f64-9dde-55e86dd15da6/console.log' append='off'/><br>      <target type='isa-serial' port='0'><br>        <model name='isa-serial'/><br>      </target><br>    </serial><br>    <console type='pty'><br>      <log file='/var/lib/nova/instances/06ff4fd5-b21f-4f64-9dde-55e86dd15da6/console.log' append='off'/><br>      <target type='serial' port='0'/><br>    </console><br>    <input type='tablet' bus='usb'><br>      <address type='usb' bus='0' port='1'/><br>    </input><br>    <input type='mouse' bus='ps2'/><br>    <input type='keyboard' bus='ps2'/><br>    <graphics type='spice' autoport='yes' listen='0.0.0.0'><br>      <listen type='address' address='0.0.0.0'/><br>    </graphics><br>    <video><br>      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/><br>    </video><br>    <memballoon model='virtio'><br>      <stats period='10'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/><br>    </memballoon><br>    <rng model='virtio'><br>      <backend model='random'>/dev/urandom</backend><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/><br>    </rng><br>  </devices><br></domain><br>: libvirt.libvirtError: Unable to write to '/sys/fs/cgroup/cpuset/machine.slice/machine-qemu\x2d1\x2dinstance\x2d0000026d.scope/emulator/cpuset.cpus': Permission denied<br></div><div><br></div><div>Ammad</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 29, 2021 at 8:29 PM Stephen Finucane <<a href="mailto:stephenfin@redhat.com" target="_blank">stephenfin@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 2021-06-29 at 17:44 +0500, Ammad Syed wrote:<br>
> Thanks,, the information is really helpful. I am have set below properties to<br>
> flavor according to my numa policies. <br>
> <br>
>     --property hw:numa_nodes=FLAVOR-NODES \<br>
>     --property hw:numa_cpus.N=FLAVOR-CORES \<br>
>     --property hw:numa_mem.N=FLAVOR-MEMORY<br>
> <br>
> I am having below error in compute logs. Any advise.<br>
> <br>
>  libvirt.libvirtError: Unable to write to<br>
> '/sys/fs/cgroup/cpuset/machine.slice/machine-<br>
> qemu\x2d48\x2dinstance\x2d0000026b.scope/emulator/cpuset.cpus': Permission<br>
> denied<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest Traceback (most<br>
> recent call last):<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest   File<br>
> "/usr/lib/python3/dist-packages/nova/virt/libvirt/guest.py", line 155, in launch<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest     return<br>
> self._domain.createWithFlags(flags)<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest   File<br>
> "/usr/lib/python3/dist-packages/eventlet/tpool.py", line 193, in doit<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest     result =<br>
> proxy_call(self._autowrap, f, *args, **kwargs)<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest   File<br>
> "/usr/lib/python3/dist-packages/eventlet/tpool.py", line 151, in proxy_call<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest     rv =<br>
> execute(f, *args, **kwargs)<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest   File<br>
> "/usr/lib/python3/dist-packages/eventlet/tpool.py", line 132, in execute<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest     six.reraise(c,<br>
> e, tb)<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest   File<br>
> "/usr/lib/python3/dist-packages/six.py", line 703, in reraise<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest     raise value<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest   File<br>
> "/usr/lib/python3/dist-packages/eventlet/tpool.py", line 86, in tworker<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest     rv =<br>
> meth(*args, **kwargs)<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest   File<br>
> "/usr/lib/python3/dist-packages/libvirt.py", line 1265, in createWithFlags<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest     if ret == -1:<br>
> raise libvirtError ('virDomainCreateWithFlags() failed', dom=self)<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest<br>
> libvirt.libvirtError: Unable to write to<br>
> '/sys/fs/cgroup/cpuset/machine.slice/machine-<br>
> qemu\x2d48\x2dinstance\x2d0000026b.scope/emulator/cpuset.cpus': Permission<br>
> denied<br>
> 2021-06-29 12:33:10.144 1310945 ERROR nova.virt.libvirt.guest <br>
> 2021-06-29 12:33:10.146 1310945 ERROR nova.virt.libvirt.driver [req-4f6fc6aa-<br>
> 04d6-4dc0-921f-2913b40a76a9 2af528fdf3244e15b4f3f8fcfc0889c5<br>
> 890eb2b7d1b8488aa88de7c34d08817a - default default] [instance: ed87bf68-b631-<br>
> 4a00-9eb5-22d32ec37402] Failed to start libvirt guest: libvirt.libvirtError:<br>
> Unable to write to '/sys/fs/cgroup/cpuset/machine.slice/machine-<br>
> qemu\x2d48\x2dinstance\x2d0000026b.scope/emulator/cpuset.cpus': Permission<br>
> denied<br>
> 2021-06-29 12:33:10.150 1310945 INFO os_vif [req-4f6fc6aa-04d6-4dc0-921f-<br>
> 2913b40a76a9 2af528fdf3244e15b4f3f8fcfc0889c5 890eb2b7d1b8488aa88de7c34d08817a -<br>
> default default] Successfully unplugged vif<br>
> VIFOpenVSwitch(active=False,address=fa:16:3e:ba:3d:c8,bridge_name='br-<br>
> int',has_traffic_filtering=True,id=a991cd33-2610-4823-a471-<br>
> 62171037e1b5,network=Network(a0d85af2-a991-4102-8453-<br>
> ba68c5e10b65),plugin='ovs',port_profile=VIFPortProfileOpenVSwitch,preserve_on_de<br>
> lete=False,vif_name='tapa991cd33-26')<br>
> 2021-06-29 12:33:10.151 1310945 INFO nova.virt.libvirt.driver [req-4f6fc6aa-<br>
> 04d6-4dc0-921f-2913b40a76a9 2af528fdf3244e15b4f3f8fcfc0889c5<br>
> 890eb2b7d1b8488aa88de7c34d08817a - default default] [instance: ed87bf68-b631-<br>
> 4a00-9eb5-22d32ec37402] Deleting instance files<br>
> /var/lib/nova/instances/ed87bf68-b631-4a00-9eb5-22d32ec37402_del<br>
> 2021-06-29 12:33:10.152 1310945 INFO nova.virt.libvirt.driver [req-4f6fc6aa-<br>
> 04d6-4dc0-921f-2913b40a76a9 2af528fdf3244e15b4f3f8fcfc0889c5<br>
> 890eb2b7d1b8488aa88de7c34d08817a - default default] [instance: ed87bf68-b631-<br>
> 4a00-9eb5-22d32ec37402] Deletion of /var/lib/nova/instances/ed87bf68-b631-4a00-<br>
> 9eb5-22d32ec37402_del complete<br>
> 2021-06-29 12:33:10.258 1310945 ERROR nova.compute.manager [req-4f6fc6aa-04d6-<br>
> 4dc0-921f-2913b40a76a9 2af528fdf3244e15b4f3f8fcfc0889c5<br>
> 890eb2b7d1b8488aa88de7c34d08817a - default default] [instance: ed87bf68-b631-<br>
> 4a00-9eb5-22d32ec37402] Instance failed to spawn: libvirt.libvirtError: Unable<br>
> to write to '/sys/fs/cgroup/cpuset/machine.slice/machine-<br>
> qemu\x2d48\x2dinstance\x2d0000026b.scope/emulator/cpuset.cpus': Permission<br>
> denied<br>
> <br>
> Any advise how to fix this permission issue ?<br>
> <br>
> I have manually created the directory machine-qemu in<br>
> /sys/fs/cgroup/cpuset/machine.slice/ but still having the same error.<br>
> <br>
> I have also tried to set [compute] cpu_shared_set AND [compute]<br>
> cpu_dedicated_set  they are also giving the same error.<br>
<br>
There are quite a few bugs about this [1][2]. It seems most of them are caused<br>
by CPUs being offlined. Have you offline CPUs? Are the CPUs listed in the mask<br>
all available?<br>
<br>
Stephen<br>
<br>
[1] <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1609785" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1609785</a><br>
[2] <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1842716" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1842716</a><br>
<br>
> Using ubuntu20.04 and qemu-kvm 4.2.<br>
> <br>
> Ammad<br>
> <br>
> On Fri, Jun 25, 2021 at 10:54 AM Sean Mooney <<a href="mailto:smooney@redhat.com" target="_blank">smooney@redhat.com</a>> wrote:<br>
> > On Fri, 2021-06-25 at 10:02 +0500, Ammad Syed wrote:<br>
> > > Hi,<br>
> > > <br>
> > > I am using openstack wallaby on ubuntu 20.04 and kvm. I am working to make<br>
> > > optimized flavor properties that should provide optimal performance. I was<br>
> > > reviewing the document below.<br>
> > > <br>
> > > <a href="https://docs.openstack.org/nova/wallaby/admin/cpu-topologies.html" rel="noreferrer" target="_blank">https://docs.openstack.org/nova/wallaby/admin/cpu-topologies.html</a><br>
> > > <br>
> > > I have two socket AMD compute node. The workload running on nodes are mixed<br>
> > > workload.<br>
> > > <br>
> > > My question is should I use default nova CPU topology and NUMA node that<br>
> > > nova deploys instance by default OR should I use hw:cpu_sockets='2'<br>
> > > and hw:numa_nodes='2'.<br>
> > the latter hw:cpu_sockets='2' and hw:numa_nodes='2' should give you better<br>
> > performce<br>
> > however you should also set hw:mem_page_size=small or hw:mem_page_size=any<br>
> > when you enable virtual numa policies we afinities the guest memory to host<br>
> > numa nodes.<br>
> > This can lead to Out of memory evnet on the the host numa nodes which can<br>
> > result in vms<br>
> > being killed by the host kernel memeory reaper if you do not enable numa aware<br>
> > memeory<br>
> > trackign iin nova which is done by setting hw:mem_page_size. setting <br>
> > hw:mem_page_size has<br>
> > the side effect of of disabling memory over commit so you have to bare that in<br>
> > mind.<br>
> > if you are using numa toplogy you should almost always also use hugepages<br>
> > which are enabled<br>
> > using  hw:mem_page_size=large this however requires you to configure<br>
> > hupgepages in the host<br>
> > at boot.<br>
> > > <br>
> > > Which one from above provide best instance performance ? or any other<br>
> > > tuning should I do ?<br>
> > <br>
> > in the libvirt driver the default cpu toplogy we will genergated<br>
> > is 1 thread per core, 1 core per socket and 1 socket per flavor.vcpu.<br>
> > (technially this is an undocumeted implemation detail that you should not rely<br>
> > on, we have the hw:cpu_* element if you care about the toplogy)<br>
> > <br>
> > this was more effincet in the early days of qemu/openstack but has may issue<br>
> > when software is chagne per sokcet or oepreating systems have<br>
> > a limit on socket supported such as windows.<br>
> > <br>
> > generally i advies that you set hw:cpu_sockets to the typical number of<br>
> > sockets on the underlying host.<br>
> > simialrly if the flavor will only be run on host with SMT/hypertreading<br>
> > enabled on you shoudl set hw:cpu_threads=2<br>
> > <br>
> > the flavor.vcpus must be devisable by the product of hw:cpu_sockets,<br>
> > hw:cpu_cores and hw:cpu_threads if they are set.<br>
> > <br>
> > so if you have  hw:cpu_threads=2 it must be devisable by 2<br>
> > if you have  hw:cpu_threads=2 and hw:cpu_sockets=2 flavor.vcpus must be a<br>
> > multiple of 4<br>
> > > <br>
> > > The note in the URL (CPU topology sesion) suggests that I should stay with<br>
> > > default options that nova provides.<br>
> > in generaly no you should aling it to the host toplogy if you have similar<br>
> > toplogy across your data center.<br>
> > the default should always just work but its not nessisarly optimal and window<br>
> > sguest might not boot if you have too many sockets.<br>
> > windows 10 for exmple only supprot 2 socket so you could only have 2<br>
> > flavor.vcpus if you used the default toplogy.<br>
> > <br>
> > > <br>
> > > Currently it also works with libvirt/QEMU driver but we don’t recommend it<br>
> > > in production use cases. This is because vCPUs are actually running in one<br>
> > > thread on host in qemu TCG (Tiny Code Generator), which is the backend for<br>
> > > libvirt/QEMU driver. Work to enable full multi-threading support for TCG<br>
> > > (a.k.a. MTTCG) is on going in QEMU community. Please see this MTTCG project<br>
> > > <<a href="http://wiki.qemu.org/Features/tcg-multithread" rel="noreferrer" target="_blank">http://wiki.qemu.org/Features/tcg-multithread</a>> page for detail.<br>
> > we do not gnerally recommende using qemu without kvm in produciton.<br>
> > the mttcg backend is useful in cases where you want to emulate other plathform<br>
> > but that usecsae<br>
> > is not currently supported in nova.<br>
> > for your deployment you should use libvirt with kvm and you should also<br>
> > consider if you want to support<br>
> > nested virtualisation or not.<br>
> > > <br>
> > > <br>
> > > Ammad<br>
> > <br>
> > <br>
> <br>
> <br>
<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr">Regards,<div><br></div><div><br></div><div>Syed Ammad Ali</div></div>
</blockquote></div>