Increase LXC container default shutdown delay
Increase container shutdown delay before force-killing to avoid db corruption after controller reboots Parameterize SHUTDOWNDELAY envvar as lxc_container_shutdown_delay with default value 60 seconds Rename lxc.default.j2 template to lxc-net.default.j2 to align with destination config file name lxc-net Add new lxc.default.j2 template to use the lxc_container_shutdown_delay variable and allow user-defined value Related-Bug: 1806696 Change-Id: I1d3b7990e462140fdb402883f8d25422eafca66b
This commit is contained in:
parent
0766e893ec
commit
d0d9384aee
@ -153,6 +153,9 @@ lxc_container_cache_files: []
|
||||
# - "/etc/apt/sources.list.d/myrepo.list"
|
||||
lxc_container_cache_files_from_host: []
|
||||
|
||||
# LXC container shutdown delay before force-killing running container
|
||||
lxc_container_shutdown_delay: 60
|
||||
|
||||
# DNS servers to use during cache preparation
|
||||
lxc_cache_prep_dns:
|
||||
- "{{ lxc_net_address }}"
|
||||
|
@ -32,7 +32,8 @@
|
||||
mode: "{{ item.mode|default('0644') }}"
|
||||
with_items:
|
||||
- { src: lxc-openstack.conf.j2, dest: "/etc/lxc/lxc-openstack.conf" }
|
||||
- { src: lxc.default.j2, dest: "{{ system_config_dir }}/lxc-net", mode: "0644" }
|
||||
- { src: lxc-net.default.j2, dest: "{{ system_config_dir }}/lxc-net", mode: "0644" }
|
||||
- { src: lxc.default.j2, dest: "{{ system_config_dir }}/lxc", mode: "0644" }
|
||||
- { src: lxc-system-manage.j2, dest: "/usr/local/bin/lxc-system-manage", mode: "0755" }
|
||||
tags:
|
||||
- lxc-files
|
||||
|
12
templates/lxc-net.default.j2
Normal file
12
templates/lxc-net.default.j2
Normal file
@ -0,0 +1,12 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
USE_LXC_BRIDGE="true"
|
||||
LXC_BRIDGE="{{ lxc_net_bridge }}"
|
||||
LXC_ADDR="{{ lxc_net_address }}"
|
||||
LXC_NETMASK="{{ lxc_net_netmask }}"
|
||||
LXC_NETWORK="${LXC_ADDR}/${LXC_NETMASK}"
|
||||
LXC_DHCP_RANGE="{{ lxc_net_dhcp_range }}"
|
||||
LXC_DHCP_MAX="{{ lxc_net_dhcp_max }}"
|
||||
LXC_DNSMASQ_USER="{{ lxc_net_dnsmasq_user }}"
|
||||
LXC_DHCP_CONFILE="{{ lxc_net_dhcp_config }}"
|
||||
LXC_DOMAIN="{{ lxc_net_domain }}"
|
@ -1,12 +1,30 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
USE_LXC_BRIDGE="true"
|
||||
LXC_BRIDGE="{{ lxc_net_bridge }}"
|
||||
LXC_ADDR="{{ lxc_net_address }}"
|
||||
LXC_NETMASK="{{ lxc_net_netmask }}"
|
||||
LXC_NETWORK="${LXC_ADDR}/${LXC_NETMASK}"
|
||||
LXC_DHCP_RANGE="{{ lxc_net_dhcp_range }}"
|
||||
LXC_DHCP_MAX="{{ lxc_net_dhcp_max }}"
|
||||
LXC_DNSMASQ_USER="{{ lxc_net_dnsmasq_user }}"
|
||||
LXC_DHCP_CONFILE="{{ lxc_net_dhcp_config }}"
|
||||
LXC_DOMAIN="{{ lxc_net_domain }}"
|
||||
# LXC_AUTO - whether or not to start containers at boot
|
||||
LXC_AUTO="true"
|
||||
|
||||
# BOOTGROUPS - What groups should start on bootup?
|
||||
# Comma separated list of groups.
|
||||
# Leading comma, trailing comma or embedded double
|
||||
# comma indicates when the NULL group should be run.
|
||||
# Example (default): boot the onboot group first then the NULL group
|
||||
BOOTGROUPS="onboot,"
|
||||
|
||||
# SHUTDOWNDELAY - Wait time for a container to shut down.
|
||||
# Container shutdown can result in lengthy system
|
||||
# shutdown times. Even 5 seconds per container can be
|
||||
# too long.
|
||||
SHUTDOWNDELAY="{{ lxc_container_shutdown_delay }}"
|
||||
|
||||
# OPTIONS can be used for anything else.
|
||||
# If you want to boot everything then
|
||||
# options can be "-a" or "-a -A".
|
||||
OPTIONS=
|
||||
|
||||
# STOPOPTS are stop options. The can be used for anything else to stop.
|
||||
# If you want to kill containers fast, use -k
|
||||
STOPOPTS="-a -A -s"
|
||||
|
||||
USE_LXC_BRIDGE="false" # overridden in lxc-net
|
||||
|
||||
[ ! -f /etc/default/lxc-net ] || . /etc/default/lxc-net
|
||||
|
Loading…
x
Reference in New Issue
Block a user