From 648ec98613d31e3d9701b9ac1d87aed640b245f3 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Thu, 28 Dec 2017 18:41:09 +0100 Subject: MaaS: preseed Armband repo via curtin Instead of installing upstream vanilla kernel from Ubuntu just to upgrade to the one from Armband repo later, preseed Armband repo config via curtin. This allows us to drop a kernel update cycle, thus saving a few minutes at each deploy. While at it, switch salt repo addition to use the maas region reclass section instead of adding a dedicated mechanism for it in the curtin template (only for arm64). JIRA: ARMBAND-280 Change-Id: Iad5953a7de80d728f11a4ce3113bd7725100c31c Signed-off-by: Alexandru Avadanii --- ...-Add-curtin_userdata_arm64_generic_xenial.patch | 98 +++++++++++----------- ...emetal-linux-image-generic-hwe-16.04-edge.patch | 50 ----------- .../0013-glusterfs-Use-3.12-for-AArch64.patch | 61 ++++++++++++++ .../0014-glusterfs-Use-3.12-for-AArch64.patch | 61 -------------- 4 files changed, 112 insertions(+), 158 deletions(-) delete mode 100644 patches/opnfv-fuel/0013-baremetal-linux-image-generic-hwe-16.04-edge.patch create mode 100644 patches/opnfv-fuel/0013-glusterfs-Use-3.12-for-AArch64.patch delete mode 100644 patches/opnfv-fuel/0014-glusterfs-Use-3.12-for-AArch64.patch diff --git a/patches/opnfv-fuel/0005-maas-Add-curtin_userdata_arm64_generic_xenial.patch b/patches/opnfv-fuel/0005-maas-Add-curtin_userdata_arm64_generic_xenial.patch index 6431c942..6d331966 100644 --- a/patches/opnfv-fuel/0005-maas-Add-curtin_userdata_arm64_generic_xenial.patch +++ b/patches/opnfv-fuel/0005-maas-Add-curtin_userdata_arm64_generic_xenial.patch @@ -11,14 +11,16 @@ Date: Mon, 7 Aug 2017 19:45:01 +0200 Subject: [PATCH] maas: Add curtin_userdata_arm64_generic_xenial Add AArch64 specific configuration. +While at it, preseed Armband common repo-comp for Pike, so we get +the updated kernel & other packages from the start. Signed-off-by: Alexandru Avadanii --- - ...-Add-curtin_userdata_arm64_generic_xenial.patch | 35 ++++++++++++++++++ + ...-Add-curtin_userdata_arm64_generic_xenial.patch | 35 +++++++++++++++++++++ mcp/patches/patches.list | 1 + - .../baremetal-mcp-pike-common-ha/infra/maas.yml | 26 +++++++++++++ - .../files/curtin_userdata_arm64_generic_xenial | 43 ++++++++++++++++++++++ - 4 files changed, 105 insertions(+) + .../baremetal-mcp-pike-common-ha/infra/maas.yml | 36 ++++++++++++++++++++++ + .../files/curtin_userdata_arm64_generic_xenial | 35 +++++++++++++++++++++ + 4 files changed, 107 insertions(+) create mode 100644 mcp/patches/0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch create mode 100644 mcp/salt-formulas/maas/files/curtin_userdata_arm64_generic_xenial @@ -73,48 +75,58 @@ index cd32378..fc2ddea 100644 /usr/share/salt-formulas/env: 0012-linux.storage.lvm-Disable-filter.patch +/usr/share/salt-formulas/env: 0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/maas.yml b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/maas.yml -index 6332776..7292ebb 100644 +index 6332776..d263b19 100644 --- a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/maas.yml +++ b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/maas.yml -@@ -108,6 +108,32 @@ parameters: - architecture: ${_param:opnfv_maas_node05_architecture} - distro_series: xenial - hwe_kernel: ${_param:hwe_kernel} -+ cluster: -+ enabled: true -+ region: -+ port: 80 -+ host: localhost -+ saltstack_repo_key_arm64: | -+ -----BEGIN PGP PUBLIC KEY BLOCK----- -+ Version: GnuPG v1 +@@ -38,6 +38,42 @@ parameters: + enable_third_party_drivers: true + network_discovery: 'enabled' + default_min_hwe_kernel: ${_param:hwe_kernel} ++ package_repositories: ++ armband: ++ name: armband ++ enabled: '1' ++ url: 'http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}' ++ distributions: '${_param:openstack_version}-armband' ++ components: 'main' ++ arches: 'arm64' ++ key: &armband_key | ++ -----BEGIN PGP PUBLIC KEY BLOCK----- ++ Version: GnuPG v1 + -+ mQENBFagAroBCADWboNIjuF6lB1mWv2+EbvqY3lKl5mLKhr2DnSUkKeHUPBv8gNM -+ qK8Q00AMIyPiyEhgjA+dWizZ+5aBgxoiY7oMeLJ2Xym36U/8SYq2BWd3SGCbMNoz -+ SJDxDUSM/HFVs6atF1M3DY9oN65hSVnu4uy5Tu6asf6k4rhAyk0z4+pRcPBCu2vq -+ mnGi3COM/+9PShrEKeVOx5W2vRJywUFuq8EDvQnRoJ0GvM28JiJIanw17YwIPxhg -+ BKZVpZjan5X+ihVMXwA2h/G/FS5Omhd50RqV6LWSYs94VJJgYqHx8UMm7izcxI+P -+ ct3IcbD195bPbJ+SbuiFe45ZLsdY1MyGiU2BABEBAAG0K0VuZWEgQXJtYmFuZCBE -+ ZXZvcHMgVGVhbSA8YXJtYmFuZEBlbmVhLmNvbT6JAT4EEwECACgFAlagAroCGwMF -+ CQPCZwAGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEN6rkLp5irHRsG8H/2P2 -+ hO6jFHPRD1u8j9ufO9AxoInaEG9GeRjuvMc1tCUzovXvTs106TZ0as6MbAJ1S6u5 -+ E8UyQ1+VGepvdIJPXx3PCxLmUt6WIqmdOdqFrxIclohig/kardi3NfX1MBvlEV/c -+ 7Q51H43hrlMqMpqgY1Bm+53PLC4ujjlDJBtJOEU9dki319bUmng+gO9BAljDJFXv -+ JqY6+P/er7IgCbRXUXYfyJzgjx9JwlKbmdQ8QnCrZjF/VHIW40/mu5IIJuFvuCti -+ tcog+SNSlDmCOS+wE8CCojeuJqupIOcz9zypVGzeus/N5Q5EEFe7GYWYS/5NKUkE -+ 1TuuFeZKu5NJC5rkwIU= -+ =7p60 -+ -----END PGP PUBLIC KEY BLOCK----- -+ saltstack_repo_xenial_arm64: "http://linux.enea.com/saltstack/apt/ubuntu/16.04/arm64/2016.11 xenial main" - linux: - network: - interface: ++ mQENBFagAroBCADWboNIjuF6lB1mWv2+EbvqY3lKl5mLKhr2DnSUkKeHUPBv8gNM ++ qK8Q00AMIyPiyEhgjA+dWizZ+5aBgxoiY7oMeLJ2Xym36U/8SYq2BWd3SGCbMNoz ++ SJDxDUSM/HFVs6atF1M3DY9oN65hSVnu4uy5Tu6asf6k4rhAyk0z4+pRcPBCu2vq ++ mnGi3COM/+9PShrEKeVOx5W2vRJywUFuq8EDvQnRoJ0GvM28JiJIanw17YwIPxhg ++ BKZVpZjan5X+ihVMXwA2h/G/FS5Omhd50RqV6LWSYs94VJJgYqHx8UMm7izcxI+P ++ ct3IcbD195bPbJ+SbuiFe45ZLsdY1MyGiU2BABEBAAG0K0VuZWEgQXJtYmFuZCBE ++ ZXZvcHMgVGVhbSA8YXJtYmFuZEBlbmVhLmNvbT6JAT4EEwECACgFAlagAroCGwMF ++ CQPCZwAGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEN6rkLp5irHRsG8H/2P2 ++ hO6jFHPRD1u8j9ufO9AxoInaEG9GeRjuvMc1tCUzovXvTs106TZ0as6MbAJ1S6u5 ++ E8UyQ1+VGepvdIJPXx3PCxLmUt6WIqmdOdqFrxIclohig/kardi3NfX1MBvlEV/c ++ 7Q51H43hrlMqMpqgY1Bm+53PLC4ujjlDJBtJOEU9dki319bUmng+gO9BAljDJFXv ++ JqY6+P/er7IgCbRXUXYfyJzgjx9JwlKbmdQ8QnCrZjF/VHIW40/mu5IIJuFvuCti ++ tcog+SNSlDmCOS+wE8CCojeuJqupIOcz9zypVGzeus/N5Q5EEFe7GYWYS/5NKUkE ++ 1TuuFeZKu5NJC5rkwIU= ++ =7p60 ++ -----END PGP PUBLIC KEY BLOCK----- ++ saltstack_armband: ++ name: saltstack_armband ++ enabled: '1' ++ url: 'http://linux.enea.com/saltstack/apt/ubuntu/16.04/arm64/2016.11' ++ distributions: '${_param:linux_system_codename}' ++ components: 'main' ++ arches: 'arm64' ++ key: *armband_key + subnets: + opnfv_maas_pxe: + name: ${_param:opnfv_infra_maas_pxe_network_address}/24 diff --git a/mcp/salt-formulas/maas/files/curtin_userdata_arm64_generic_xenial b/mcp/salt-formulas/maas/files/curtin_userdata_arm64_generic_xenial new file mode 100644 -index 0000000..96fd76f +index 0000000..15d10a4 --- /dev/null +++ b/mcp/salt-formulas/maas/files/curtin_userdata_arm64_generic_xenial -@@ -0,0 +1,43 @@ +@@ -0,0 +1,35 @@ +{%- from "maas/map.jinja" import cluster with context %} +{% raw %} +#cloud-config @@ -134,14 +146,6 @@ index 0000000..96fd76f +{{endif}} +late_commands: + maas: [wget, '--no-proxy', {{node_disable_pxe_url|escape.json}}, '--post-data', {{node_disable_pxe_data|escape.json}}, '-O', '/dev/null'] -+{% endraw %} -+{%- if not cluster.saltstack_repo_key_arm64 == 'none' %} -+{% set salt_repo_key = salt['hashutil.base64_b64encode'](cluster.saltstack_repo_key_arm64) %} -+ apt_00_set_gpg: ["curtin", "in-target", "--", "sh", "-c", "echo '{{salt_repo_key}}' | base64 -d | apt-key add -"] -+{%- endif %} -+ apt_01_set_repo: ["curtin", "in-target", "--", "sh", "-c", "echo 'deb [arch=arm64] {{ cluster.saltstack_repo_xenial_arm64 }}' >> /etc/apt/sources.list"] -+{% raw %} -+ apt_03_update: ["curtin", "in-target", "--", "apt-get", "update"] + salt_01_install: ["curtin", "in-target", "--", "apt-get", "-y", "install", "salt-minion"] +{% endraw %} + salt_02_hostname_set: ["curtin", "in-target", "--", "echo", "{% raw %}{{node.hostname}}{% endraw %}.{{pillar.linux.system.domain}}"] diff --git a/patches/opnfv-fuel/0013-baremetal-linux-image-generic-hwe-16.04-edge.patch b/patches/opnfv-fuel/0013-baremetal-linux-image-generic-hwe-16.04-edge.patch deleted file mode 100644 index d12506f3..00000000 --- a/patches/opnfv-fuel/0013-baremetal-linux-image-generic-hwe-16.04-edge.patch +++ /dev/null @@ -1,50 +0,0 @@ -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -: Copyright (c) 2017 Enea AB and others. -: -: All rights reserved. This program and the accompanying materials -: are made available under the terms of the Apache License, Version 2.0 -: which accompanies this distribution, and is available at -: http://www.apache.org/licenses/LICENSE-2.0 -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -From: Alexandru Avadanii -Date: Sun, 5 Nov 2017 21:02:17 +0100 -Subject: [PATCH] baremetal: linux-image-generic-hwe-16.04-edge - -The Salt way to pin the kernel version is via its reclass model, by -defining system.kernel.version. However, this only works with -explicit kernel package names and not with meta package names -(e.g. linux-image-4.13.0-9916-generic is expected instead of - linux-image-generic-hwe-16.04-edge, which would break the -`linux_kernel_old_absent` state). - -For now, let's explicitly call `pkg.install` for the kernel and -headers packages, using the meta package name to ensure automatic -fallback to Ubuntu packages if Armband repos are missing, -respectively to automatically pick up new kernel package names -in case of meta + kernel packages bump later. - -JIRA: ARMBAND-280 - -Signed-off-by: Alexandru Avadanii ---- - mcp/config/states/baremetal_init | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/mcp/config/states/baremetal_init b/mcp/config/states/baremetal_init -index ea4d23c..ed3f287 100755 ---- a/mcp/config/states/baremetal_init -+++ b/mcp/config/states/baremetal_init -@@ -25,9 +25,12 @@ salt -C 'kvm* or cmp*' file.replace $debian_ip_source \ - salt -C 'kvm*' pkg.install bridge-utils - salt -C 'kvm* or cmp*' state.apply opnfv.adduser - salt -C 'kvm*' state.apply linux.network --salt -C 'cmp*' state.apply linux.system -+salt -C 'kvm* or cmp*' state.apply linux.system - salt -C 'cmp*' state.apply linux.network || true - salt -C 'kvm*' state.apply armband.salt_minion || true -+# NOTE(armband): Should be later moved to reclass as system.kernel.version -+salt -C 'kvm* or cmp*' pkg.install \ -+ linux-image-generic-hwe-16.04-edge,linux-headers-generic-hwe-16.04-edge - salt -C 'kvm* or cmp*' system.reboot - wait_for 90 "! salt -C 'kvm* or cmp*' test.ping | " \ - "tee /dev/stderr | grep -Fq 'Not connected'" diff --git a/patches/opnfv-fuel/0013-glusterfs-Use-3.12-for-AArch64.patch b/patches/opnfv-fuel/0013-glusterfs-Use-3.12-for-AArch64.patch new file mode 100644 index 00000000..6949ce82 --- /dev/null +++ b/patches/opnfv-fuel/0013-glusterfs-Use-3.12-for-AArch64.patch @@ -0,0 +1,61 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: Copyright (c) 2017 Enea AB and others. +: +: All rights reserved. This program and the accompanying materials +: are made available under the terms of the Apache License, Version 2.0 +: which accompanies this distribution, and is available at +: http://www.apache.org/licenses/LICENSE-2.0 +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +From: Alexandru Avadanii +Date: Fri, 15 Dec 2017 19:57:46 +0100 +Subject: [PATCH] glusterfs: Use 3.12 for AArch64 + +Currently, the glusterfs PPA for 3.13 does not have arm64 binaries, +so stick to 3.12 for now. + +Signed-off-by: Alexandru Avadanii +--- + mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/kvm.yml | 2 +- + .../classes/cluster/baremetal-mcp-pike-common-ha/openstack_compute.yml | 2 +- + .../classes/cluster/baremetal-mcp-pike-common-ha/openstack_control.yml | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/kvm.yml b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/kvm.yml +index 8c0fd73..24d5723 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/kvm.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/kvm.yml +@@ -26,7 +26,7 @@ classes: + parameters: + _param: + linux_system_codename: xenial +- glusterfs_version: '3.13' ++ glusterfs_version: '3.12' + cluster_vip_address: ${_param:infra_kvm_address} + cluster_node01_address: ${_param:infra_kvm_node01_address} + cluster_node02_address: ${_param:infra_kvm_node02_address} +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_compute.yml b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_compute.yml +index df23754..e3db1b0 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_compute.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_compute.yml +@@ -35,7 +35,7 @@ parameters: + keepalived_vip_virtual_router_id: 69 + loopback_device_size: 20 + linux_system_codename: xenial +- glusterfs_version: '3.13' ++ glusterfs_version: '3.12' + glusterfs: + client: + volumes: +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_control.yml b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_control.yml +index c332542..7a2288f 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_control.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_control.yml +@@ -38,7 +38,7 @@ parameters: + cluster_node03_hostname: ${_param:openstack_control_node03_hostname} + cluster_node03_address: ${_param:openstack_control_node03_address} + nova_vncproxy_url: https://${_param:cluster_public_host}:6080 +- glusterfs_version: '3.13' ++ glusterfs_version: '3.12' + nova: + controller: + pkgs: diff --git a/patches/opnfv-fuel/0014-glusterfs-Use-3.12-for-AArch64.patch b/patches/opnfv-fuel/0014-glusterfs-Use-3.12-for-AArch64.patch deleted file mode 100644 index 6949ce82..00000000 --- a/patches/opnfv-fuel/0014-glusterfs-Use-3.12-for-AArch64.patch +++ /dev/null @@ -1,61 +0,0 @@ -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -: Copyright (c) 2017 Enea AB and others. -: -: All rights reserved. This program and the accompanying materials -: are made available under the terms of the Apache License, Version 2.0 -: which accompanies this distribution, and is available at -: http://www.apache.org/licenses/LICENSE-2.0 -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -From: Alexandru Avadanii -Date: Fri, 15 Dec 2017 19:57:46 +0100 -Subject: [PATCH] glusterfs: Use 3.12 for AArch64 - -Currently, the glusterfs PPA for 3.13 does not have arm64 binaries, -so stick to 3.12 for now. - -Signed-off-by: Alexandru Avadanii ---- - mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/kvm.yml | 2 +- - .../classes/cluster/baremetal-mcp-pike-common-ha/openstack_compute.yml | 2 +- - .../classes/cluster/baremetal-mcp-pike-common-ha/openstack_control.yml | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/kvm.yml b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/kvm.yml -index 8c0fd73..24d5723 100644 ---- a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/kvm.yml -+++ b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/kvm.yml -@@ -26,7 +26,7 @@ classes: - parameters: - _param: - linux_system_codename: xenial -- glusterfs_version: '3.13' -+ glusterfs_version: '3.12' - cluster_vip_address: ${_param:infra_kvm_address} - cluster_node01_address: ${_param:infra_kvm_node01_address} - cluster_node02_address: ${_param:infra_kvm_node02_address} -diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_compute.yml b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_compute.yml -index df23754..e3db1b0 100644 ---- a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_compute.yml -+++ b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_compute.yml -@@ -35,7 +35,7 @@ parameters: - keepalived_vip_virtual_router_id: 69 - loopback_device_size: 20 - linux_system_codename: xenial -- glusterfs_version: '3.13' -+ glusterfs_version: '3.12' - glusterfs: - client: - volumes: -diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_control.yml b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_control.yml -index c332542..7a2288f 100644 ---- a/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_control.yml -+++ b/mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_control.yml -@@ -38,7 +38,7 @@ parameters: - cluster_node03_hostname: ${_param:openstack_control_node03_hostname} - cluster_node03_address: ${_param:openstack_control_node03_address} - nova_vncproxy_url: https://${_param:cluster_public_host}:6080 -- glusterfs_version: '3.13' -+ glusterfs_version: '3.12' - nova: - controller: - pkgs: -- cgit 1.2.3-korg