mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-23 22:50:09 +03:00
F OpenNebula/one#5621: Fix soft limit unit
This commit also improves LXC logging by setting the log configuration to the container definition file. (cherry picked from commit c6a065cf2f28db91125fbc0cfd302477a4e079c1)
This commit is contained in:
parent
af91c0deef
commit
e51592d316
@ -37,7 +37,6 @@ class LXCClient
|
||||
|
||||
COMMANDS.each_value do |value|
|
||||
value.prepend 'sudo '
|
||||
value << ' --logpriority ERROR'
|
||||
end
|
||||
|
||||
# Returns LXC version
|
||||
|
@ -157,7 +157,7 @@ class LXCVM < OpenNebulaVM
|
||||
memory = limits_memory
|
||||
|
||||
lxc["#{pre}memory.#{CGROUP_NAMES[cg_set][:memory_max]}"] = memory
|
||||
lxc["#{pre}memory.#{CGROUP_NAMES[cg_set][:memory_low]}"] = (memory.chomp.to_f*0.9).ceil
|
||||
lxc["#{pre}memory.#{CGROUP_NAMES[cg_set][:memory_low]}"] = "#{(memory.chomp.to_f*0.9).ceil}M"
|
||||
|
||||
lxc["#{pre}memory.#{CGROUP_NAMES[cg_set][:swap]}"] = limits_memory_swap('LXC_SWAP') if swap_limitable?
|
||||
|
||||
@ -184,6 +184,12 @@ class LXCVM < OpenNebulaVM
|
||||
# Add profiles
|
||||
lxc['lxc.include'] |= parse_profiles
|
||||
|
||||
# logging
|
||||
# 0 = trace, 1 = debug, 2 = info, 3 = notice, 4 = warn,
|
||||
# 5 = error, 6 = critical, 7 = alert, 8 = fatal
|
||||
lxc['lxc.log.level'] = 5
|
||||
lxc['lxc.log.file'] = "/var/log/lxc/one-#{@vm_id}.log"
|
||||
|
||||
# Parse RAW section (lxc values should prevail over raw section values)
|
||||
lxc = parse_raw.merge(lxc)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user