Browse Source

Support live_restore for keeping all running containers

Change-Id: I5ca480bab5cb402dd7bd29f78dd8b6a639060fcf
Feng Shengqin 1 year ago
parent
commit
54aa82d99f
2 changed files with 9 additions and 0 deletions
  1. 8
    0
      devstack/lib/docker
  2. 1
    0
      devstack/settings

+ 8
- 0
devstack/lib/docker View File

@@ -27,6 +27,7 @@ DOCKER_CLUSTER_STORE=${DOCKER_CLUSTER_STORE:-}
27 27
 DOCKER_GROUP=${DOCKER_GROUP:-$STACK_USER}
28 28
 DOCKER_CGROUP_DRIVER=${DOCKER_CGROUP_DRIVER:-}
29 29
 ENABLE_CLEAR_CONTAINER=$(trueorfalse False ENABLE_CLEAR_CONTAINER)
30
+ENABLE_LIVE_RESTORE=$(trueorfalse False ENABLE_LIVE_RESTORE)
30 31
 
31 32
 # Functions
32 33
 # ---------
@@ -108,17 +109,24 @@ function configure_docker {
108 109
     fi
109 110
     local docker_config_file=/etc/docker/daemon.json
110 111
     local debug
112
+    local live_restore
111 113
     if [[ "$ENABLE_DEBUG_LOG_LEVEL" == "True" ]]; then
112 114
         debug=true
113 115
     else
114 116
         debug=false
115 117
     fi
118
+    if [[ "$ENABLE_LIVE_RESTORE" == "True" ]]; then
119
+        live_restore=true
120
+    else
121
+        live_restore=false
122
+    fi
116 123
     sudo mkdir -p $(dirname ${docker_config_file})
117 124
     cat <<EOF | sudo tee $docker_config_file >/dev/null
118 125
 {
119 126
     $cluster_store_opts
120 127
     $runtime_opts
121 128
     "debug": ${debug},
129
+    "live-restore": ${live_restore},
122 130
     "group": "$DOCKER_GROUP",
123 131
 EOF
124 132
     if [[ -n "$DOCKER_CGROUP_DRIVER" ]]; then

+ 1
- 0
devstack/settings View File

@@ -2,6 +2,7 @@
2 2
 
3 3
 CONTAINER_ENGINE=${CONTAINER_ENGINE:-docker}
4 4
 ENABLE_CLEAR_CONTAINER=${ENABLE_CLEAR_CONTAINER:-false}
5
+ENABLE_LIVE_RESTORE=${ENABLE_LIVE_RESTORE:-false}
5 6
 
6 7
 # Enable container services
7 8
 enable_service container

Loading…
Cancel
Save