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:
parent
8f1ee302b6
commit
d969a40b6e
@ -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
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user