Merge "Failed to update memory for container"
This commit is contained in:
commit
ed32609456
@ -48,7 +48,11 @@ won't be created.
|
|||||||
"""),
|
"""),
|
||||||
cfg.StrOpt('container_runtime', default='runc',
|
cfg.StrOpt('container_runtime', default='runc',
|
||||||
help="""Define the runtime to create container with. Default value
|
help="""Define the runtime to create container with. Default value
|
||||||
in Zun is ``runc``.""")
|
in Zun is ``runc``."""),
|
||||||
|
cfg.IntOpt('default_memory_swap',
|
||||||
|
default=-1,
|
||||||
|
help='The default memory swap size in MB (default is -1 '
|
||||||
|
'which enable unlimited swap).'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -656,6 +656,7 @@ class DockerDriver(driver.ContainerDriver):
|
|||||||
memory = patch.get('memory')
|
memory = patch.get('memory')
|
||||||
if memory is not None:
|
if memory is not None:
|
||||||
args['mem_limit'] = memory
|
args['mem_limit'] = memory
|
||||||
|
args['memswap_limit'] = CONF.default_memory_swap
|
||||||
cpu = patch.get('cpu')
|
cpu = patch.get('cpu')
|
||||||
if cpu is not None:
|
if cpu is not None:
|
||||||
args['cpu_quota'] = int(100000 * cpu)
|
args['cpu_quota'] = int(100000 * cpu)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user