From: garciadeblas Date: Thu, 27 Mar 2025 08:57:53 +0000 (+0100) Subject: Move lxd configuration files to lxd folder X-Git-Tag: v18.0.0~67 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F67%2F15167%2F2;p=osm%2Fdevops.git Move lxd configuration files to lxd folder Change-Id: Ibe14aadec9b8befe2f2f843a4d3f8794ff227b8b Signed-off-by: garciadeblas --- diff --git a/installers/60-lxd-production.conf b/installers/60-lxd-production.conf deleted file mode 100644 index 1d1194fd..00000000 --- a/installers/60-lxd-production.conf +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2020 Canonical Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Sysctl values for LXD in production -fs.inotify.max_queued_events=1048576 -fs.inotify.max_user_instances=1048576 -fs.inotify.max_user_watches=1048576 -vm.max_map_count=262144 -kernel.dmesg_restrict=1 -net.ipv4.neigh.default.gc_thresh3=8192 -net.ipv6.neigh.default.gc_thresh3=8192 -net.core.bpf_jit_limit=3000000000 -kernel.keys.maxkeys=2000 -kernel.keys.maxbytes=2000000 diff --git a/installers/charmed_install.sh b/installers/charmed_install.sh index 1e406ddb..21f522df 100755 --- a/installers/charmed_install.sh +++ b/installers/charmed_install.sh @@ -178,7 +178,7 @@ EOF LXD_CLOUD=~/.osm/lxd-cloud.yaml LXD_CREDENTIALS=~/.osm/lxd-credentials.yaml # Apply sysctl production values for optimal performance - sudo cp /usr/share/osm-devops/installers/60-lxd-production.conf /etc/sysctl.d/60-lxd-production.conf + sudo cp /usr/share/osm-devops/installers/lxd/60-lxd-production.conf /etc/sysctl.d/60-lxd-production.conf sudo sysctl --system # Install LXD snap sudo apt-get remove --purge -y liblxc1 lxc-common lxcfs lxd lxd-client @@ -190,7 +190,7 @@ EOF fi # Configure LXD sudo usermod -a -G lxd `whoami` - cat /usr/share/osm-devops/installers/lxd-preseed.conf | sed 's/^config: {}/config:\n core.https_address: '$LXDENDPOINT':8443/' | sg lxd -c "lxd init --preseed" + cat /usr/share/osm-devops/installers/lxd/lxd-preseed.conf | sed 's/^config: {}/config:\n core.https_address: '$LXDENDPOINT':8443/' | sg lxd -c "lxd init --preseed" sg lxd -c "lxd waitready" cat << EOF > $LXD_CLOUD diff --git a/installers/install_lxd.sh b/installers/install_lxd.sh index 960531de..60cf91eb 100755 --- a/installers/install_lxd.sh +++ b/installers/install_lxd.sh @@ -37,7 +37,7 @@ function usage(){ function install_lxd() { [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function # Apply sysctl production values for optimal performance - sudo cp ${OSM_DEVOPS}/installers/60-lxd-production.conf /etc/sysctl.d/60-lxd-production.conf + sudo cp ${OSM_DEVOPS}/installers/lxd/60-lxd-production.conf /etc/sysctl.d/60-lxd-production.conf sudo sysctl --system # Install LXD snap @@ -61,7 +61,7 @@ function install_lxd() { # Configure LXD sudo usermod -a -G lxd `whoami` - cat ${OSM_DEVOPS}/installers/lxd-preseed.conf | sed 's/^config: {}/config:\n core.https_address: '$OSM_DEFAULT_IP':8443/' | sg lxd -c "lxd init --preseed" + cat ${OSM_DEVOPS}/installers/lxd/lxd-preseed.conf | sed 's/^config: {}/config:\n core.https_address: '$OSM_DEFAULT_IP':8443/' | sg lxd -c "lxd init --preseed" sg lxd -c "lxd waitready" # Configure LXD to work behind a proxy diff --git a/installers/lxd-preseed.conf b/installers/lxd-preseed.conf deleted file mode 100644 index d4d1cb43..00000000 --- a/installers/lxd-preseed.conf +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2020 Canonical Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -config: {} -networks: -- config: - ipv4.address: auto - ipv6.address: none - description: "" - name: lxdbr0 - type: "" - project: default -storage_pools: -- config: - size: 100GiB - description: "" - name: default - driver: btrfs -profiles: -- config: {} - description: "" - devices: - eth0: - name: eth0 - network: lxdbr0 - type: nic - root: - path: / - pool: default - type: disk - name: default -projects: [] -cluster: null \ No newline at end of file diff --git a/installers/lxd/60-lxd-production.conf b/installers/lxd/60-lxd-production.conf new file mode 100644 index 00000000..1d1194fd --- /dev/null +++ b/installers/lxd/60-lxd-production.conf @@ -0,0 +1,25 @@ +# Copyright 2020 Canonical Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Sysctl values for LXD in production +fs.inotify.max_queued_events=1048576 +fs.inotify.max_user_instances=1048576 +fs.inotify.max_user_watches=1048576 +vm.max_map_count=262144 +kernel.dmesg_restrict=1 +net.ipv4.neigh.default.gc_thresh3=8192 +net.ipv6.neigh.default.gc_thresh3=8192 +net.core.bpf_jit_limit=3000000000 +kernel.keys.maxkeys=2000 +kernel.keys.maxbytes=2000000 diff --git a/installers/lxd/lxd-preseed.conf b/installers/lxd/lxd-preseed.conf new file mode 100644 index 00000000..d4d1cb43 --- /dev/null +++ b/installers/lxd/lxd-preseed.conf @@ -0,0 +1,44 @@ +# Copyright 2020 Canonical Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +config: {} +networks: +- config: + ipv4.address: auto + ipv6.address: none + description: "" + name: lxdbr0 + type: "" + project: default +storage_pools: +- config: + size: 100GiB + description: "" + name: default + driver: btrfs +profiles: +- config: {} + description: "" + devices: + eth0: + name: eth0 + network: lxdbr0 + type: nic + root: + path: / + pool: default + type: disk + name: default +projects: [] +cluster: null \ No newline at end of file