Move lxd configuration files to lxd folder 67/15167/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 27 Mar 2025 08:57:53 +0000 (09:57 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 29 Apr 2025 07:35:58 +0000 (09:35 +0200)
Change-Id: Ibe14aadec9b8befe2f2f843a4d3f8794ff227b8b
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/60-lxd-production.conf [deleted file]
installers/charmed_install.sh
installers/install_lxd.sh
installers/lxd-preseed.conf [deleted file]
installers/lxd/60-lxd-production.conf [new file with mode: 0644]
installers/lxd/lxd-preseed.conf [new file with mode: 0644]

diff --git a/installers/60-lxd-production.conf b/installers/60-lxd-production.conf
deleted file mode 100644 (file)
index 1d1194f..0000000
+++ /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
index 1e406dd..21f522d 100755 (executable)
@@ -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
index 960531d..60cf91e 100755 (executable)
@@ -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 (file)
index d4d1cb4..0000000
+++ /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 (file)
index 0000000..1d1194f
--- /dev/null
@@ -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 (file)
index 0000000..d4d1cb4
--- /dev/null
@@ -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