1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-02 09:47:00 +03:00

F #3256: Add LXD CPU pinning

This commit is contained in:
Daniel Clavijo Coca 2019-07-04 09:40:23 -05:00 committed by Ruben S. Montero
parent 8f1ee302b6
commit d969a40b6e

View File

@ -118,7 +118,18 @@ class OpenNebulaVM
hash['limits.cpu.allowance'] = "#{(cpu.to_f * 100).to_i}%"
vcpu = @xml['//TEMPLATE/VCPU']
hash['limits.cpu'] = vcpu unless vcpu.empty?
return if vcpu.empty?
numa = @xml.element('//TEMPLATE//NUMA_NODE')
if numa.nil?
hash['limits.cpu'] = vcpu
else # pin CPU
cores = numa['CPUS']
cores += "-#{cores}" if cores.length == 1
hash['limits.cpu'] = cores
end
end
#---------------------------------------------------------------------------