summaryrefslogtreecommitdiffstats
path: root/mcp
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2020-01-20 12:12:50 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2020-01-28 13:10:18 +0000
commit2600894360be0dd0676680e3ced73c4f361a58c0 (patch)
tree59f4568b848be58d45cb42163edd5d10a00586ff /mcp
parent279195ddeb8e459a5931430f0841724ba6c06db1 (diff)
all: Pin Ubuntu kernel to 5.0.0-37 for Bionic
Ubuntu kernel meta packages are all broken on at least one platform architecture, so pin the kernel version to 5.0.0-37, which is known to be stable. Make the kernel version configurable via a new enviroment variable, MCP_KERNEL_VER in globals.sh. If not defined, the ga-18.04 kernel is left unchanged (based on upstream kernel 4.15), except for baremetal nodes providioned by MaaS which currently use the HWE kernel (based on 5.3 in Bionic). Change-Id: I648d09b22f6080efd2bce26b6a06fecc3f6b4599 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com> (cherry picked from commit 04f7737967a1a9e84c6e17482acd466b46eebc48)
Diffstat (limited to 'mcp')
-rw-r--r--mcp/config/scenario/defaults.yaml.j210
-rw-r--r--mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch30
-rw-r--r--mcp/reclass/classes/cluster/all-mcp-arch-common/infra/maas.yml.j217
-rw-r--r--mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml.j26
-rw-r--r--mcp/scripts/globals.sh1
m---------mcp/scripts/pharos0
6 files changed, 53 insertions, 11 deletions
diff --git a/mcp/config/scenario/defaults.yaml.j2 b/mcp/config/scenario/defaults.yaml.j2
index cd5cb04cd..48fb954cc 100644
--- a/mcp/config/scenario/defaults.yaml.j2
+++ b/mcp/config/scenario/defaults.yaml.j2
@@ -33,8 +33,9 @@ x86_64:
- saltstack 500 deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7 bionic main
pkg:
install:
- {%- if '-iec-' not in conf.MCP_DEPLOY_SCENARIO %}
- - linux-generic-hwe-18.04
+ {%- if '-iec-' not in conf.MCP_DEPLOY_SCENARIO and conf.MCP_KERNEL_VER %}
+ - linux-image-{{ conf.MCP_KERNEL_VER }}-generic
+ - linux-headers-{{ conf.MCP_KERNEL_VER }}-generic
{%- endif %}
- salt-minion
- ifupdown
@@ -99,8 +100,9 @@ aarch64:
- saltstack 500 deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7 bionic main
pkg:
install:
- {%- if '-iec-' not in conf.MCP_DEPLOY_SCENARIO %}
- - linux-generic-hwe-18.04
+ {%- if '-iec-' not in conf.MCP_DEPLOY_SCENARIO and conf.MCP_KERNEL_VER %}
+ - linux-image-{{ conf.MCP_KERNEL_VER }}-generic
+ - linux-headers-{{ conf.MCP_KERNEL_VER }}-generic
{%- endif %}
- salt-minion
- ifupdown
diff --git a/mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch b/mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch
index 1f53697ad..a279e019d 100644
--- a/mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch
+++ b/mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch
@@ -12,19 +12,19 @@ Subject: [PATCH] curtin: Add Bionic support
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
- .../curtin_userdata_amd64_generic_bionic | 80 +++++++++++++++++++
- .../curtin_userdata_arm64_generic_bionic | 65 +++++++++++++++
+ .../curtin_userdata_amd64_generic_bionic | 83 +++++++++++++++++++
+ .../curtin_userdata_arm64_generic_bionic | 78 +++++++++++++++++
maas/region.sls | 24 ++++++
- 3 files changed, 169 insertions(+)
+ 3 files changed, 185 insertions(+)
create mode 100644 maas/files/curtin_userdata_amd64_generic_bionic
create mode 100644 maas/files/curtin_userdata_arm64_generic_bionic
diff --git a/maas/files/curtin_userdata_amd64_generic_bionic b/maas/files/curtin_userdata_amd64_generic_bionic
new file mode 100644
-index 0000000..0b6fd15
+index 0000000..6b01a58
--- /dev/null
+++ b/maas/files/curtin_userdata_amd64_generic_bionic
-@@ -0,0 +1,80 @@
+@@ -0,0 +1,83 @@
+{%- from "maas/map.jinja" import cluster with context %}
+{%- raw %}
+#cloud-config
@@ -63,6 +63,9 @@ index 0000000..0b6fd15
+ apt_04_install_pkgs_{{ loop.index }}: ["curtin", "in-target", "--", "apt-get", "-y", "install", "{{ pkg }}"]
+ {% endfor %}
+{%- endif %}
++{%- if salt['pillar.get']('maas:cluster:curtin_vars:amd64:bionic:kernel_package:enabled')|default(false) %}
++ apt_05_kernel_old_absent: ["curtin", "in-target", "--", "sh", "-c", "dpkg -l '*linux-generic-*[0-9]*' '*linux-image-*[0-9]*' '*linux-headers-*[0-9]*' '*linux-image-extra-*[0-9]*' '*linux-modules-extra-*[0-9]*' 2>/dev/null | grep -E '^ii' | awk '{print $2}' | grep -v '{{ pillar.maas.cluster.curtin_vars.amd64.bionic.kernel_package.value.split('-')[2:-1] | join('-') }}' | xargs dpkg --purge --force-depends"]
++{%- endif %}
+ salt_01_install: ["curtin", "in-target", "--", "apt-get", "-y", "install", "salt-minion", "ifupdown", "cloud-init", "dnsmasq"]
+ salt_02_hostname_set: ["curtin", "in-target", "--", "echo", "{% raw %}{{node.hostname}}{% endraw %}.{{pillar.linux.system.domain}}"]
+ salt_03_hostname_get: ["curtin", "in-target", "--", "sh", "-c", "echo 'id: {% raw %}{{node.hostname}}{% endraw %}.{{pillar.linux.system.domain}}' >> /etc/salt/minion.d/minion.conf"]
@@ -107,10 +110,10 @@ index 0000000..0b6fd15
+#}
diff --git a/maas/files/curtin_userdata_arm64_generic_bionic b/maas/files/curtin_userdata_arm64_generic_bionic
new file mode 100644
-index 0000000..c7cb997
+index 0000000..54c908c
--- /dev/null
+++ b/maas/files/curtin_userdata_arm64_generic_bionic
-@@ -0,0 +1,65 @@
+@@ -0,0 +1,78 @@
+{%- from "maas/map.jinja" import cluster with context %}
+{% raw %}
+#cloud-config
@@ -143,6 +146,14 @@ index 0000000..c7cb997
+{#- NOTE: Re-use amd64 repos on arm64 since most packages are arch independent #}
+ apt_01_set_repo: ["curtin", "in-target", "--", "sh", "-c", "echo '{{ saltstack_repo }}' >> /etc/apt/sources.list.d/mcp_saltstack.list"]
+ apt_03_update: ["curtin", "in-target", "--", "apt-get", "update"]
++{%- if salt['pillar.get']('maas:cluster:curtin_vars:arm64:bionic:extra_pkgs:enabled')|default(false) %}
++ {% for pkg in pillar.maas.cluster.curtin_vars.arm64.bionic.extra_pkgs.pkgs -%}
++ apt_04_install_pkgs_{{ loop.index }}: ["curtin", "in-target", "--", "apt-get", "-y", "install", "{{ pkg }}"]
++ {% endfor %}
++{%- endif %}
++{%- if salt['pillar.get']('maas:cluster:curtin_vars:arm64:bionic:kernel_package:enabled')|default(false) %}
++ apt_05_kernel_old_absent: ["curtin", "in-target", "--", "sh", "-c", "dpkg -l '*linux-generic-*[0-9]*' '*linux-image-*[0-9]*' '*linux-headers-*[0-9]*' '*linux-image-extra-*[0-9]*' '*linux-modules-extra-*[0-9]*' 2>/dev/null | grep -E '^ii' | awk '{print $2}' | grep -v '{{ pillar.maas.cluster.curtin_vars.arm64.bionic.kernel_package.value.split('-')[2:-1] | join('-') }}' | xargs dpkg --purge --force-depends"]
++{%- endif %}
+ salt_01_install: ["curtin", "in-target", "--", "apt-get", "-y", "install", "salt-minion", "python-futures", "ifupdown", "cloud-init", "dnsmasq"]
+ salt_02_hostname_set: ["curtin", "in-target", "--", "echo", "{% raw %}{{node.hostname}}{% endraw %}.{{pillar.linux.system.domain}}"]
+ salt_03_hostname_get: ["curtin", "in-target", "--", "sh", "-c", "echo 'id: {% raw %}{{node.hostname}}{% endraw %}.{{pillar.linux.system.domain}}' >> /etc/salt/minion.d/minion.conf"]
@@ -165,6 +176,11 @@ index 0000000..c7cb997
+ salt_26_bionic_networking_enable: ["curtin", "in-target", "--", "systemctl", "enable", "networking.service"]
+ salt_27_bionic_networking_start: ["curtin", "in-target", "--", "systemctl", "start", "networking.service"]
+
++{%- if salt['pillar.get']('maas:cluster:curtin_vars:arm64:bionic:kernel_package:enabled')|default(false) %}
++kernel:
++ package: {{ pillar.maas.cluster.curtin_vars.arm64.bionic.kernel_package.value }}
++{%- endif %}
++
+{% raw %}
+{{if third_party_drivers and driver}}
+ driver_00_key_get: curtin in-target -- sh -c "/bin/echo -en '{{key_string}}' > /tmp/maas-{{driver['package']}}.gpg"
diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/maas.yml.j2 b/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/maas.yml.j2
index 57da919de..188269a71 100644
--- a/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/maas.yml.j2
+++ b/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/maas.yml.j2
@@ -113,6 +113,23 @@ parameters:
region:
host: ${_param:single_address}
port: 5240
+{%- if '-iec-' not in conf.MCP_DEPLOY_SCENARIO and conf.MCP_KERNEL_VER %}
+ curtin_vars:
+ amd64:
+ bionic: &curtin_vars_bionic
+ kernel_package:
+ enabled: True
+ value: 'linux-image-{{ conf.MCP_KERNEL_VER }}-generic'
+ extra_pkgs:
+ enabled: True
+ pkgs:
+ - linux-image-{{ conf.MCP_KERNEL_VER }}-generic
+ - linux-headers-{{ conf.MCP_KERNEL_VER }}-generic
+ - linux-modules-extra-{{ conf.MCP_KERNEL_VER }}-generic
+ arm64:
+ bionic:
+ <<: *curtin_vars_bionic
+{%- endif %}
linux:
system:
repo:
diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml.j2 b/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml.j2
index 2e88d9cdc..755d2cb08 100644
--- a/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml.j2
+++ b/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml.j2
@@ -38,3 +38,9 @@ parameters:
{%- for server in nm.dns_public %}
- {{ server }}
{%- endfor %}
+{%- if '-iec-' not in conf.MCP_DEPLOY_SCENARIO and conf.MCP_KERNEL_VER %}
+ system:
+ kernel:
+ version: '{{ conf.MCP_KERNEL_VER }}'
+ headers: True
+{%- endif %}
diff --git a/mcp/scripts/globals.sh b/mcp/scripts/globals.sh
index 29506dc8f..e5d1decc6 100644
--- a/mcp/scripts/globals.sh
+++ b/mcp/scripts/globals.sh
@@ -13,6 +13,7 @@ export SSH_KEY=${SSH_KEY:-"/var/lib/opnfv/mcp.rsa"}
export SALT_MASTER=${INSTALLER_IP:-10.20.0.2}
export SALT_MASTER_USER=${SALT_MASTER_USER:-ubuntu}
export VIRSH=${VIRSH:-'virsh --connect qemu:///system'}
+export MCP_KERNEL_VER=${MCP_KERNEL_VER:-5.0.0-37}
# Derived from INSTALLER_IP
export MCPCONTROL_NET=${MCPCONTROL_NET:-${SALT_MASTER%.*}.0}
diff --git a/mcp/scripts/pharos b/mcp/scripts/pharos
-Subproject 9b9235ea136928b8148c57b1c3f3ddee6f761e6
+Subproject 061b5588d40253193eddf76139c361d62e6fbeb