From b49021e1227573fbde13c82f432635ef187b1e83 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sun, 26 Nov 2017 05:43:39 +0100 Subject: u/fuel: Bump & rebase for image pre-install 1. Bump to latest Fuel@OPNFV to include: - Bring in newer glusterfs for mtime unsplit brain * Requires adding arch "arm64" to PPA definition in reclass: - (reclass-system) linux.system.repo.glusterfs: Add arm64 arch - Switch nofeature-ha compute nodes to UCA repo * Requires an alternative way of adding linux.enea.com repos; * linux.enea.com repos will now be pre-install into VM images; * Requires refresh on repo arch list handled by Armband patch: - (fuel) baremetal, virtual: Extend arch list for UCA repo 2. Staging proposed patches from upstream Fuel@OPNFV: - Add pre-{install,purge} support for base image * Reference implementation adds pre-installed Armband specifics: - Enea public GPG to APT keys (for below repos); - repos (linux.enea.com/{apt-mk,mcp-repos}/*); - linux-{image,headers}-generic-hwe-16.04-edge; - cloud-init: datasource from NoCloud only; * Allows us to drop kernel installation from state files, installing the kernel only once during image prep, instead of two stages of parallel installs (5 baremetal, 14 VCP); * Ensures Armband repos are pre-configured for infrastructure VMs, allowing us to drop more reclass repo definitions; * Rework armband patch to install kernel only on kvm, cmp: - (fuel) baremetal: linux-image-generic-hwe-16.04-edge 3. Sync reclass repo definitions with upstream change, drop duplicates - [linux][repos] Remove unused repositories [1] * Upstream dropped all "ocata-{security,hotfix,...} repo comps, which are also empty for Armband, so drop them too; * Rework following armband patches: - (reclass-system) linux/system/repo/mcp: Add Armband repos * Move Armband repos to new dedicated reclass classes: - linux.system.repo.mcp.armband.extra (currently empty); - linux.system.repo.mcp.armband.openstack; * Use HTTPS for fetching Enea Armband GPG key; - (fuel) baremetal: Add Armband Openstack repos to kvm, cmp * Consume defs introduced above only on baremetal nodes; 4. Sync documentation with Fuel@OPNFV (cp) 5. Add vim swap files to .gitignore [1] https://github.com/Mirantis/reclass-system-salt-model/commit/1dd1b31 Change-Id: Ibab56279de86f08ad7cd9bc6761f4c525532f811 Signed-off-by: Alexandru Avadanii (cherry picked from commit 37083673d6cdddbb9b710f4dd5efe832753e5856) --- .gitignore | 1 + docs/release/installation/img/README.rst | 12 + docs/release/installation/img/arm_pod5.png | Bin 0 -> 168862 bytes docs/release/installation/img/fuel_baremetal.png | Bin 0 -> 245916 bytes docs/release/installation/img/fuel_virtual.png | Bin 0 -> 216442 bytes docs/release/installation/img/lf_pod2.png | Bin 0 -> 167832 bytes .../installation/installation.instruction.rst | 215 +++++++-- docs/release/userguide/img/horizon_login.png | Bin 0 -> 32205 bytes docs/release/userguide/img/salt_services_ip.png | Bin 0 -> 149270 bytes docs/release/userguide/img/saltstack.png | Bin 0 -> 14373 bytes docs/release/userguide/index.rst | 18 + docs/release/userguide/userguide.rst | 267 +++++++++++ ...al-Add-Armband-Openstack-repos-to-kvm-cmp.patch | 49 +++ ...-salt-formulas-Add-enable-armband-formula.patch | 487 --------------------- ...etwork-public-Use-arm-virtual2-POD-config.patch | 109 ----- ...-salt-formulas-Add-enable-armband-formula.patch | 487 +++++++++++++++++++++ ...alt-formulas-opendaylight-AArch64-leveldb.patch | 48 -- ...etwork-public-Use-arm-virtual2-POD-config.patch | 109 +++++ ...-Add-curtin_userdata_arm64_generic_xenial.patch | 160 ------- ...alt-formulas-opendaylight-AArch64-leveldb.patch | 48 ++ ...-Add-curtin_userdata_arm64_generic_xenial.patch | 160 +++++++ ...aas-boot-resources-Add-arm64-architecture.patch | 39 -- .../0006-libvirt-Use-libvirt-unix_sock_group.patch | 58 --- ...aas-boot-resources-Add-arm64-architecture.patch | 39 ++ .../0007-libvirt-Use-libvirt-unix_sock_group.patch | 58 +++ ...lt-formulas-armband-Extend-libvirt_domain.patch | 174 -------- ...lt-formulas-armband-Extend-libvirt_domain.patch | 174 ++++++++ ...-virtng.py-virt.sls-Extend-libvirt_domain.patch | 223 ---------- .../0009-seedng-module-Add-AArch64-repo.patch | 57 --- ...-virtng.py-virt.sls-Extend-libvirt_domain.patch | 223 ++++++++++ ...0-aarch64-skip-configuration-of-hugepages.patch | 36 -- .../0010-seedng-module-Add-AArch64-repo.patch | 57 +++ ...1-aarch64-skip-configuration-of-hugepages.patch | 36 ++ ...tal-virtual-Extend-arch-list-for-UCA-repo.patch | 88 ---- .../0012-Add-opnfv-user-to-the-deployment.patch | 67 --- ...tal-virtual-Extend-arch-list-for-UCA-repo.patch | 101 +++++ .../0013-Add-opnfv-user-to-the-deployment.patch | 67 +++ ...emetal-linux-image-generic-hwe-16.04-edge.patch | 62 --- ...emetal-linux-image-generic-hwe-16.04-edge.patch | 50 +++ ...-pre-install-purge-support-for-base-image.patch | 382 ++++++++++++++++ ...1-linux-system-repo-mcp-Add-Armband-repos.patch | 93 ---- ...1-linux.system.repo.mcp-Add-Armband-repos.patch | 67 +++ .../0002-linux-system-AArch64-Remove-mcelog.patch | 34 -- .../0002-linux.system-AArch64-Remove-mcelog.patch | 34 ++ ...inux.system.repo.glusterfs-Add-arm64-arch.patch | 29 ++ upstream/fuel | 2 +- 46 files changed, 2653 insertions(+), 1767 deletions(-) create mode 100644 docs/release/installation/img/README.rst create mode 100644 docs/release/installation/img/arm_pod5.png create mode 100644 docs/release/installation/img/fuel_baremetal.png create mode 100644 docs/release/installation/img/fuel_virtual.png create mode 100644 docs/release/installation/img/lf_pod2.png create mode 100644 docs/release/userguide/img/horizon_login.png create mode 100644 docs/release/userguide/img/salt_services_ip.png create mode 100644 docs/release/userguide/img/saltstack.png create mode 100644 docs/release/userguide/index.rst create mode 100644 docs/release/userguide/userguide.rst create mode 100644 patches/opnfv-fuel/0001-baremetal-Add-Armband-Openstack-repos-to-kvm-cmp.patch delete mode 100644 patches/opnfv-fuel/0001-salt-formulas-Add-enable-armband-formula.patch delete mode 100644 patches/opnfv-fuel/0002-network-public-Use-arm-virtual2-POD-config.patch create mode 100644 patches/opnfv-fuel/0002-salt-formulas-Add-enable-armband-formula.patch delete mode 100644 patches/opnfv-fuel/0003-mcp-salt-formulas-opendaylight-AArch64-leveldb.patch create mode 100644 patches/opnfv-fuel/0003-network-public-Use-arm-virtual2-POD-config.patch delete mode 100644 patches/opnfv-fuel/0004-maas-Add-curtin_userdata_arm64_generic_xenial.patch create mode 100644 patches/opnfv-fuel/0004-mcp-salt-formulas-opendaylight-AArch64-leveldb.patch create mode 100644 patches/opnfv-fuel/0005-maas-Add-curtin_userdata_arm64_generic_xenial.patch delete mode 100644 patches/opnfv-fuel/0005-maas-boot-resources-Add-arm64-architecture.patch delete mode 100644 patches/opnfv-fuel/0006-libvirt-Use-libvirt-unix_sock_group.patch create mode 100644 patches/opnfv-fuel/0006-maas-boot-resources-Add-arm64-architecture.patch create mode 100644 patches/opnfv-fuel/0007-libvirt-Use-libvirt-unix_sock_group.patch delete mode 100644 patches/opnfv-fuel/0007-mcp-salt-formulas-armband-Extend-libvirt_domain.patch create mode 100644 patches/opnfv-fuel/0008-mcp-salt-formulas-armband-Extend-libvirt_domain.patch delete mode 100644 patches/opnfv-fuel/0008-virtng.py-virt.sls-Extend-libvirt_domain.patch delete mode 100644 patches/opnfv-fuel/0009-seedng-module-Add-AArch64-repo.patch create mode 100644 patches/opnfv-fuel/0009-virtng.py-virt.sls-Extend-libvirt_domain.patch delete mode 100644 patches/opnfv-fuel/0010-aarch64-skip-configuration-of-hugepages.patch create mode 100644 patches/opnfv-fuel/0010-seedng-module-Add-AArch64-repo.patch create mode 100644 patches/opnfv-fuel/0011-aarch64-skip-configuration-of-hugepages.patch delete mode 100644 patches/opnfv-fuel/0011-baremetal-virtual-Extend-arch-list-for-UCA-repo.patch delete mode 100644 patches/opnfv-fuel/0012-Add-opnfv-user-to-the-deployment.patch create mode 100644 patches/opnfv-fuel/0012-baremetal-virtual-Extend-arch-list-for-UCA-repo.patch create mode 100644 patches/opnfv-fuel/0013-Add-opnfv-user-to-the-deployment.patch delete mode 100644 patches/opnfv-fuel/0013-baremetal-linux-image-generic-hwe-16.04-edge.patch create mode 100644 patches/opnfv-fuel/0014-baremetal-linux-image-generic-hwe-16.04-edge.patch create mode 100644 patches/opnfv-fuel/0015-Add-pre-install-purge-support-for-base-image.patch delete mode 100644 patches/reclass-system-salt-model/0001-linux-system-repo-mcp-Add-Armband-repos.patch create mode 100644 patches/reclass-system-salt-model/0001-linux.system.repo.mcp-Add-Armband-repos.patch delete mode 100644 patches/reclass-system-salt-model/0002-linux-system-AArch64-Remove-mcelog.patch create mode 100644 patches/reclass-system-salt-model/0002-linux.system-AArch64-Remove-mcelog.patch create mode 100644 patches/reclass-system-salt-model/0003-linux.system.repo.glusterfs-Add-arm64-arch.patch diff --git a/.gitignore b/.gitignore index c01c608f..3fcc6269 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ build.log config.mk ci/clean_cache.sh +*.sw? diff --git a/docs/release/installation/img/README.rst b/docs/release/installation/img/README.rst new file mode 100644 index 00000000..bc8d9bed --- /dev/null +++ b/docs/release/installation/img/README.rst @@ -0,0 +1,12 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. SPDX-License-Identifier: CC-BY-4.0 +.. (c) 2017 Ericsson AB, Mirantis Inc., Enea AB and others. + +Image Editor +============ +All files in this directory have been created using `draw.io `_. + +Image Sources +============= +Image sources are embedded in each `png` file. +To edit an image, import the `png` file using `draw.io `_. diff --git a/docs/release/installation/img/arm_pod5.png b/docs/release/installation/img/arm_pod5.png new file mode 100644 index 00000000..b35b661a Binary files /dev/null and b/docs/release/installation/img/arm_pod5.png differ diff --git a/docs/release/installation/img/fuel_baremetal.png b/docs/release/installation/img/fuel_baremetal.png new file mode 100644 index 00000000..aee42ac3 Binary files /dev/null and b/docs/release/installation/img/fuel_baremetal.png differ diff --git a/docs/release/installation/img/fuel_virtual.png b/docs/release/installation/img/fuel_virtual.png new file mode 100644 index 00000000..d7664865 Binary files /dev/null and b/docs/release/installation/img/fuel_virtual.png differ diff --git a/docs/release/installation/img/lf_pod2.png b/docs/release/installation/img/lf_pod2.png new file mode 100644 index 00000000..b6c9b8e3 Binary files /dev/null and b/docs/release/installation/img/lf_pod2.png differ diff --git a/docs/release/installation/installation.instruction.rst b/docs/release/installation/installation.instruction.rst index 1b624d26..502c7509 100644 --- a/docs/release/installation/installation.instruction.rst +++ b/docs/release/installation/installation.instruction.rst @@ -21,7 +21,7 @@ This document provides guidelines on how to install and configure the Euphrates release of OPNFV when using Fuel as a deployment tool, including required software and hardware configurations. -Although the available installation options provide a high de.g.ee of +Although the available installation options provide a high degree of freedom in how the system is set up, including architecture, services and features, etc., said permutations may not provide an OPNFV compliant reference architecture. This document provides a @@ -40,7 +40,7 @@ OPNFV, using Fuel as a deployment tool, some planning must be done. Preparations -================== +============ Prior to installation, a number of deployment specific parameters must be collected, those are: @@ -65,7 +65,7 @@ This information will be needed for the configuration procedures provided in this document. ========================================= -Hardware requirements for virtual deploys +Hardware Requirements for Virtual Deploys ========================================= The following minimum hardware requirements must be met for the virtual @@ -76,7 +76,7 @@ installation of Euphrates using Fuel: | | | +============================+========================================================+ | **1 Jumpserver** | A physical node (also called Foundation Node) that | -| | hosts a Salt Master VM and each of the VM nodes in | +| | will host a Salt Master VM and each of the VM nodes in | | | the virtual deploy | +----------------------------+--------------------------------------------------------+ | **CPU** | Minimum 1 socket with Virtualization support | @@ -88,7 +88,7 @@ installation of Euphrates using Fuel: =========================================== -Hardware requirements for baremetal deploys +Hardware Requirements for Baremetal Deploys =========================================== The following minimum hardware requirements must be met for the baremetal @@ -153,7 +153,7 @@ environment, you should think about: - Networking -- Depends on the Choose Network Topology, the network bandwidth per virtual machine, and network storage. ================================================ -Top of the rack (TOR) Configuration requirements +Top of the Rack (TOR) Configuration Requirements ================================================ The switching infrastructure provides connectivity for the OPNFV @@ -177,8 +177,27 @@ Manual configuration of the Euphrates hardware platform should be carried out according to the `OPNFV Pharos Specification `_. +============================ +OPNFV Software Prerequisites +============================ + +The Jumpserver node should be pre-provisioned with an operating system, +according to the Pharos specification. Relevant network bridges should +also be pre-configured (e.g. admin, management, public). + +Fuel@OPNFV has been validated by CI using the following distributions +installed on the Jumpserver: + + - CentOS 7 (recommended by Pharos specification); + - Ubuntu Xenial; + +**NOTE:** The install script expects 'libvirt' to be installed and running +on the Jumpserver. In case the packages are missing, the script will install +them; but depending on the OS distribution, the user might have to start the +'libvirtd' service manually. + ========================================== -OPNFV Software installation and deployment +OPNFV Software Installation and Deployment ========================================== This section describes the process of installing all the components needed to @@ -205,6 +224,33 @@ For virtual deploys all the targets are VMs on the Jumpserver. The deploy script - Install Openstack on the targets - Leverage Salt to install & configure Openstack services +.. figure:: img/fuel_virtual.png + :align: center + :alt: Fuel@OPNFV Virtual POD Network Layout Examples + + Fuel@OPNFV Virtual POD Network Layout Examples + + +-----------------------+------------------------------------------------------------------------+ + | cfg01 | Salt Master VM | + +-----------------------+------------------------------------------------------------------------+ + | ctl01 | Controller VM | + +-----------------------+------------------------------------------------------------------------+ + | cmp01/cmp02 | Compute VMs | + +-----------------------+------------------------------------------------------------------------+ + | gtw01 | Gateway VM with neutron services (dhcp agent, L3 agent, metadata, etc) | + +-----------------------+------------------------------------------------------------------------+ + | odl01 | VM on which ODL runs (for scenarios deployed with ODL) | + +-----------------------+------------------------------------------------------------------------+ + + +In this figure there are examples of two virtual deploys: + - Jumphost 1 has only virsh bridges, created by the deploy script + - Jumphost 2 has a mix of linux and virsh briges; when linux bridge exist for a specified network, + the deploy script will skip creating a virsh bridge for it + +**Note**: A virtual network "mcpcontrol" is always created. For virtual deploys, "mcpcontrol" is also used +for Admin, leaving the PXE/Admin bridge unused. + Automatic Installation of a Baremetal POD ========================================= @@ -223,8 +269,42 @@ The installation is done automatically with the deploy script, which will: - Leverage Salt to configure the operatign system on the baremetal nodes - Leverage Salt to install & configure Openstack services - -Steps to start the automatic deploy +.. figure:: img/fuel_baremetal.png + :align: center + :alt: Fuel@OPNFV Baremetal POD Network Layout Example + + Fuel@OPNFV Baremetal POD Network Layout Example + + +-----------------------+---------------------------------------------------------+ + | cfg01 | Salt Master VM | + +-----------------------+---------------------------------------------------------+ + | mas01 | MaaS Node VM | + +-----------------------+---------------------------------------------------------+ + | kvm01..03 | Baremetals which hold the VMs with controller functions | + +-----------------------+---------------------------------------------------------+ + | cmp001/cmp002 | Baremetal compute nodes | + +-----------------------+---------------------------------------------------------+ + | prx01/prx02 | Proxy VMs for Nginx | + +-----------------------+---------------------------------------------------------+ + | msg01..03 | RabbitMQ Service VMs | + +-----------------------+---------------------------------------------------------+ + | dbs01..03 | MySQL service VMs | + +-----------------------+---------------------------------------------------------+ + | mdb01..03 | Telemetry VMs | + +-----------------------+---------------------------------------------------------+ + | odl01 | VM on which ODL runs (for scenarios deployed with ODL) | + +-----------------------+---------------------------------------------------------+ + | Tenant VM | VM running in the cloud | + +-----------------------+---------------------------------------------------------+ + +In the baremetal deploy all bridges but "mcpcontrol" are linux bridges. For the Jumpserver, if they are already created +they will be used; otherwise they will be created. For the targets, the bridges are created by the deploy script. + +**Note**: A virtual network "mcpcontrol" is always created. For baremetal deploys, PXE bridge is used for +baremetal node provisioning, while "mcpcontrol" is used to provision the infrastructure VMs only. + + +Steps to Start the Automatic Deploy =================================== These steps are common both for virtual and baremetal deploys. @@ -249,7 +329,7 @@ These steps are common both for virtual and baremetal deploys. .. code-block:: bash - $ git checkout 5.0.2 + $ git checkout opnfv-5.0.2 #. Start the deploy script @@ -257,42 +337,115 @@ These steps are common both for virtual and baremetal deploys. $ ci/deploy.sh -l \ -p \ - -b \ + -b \ -s \ - -B + -B Examples -------- #. Virtual deploy - .. code-block:: bash + To start a virtual deployment, it is required to have the `virtual` keyword + while specifying the pod name to the installer script. + + It will create the required bridges and networks, configure Salt Master and + install OpenStack. - $ ci/deploy.sh -b file:///home/jenkins/tmpdir/securedlab \ - -l ericsson \ - -p virtual_kvm \ - -s os-nosdn-nofeature-noha + .. code-block:: bash + + $ ci/deploy.sh -b file:///home/jenkins/tmpdir/securedlab \ + -l ericsson \ + -p virtual_kvm \ + -s os-nosdn-nofeature-noha + + Once the deployment is complete, the OpenStack Dashboard, Horizon is + available at http://:8078, e.g. http://10.16.0.101:8078. + The administrator credentials are **admin** / **opnfv_secret**. #. Baremetal deploy -A x86 deploy on pod1 from Ericsson lab + A x86 deploy on pod2 from Linux Foundation lab - .. code-block:: bash + .. code-block:: bash - $ ci/deploy.sh -b file:///home/jenkins/tmpdir/securedlab \ - -l ericsson \ - -p pod1 \ - -s os-nosdn-nofeature-ha \ - -B pxebr + $ ci/deploy.sh -b file:///home/jenkins/tmpdir/securedlab \ + -l lf \ + -p pod2 \ + -s os-nosdn-nofeature-ha \ + -B pxebr,br-ctl -An aarch64 deploy on pod5 from Arm lab + .. figure:: img/lf_pod2.png + :align: center + :alt: Fuel@OPNFV LF POD2 Network Layout + + Fuel@OPNFV LF POD2 Network Layout + + Once the deployment is complete, the SaltStack Deployment Documentation is + available at http://:8090, e.g. http://172.30.10.103:8090. + + An aarch64 deploy on pod5 from Arm lab + + .. code-block:: bash + + $ ci/deploy.sh -b file:///home/jenkins/tmpdir/securedlab \ + -l arm \ + -p pod5 \ + -s os-nosdn-nofeature-ha \ + -B admin7_br0,mgmt7_br0,,public7_br0 + + .. figure:: img/arm_pod5.png + :align: center + :alt: Fuel@OPNFV ARM POD5 Network Layout + + Fuel@OPNFV ARM POD5 Network Layout + + Once the deployment is complete, the SaltStack Deployment Documentation is + available at http://:8090, e.g. http://10.0.8.103:8090. + + +Pod Descriptor Files +==================== + +Descriptor files provide the installer with an abstraction of the target pod +with all its hardware characteristics and required parameters. This information +is split into two different files: +Pod Descriptor File (PDF) and Installer Descriptor File (IDF). + + +The Pod Descriptor File is a hardware and network description of the pod +infrastructure. The information is modeled under a yaml structure. +A reference file with the expected yaml structure is available at +*mcp/config/labs/local/pod1.yaml* + +A common network section describes all the internal and provider networks +assigned to the pod. Each network is expected to have a vlan tag, IP subnet and +attached interface on the boards. Untagged vlans shall be defined as "native". + +The hardware description is arranged into a main "jumphost" node and a "nodes" +set for all target boards. For each node the following characteristics +are defined: + +- Node parameters including CPU features and total memory. +- A list of available disks. +- Remote management parameters. +- Network interfaces list including mac address, speed and advanced features. +- IP list of fixed IPs for the node + +**Note**: the fixed IPs are ignored by the MCP installer script and it will instead +assign based on the network ranges defined under the pod network configuration. + + +The Installer Descriptor File extends the PDF with pod related parameters +required by the installer. This information may differ per each installer type +and it is not considered part of the pod infrastructure. Fuel installer relies +on the IDF model to map the networks to the bridges on the foundation node and +to setup all node NICs by defining the expected OS device name and bus address. - .. code-block:: bash - $ ci/deploy.sh -b file:///home/jenkins/tmpdir/securedlab \ - -l arm \ - -p pod5 \ - -s os-nosdn-nofeature-ha \ - -B pxebr +The file follows a yaml structure and a "fuel" section is expected. Contents and +references must be aligned with the PDF file. The IDF file must be named after +the PDF with the prefix "idf-". A reference file with the expected structure +is available at *mcp/config/labs/local/idf-pod1.yaml* ============= diff --git a/docs/release/userguide/img/horizon_login.png b/docs/release/userguide/img/horizon_login.png new file mode 100644 index 00000000..641ca6c6 Binary files /dev/null and b/docs/release/userguide/img/horizon_login.png differ diff --git a/docs/release/userguide/img/salt_services_ip.png b/docs/release/userguide/img/salt_services_ip.png new file mode 100644 index 00000000..504beb3e Binary files /dev/null and b/docs/release/userguide/img/salt_services_ip.png differ diff --git a/docs/release/userguide/img/saltstack.png b/docs/release/userguide/img/saltstack.png new file mode 100644 index 00000000..d57452c6 Binary files /dev/null and b/docs/release/userguide/img/saltstack.png differ diff --git a/docs/release/userguide/index.rst b/docs/release/userguide/index.rst new file mode 100644 index 00000000..d4330d08 --- /dev/null +++ b/docs/release/userguide/index.rst @@ -0,0 +1,18 @@ +.. _fuel-userguide: + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) Open Platform for NFV Project, Inc. and its contributors + +.. _fuel-release-userguide-label: + +************************** +User guide for Fuel\@OPNFV +************************** + +.. toctree:: + :numbered: + :maxdepth: 2 + + userguide.rst + diff --git a/docs/release/userguide/userguide.rst b/docs/release/userguide/userguide.rst new file mode 100644 index 00000000..f00e6635 --- /dev/null +++ b/docs/release/userguide/userguide.rst @@ -0,0 +1,267 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) Open Platform for NFV Project, Inc. and its contributors + +======== +Abstract +======== + +This document contains details about how to use OPNFV Fuel - Euphrates +release - after it was deployed. For details on how to deploy check the +installation instructions in the :ref:`references` section. + +This is an unified documentation for both x86_64 and aarch64 +architectures. All information is common for both architectures +except when explicitly stated. + + + +================ +Network Overview +================ + +Fuel uses several networks to deploy and administer the cloud: + ++------------------+-------------------+---------------------------------------------------------+ +| Network name | Deploy Type | Description | +| | | | ++==================+===================+=========================================================+ +| **PXE/ADMIN** | baremetal only | Used for booting the nodes via PXE | ++------------------+-------------------+---------------------------------------------------------+ +| **MCPCONTROL** | baremetal & | Used to provision the infrastructure VMs (Salt & MaaS). | +| | virtual | On virtual deploys, it is used for Admin too (on target | +| | | VMs) leaving the PXE/Admin bridge unused | ++------------------+-------------------+---------------------------------------------------------+ +| **Mgmt** | baremetal & | Used for internal communication between | +| | virtual | OpenStack components | ++------------------+-------------------+---------------------------------------------------------+ +| **Internal** | baremetal & | Used for VM data communication within the | +| | virtual | cloud deployment | ++------------------+-------------------+---------------------------------------------------------+ +| **Public** | baremetal & | Used to provide Virtual IPs for public endpoints | +| | virtual | that are used to connect to OpenStack services APIs. | +| | | Used by Virtual machines to access the Internet | ++------------------+-------------------+---------------------------------------------------------+ + + +These networks - except mcpcontrol - can be linux bridges configured before the deploy on the +Jumpserver. If they don't exists at deploy time, they will be created by the scripts as virsh +networks. + +Mcpcontrol exists only on the Jumpserver and needs to be virtual because a DHCP server runs +on this network and associates static host entry IPs for Salt and Maas VMs. + + + +=================== +Accessing the Cloud +=================== + +Access to any component of the deployed cloud is done from Jumpserver to user *ubuntu* with +ssh key */var/lib/opnfv/mcp.rsa*. The example below is a connection to Salt master. + + .. code-block:: bash + + $ ssh -o StrictHostKeyChecking=no -i /var/lib/opnfv/mcp.rsa -l ubuntu 10.20.0.2 + +**Note**: The Salt master IP is not hard set, it is configurable via INSTALLER_IP during deployment + + +The Fuel baremetal deploy has a Virtualized Control Plane (VCP) which means that the controller +services are installed in VMs on the baremetal targets (kvm servers). These VMs can also be +accessed with virsh console: user *opnfv*, password *opnfv_secret*. This method does not apply +to infrastructure VMs (Salt master and MaaS). + +The example below is a connection to a controller VM. The connection is made from the baremetal +server kvm01. + + .. code-block:: bash + + $ ssh -o StrictHostKeyChecking=no -i /var/lib/opnfv/mcp.rsa -l ubuntu x.y.z.141 + ubuntu@kvm01:~$ virsh console ctl01 + +User *ubuntu* has sudo rights. User *opnfv* has sudo rights only on aarch64 deploys. + + +============================= +Exploring the Cloud with Salt +============================= + +To gather information about the cloud, the salt commands can be used. It is based +around a master-minion idea where the salt-master pushes config to the minions to +execute actions. + +For example tell salt to execute a ping to 8.8.8.8 on all the nodes. + +.. figure:: img/saltstack.png + +Complex filters can be done to the target like compound queries or node roles. +For more information about Salt see the :ref:`references` section. + +Some examples are listed below. Note that these commands are issued from Salt master +with *root* user. + + +#. View the IPs of all the components + + .. code-block:: bash + + root@cfg01:~$ salt "*" network.ip_addrs + cfg01.baremetal-mcp-ocata-odl-ha.local: + - 10.20.0.2 + - 172.16.10.100 + mas01.baremetal-mcp-ocata-odl-ha.local: + - 10.20.0.3 + - 172.16.10.3 + - 192.168.11.3 + ......................... + + +#. View the interfaces of all the components and put the output in a file with yaml format + + .. code-block:: bash + + root@cfg01:~$ salt "*" network.interfaces --out yaml --output-file interfaces.yaml + root@cfg01:~# cat interfaces.yaml + cfg01.baremetal-mcp-ocata-odl-ha.local: + enp1s0: + hwaddr: 52:54:00:72:77:12 + inet: + - address: 10.20.0.2 + broadcast: 10.20.0.255 + label: enp1s0 + netmask: 255.255.255.0 + inet6: + - address: fe80::5054:ff:fe72:7712 + prefixlen: '64' + scope: link + up: true + ......................... + + +#. View installed packages in MaaS node + + .. code-block:: bash + + root@cfg01:~# salt "mas*" pkg.list_pkgs + mas01.baremetal-mcp-ocata-odl-ha.local: + ---------- + accountsservice: + 0.6.40-2ubuntu11.3 + acl: + 2.2.52-3 + acpid: + 1:2.0.26-1ubuntu2 + adduser: + 3.113+nmu3ubuntu4 + anerd: + 1 + ......................... + + +#. Execute any linux command on all nodes (list the content of */var/log* in this example) + + .. code-block:: bash + + root@cfg01:~# salt "*" cmd.run 'ls /var/log' + cfg01.baremetal-mcp-ocata-odl-ha.local: + alternatives.log + apt + auth.log + boot.log + btmp + cloud-init-output.log + cloud-init.log + ......................... + + +#. Execute any linux command on nodes using compound queries filter + + .. code-block:: bash + + root@cfg01:~# salt -C '* and cfg01*' cmd.run 'ls /var/log' + cfg01.baremetal-mcp-ocata-odl-ha.local: + alternatives.log + apt + auth.log + boot.log + btmp + cloud-init-output.log + cloud-init.log + ......................... + + +#. Execute any linux command on nodes using role filter + + .. code-block:: bash + + root@cfg01:~# salt -I 'nova:compute' cmd.run 'ls /var/log' + cmp001.baremetal-mcp-ocata-odl-ha.local: + alternatives.log + apache2 + apt + auth.log + btmp + ceilometer + cinder + cloud-init-output.log + cloud-init.log + ......................... + + + +=================== +Accessing Openstack +=================== + +Once the deployment is complete, Openstack CLI is accessible from controller VMs (ctl01..03). +Openstack credentials are at */root/keystonercv3*. + + .. code-block:: bash + + root@ctl01:~# source keystonercv3 + root@ctl01:~# openstack image list + +--------------------------------------+-----------------------------------------------+--------+ + | ID | Name | Status | + +======================================+===============================================+========+ + | 152930bf-5fd5-49c2-b3a1-cae14973f35f | CirrosImage | active | + | 7b99a779-78e4-45f3-9905-64ae453e3dcb | Ubuntu16.04 | active | + +--------------------------------------+-----------------------------------------------+--------+ + + +The OpenStack Dashboard, Horizon is available at http://:8078, e.g. http://10.16.0.101:8078. +The administrator credentials are *admin*/*opnfv_secret*. + +.. figure:: img/horizon_login.png + + +A full list of IPs/services is available at :8090 for baremetal deploys. + +.. figure:: img/salt_services_ip.png + +For Virtual deploys, the most commonly used IPs are in the table below. + ++-----------+--------------+---------------+ +| Component | IP | Default value | ++===========+==============+===============+ +| gtw01 | x.y.z.110 | 172.16.10.110 | ++-----------+--------------+---------------+ +| ctl01 | x.y.z.100 | 172.16.10.100 | ++-----------+--------------+---------------+ +| cmp001 | x.y.z.105 | 172.16.10.105 | ++-----------+--------------+---------------+ +| cmp002 | x.y.z.106 | 172.16.10.106 | ++-----------+--------------+---------------+ + + +.. _references: + +========== +References +========== + +1) `Installation instructions `_ +2) `Saltstack Documentation `_ +3) `Saltstack Formulas `_ + + diff --git a/patches/opnfv-fuel/0001-baremetal-Add-Armband-Openstack-repos-to-kvm-cmp.patch b/patches/opnfv-fuel/0001-baremetal-Add-Armband-Openstack-repos-to-kvm-cmp.patch new file mode 100644 index 00000000..18d6529d --- /dev/null +++ b/patches/opnfv-fuel/0001-baremetal-Add-Armband-Openstack-repos-to-kvm-cmp.patch @@ -0,0 +1,49 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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, 26 Nov 2017 17:25:08 +0100 +Subject: [PATCH] baremetal: Add Armband Openstack repos to kvm, cmp + +Armband provides 2 sets of APT repositories: +- linux.system.repo.mcp.armband.openstack; +- linux.system.repo.mcp.armband.extra (currently empty); + +These repos are pre-installed for all infrastructure VMs, so we only +handle them via Salt for baremetal kvm* and cmp* nodes. + +Signed-off-by: Alexandru Avadanii +--- + mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml | 1 + + .../classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml +index 7138d68..9011e47 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml +@@ -7,6 +7,7 @@ + ############################################################################## + --- + classes: ++ - system.linux.system.repo.mcp.armband.openstack + - system.linux.system.repo.mcp.openstack + - system.linux.system.repo.mcp.extra + - system.linux.system.repo.glusterfs +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml +index e07e611..278e55b 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml +@@ -7,6 +7,7 @@ + ############################################################################## + --- + classes: ++ - system.linux.system.repo.mcp.armband.openstack + - system.linux.system.repo.mcp.extra + - system.linux.system.repo.glusterfs + - system.linux.storage.loopback diff --git a/patches/opnfv-fuel/0001-salt-formulas-Add-enable-armband-formula.patch b/patches/opnfv-fuel/0001-salt-formulas-Add-enable-armband-formula.patch deleted file mode 100644 index 2fef9ae3..00000000 --- a/patches/opnfv-fuel/0001-salt-formulas-Add-enable-armband-formula.patch +++ /dev/null @@ -1,487 +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: Guillermo Herrero -Date: Tue, 25 Jul 2017 00:58:32 +0200 -Subject: [PATCH] salt-formulas: Add & enable armband formula - -- prereq: install qemu-efi; -- prereq: install vgabios; -- prereq: fix missing link for vgabios binary blob; -- nova patch: Support qemu >= 2.10 (backport from [1]); -- nova patch: Add video type virtio for AArch64 (backport from [2]); -- nova patch: libvirt driver: Add ttyAMA0 by default on AArch64; -- nova patch: libvirt driver: AArch64: ACPI depends on AAVMF; -- nova conf: cpu_model=cortex-a57 (only for virtual deploys); -- nova conf: virt_type=qemu (only for virtual deploys); -- nova conf: pointer_model=ps2mouse since AArch64 has no USB tablet; - -[1] https://github.com/openstack/nova/commit/8075797 -[2] https://github.com/openstack/nova/commit/f0f0953 - -Signed-off-by: Guillermo Herrero -Signed-off-by: Charalampos Kominos -Signed-off-by: Alexandru Avadanii ---- - mcp/config/states/openstack | 2 + - mcp/config/states/openstack_ha | 1 + - mcp/config/states/virtual_control_plane | 1 + - .../armband/files/nova-libvirt-aarch64-rollup.diff | 317 +++++++++++++++++++++ - mcp/salt-formulas/armband/init.sls | 7 + - mcp/salt-formulas/armband/nova_config.sls | 30 ++ - mcp/salt-formulas/armband/nova_libvirt.sls | 7 + - mcp/salt-formulas/armband/qemu_efi.sls | 2 + - mcp/salt-formulas/armband/vgabios.sls | 7 + - 9 files changed, 374 insertions(+) - create mode 100644 mcp/salt-formulas/armband/files/nova-libvirt-aarch64-rollup.diff - create mode 100644 mcp/salt-formulas/armband/init.sls - create mode 100644 mcp/salt-formulas/armband/nova_config.sls - create mode 100644 mcp/salt-formulas/armband/nova_libvirt.sls - create mode 100644 mcp/salt-formulas/armband/qemu_efi.sls - create mode 100644 mcp/salt-formulas/armband/vgabios.sls - -diff --git a/mcp/config/states/openstack b/mcp/config/states/openstack -index 369e165..d2a0b63 100755 ---- a/mcp/config/states/openstack -+++ b/mcp/config/states/openstack -@@ -47,3 +47,5 @@ salt -I 'ceilometer:server' state.sls ceilometer - salt -I 'ceilometer:agent' state.sls ceilometer - - salt -I 'horizon:server' state.sls horizon -+ -+salt -I 'nova:compute' state.sls armband || true -diff --git a/mcp/config/states/openstack_ha b/mcp/config/states/openstack_ha -index e1fdf73..e1f705c 100755 ---- a/mcp/config/states/openstack_ha -+++ b/mcp/config/states/openstack_ha -@@ -52,6 +52,7 @@ salt -I 'neutron:server' state.sls neutron -b 1 - salt -I 'neutron:gateway' state.sls neutron.gateway - - salt -I 'nova:compute' state.sls nova -+salt -I 'nova:compute' state.sls armband || true - - salt -I 'mongodb:server' state.sls mongodb || true - wait_for 90 "salt -C 'I@mongodb:server and *01*' cmd.run 'mongo localhost:27017/admin'" -diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane -index c355126..99fb517 100755 ---- a/mcp/config/states/virtual_control_plane -+++ b/mcp/config/states/virtual_control_plane -@@ -46,6 +46,7 @@ wait_for 90 "! salt -C 'kvm* or cmp*' test.ping | " \ - - salt -C '* and not cfg01* and not mas01*' state.apply linux,ntp - -+salt -C 'kvm*' state.sls armband || true - wait_for 5 "salt -C 'kvm*' state.sls libvirt" - - salt -C '* and not cfg01* and not mas01*' state.apply salt -diff --git a/mcp/salt-formulas/armband/files/nova-libvirt-aarch64-rollup.diff b/mcp/salt-formulas/armband/files/nova-libvirt-aarch64-rollup.diff -new file mode 100644 -index 0000000..4d7f04c ---- /dev/null -+++ b/mcp/salt-formulas/armband/files/nova-libvirt-aarch64-rollup.diff -@@ -0,0 +1,317 @@ -+From 807579755c4a116309eca5b2bcdbab9d1f393bab Mon Sep 17 00:00:00 2001 -+From: Matt Riedemann -+Date: Wed, 20 Sep 2017 10:44:11 -0400 -+Subject: [PATCH] Support qemu >= 2.10 -+ -+Qemu 2.10 added the requirement of a --force-share flag to qemu-img -+info when reading information about a disk that is in use by a -+guest. We do this a lot in Nova for operations like gathering -+information before live migration. -+ -+Up until this point all qemu/libvirt version matching has been solely -+inside the libvirt driver, however all the image manip code was moved -+out to nova.virt.images. We need the version of QEMU available there. -+ -+This does it by initializing that version on driver init host. The net -+effect is also that broken libvirt connections are figured out -+earlier, as there is an active probe for this value. -+ -+Co-Authored-By: Sean Dague -+ -+[ Alexandru.Avadanii@enea.com ] -+Minor patch adjustment to apply cleanly on Newton without further -+backporting. -+ -+Change-Id: Iae2962bb86100f03fd3ad9aac3767da876291e74 -+Closes-Bug: #1718295 -+ -+Signed-off-by: Alexandru Avadanii -+--- -+ nova/test.py | 3 +++ -+ nova/tests/unit/virt/libvirt/test_driver.py | 20 ++++++++++++++++++-- -+ nova/tests/unit/virt/libvirt/test_utils.py | 25 +++++++++++++++++++++++++ -+ nova/virt/images.py | 10 ++++++++++ -+ nova/virt/libvirt/driver.py | 14 +++++++++----- -+ 5 files changed, 65 insertions(+), 7 deletions(-) -+ -+diff --git a/nova/test.py b/nova/test.py -+index f0e6953b965..9b9ea9507e8 100644 -+--- a/nova/test.py -++++ b/nova/test.py -+@@ -61,6 +61,7 @@ -+ from nova.tests.unit import policy_fixture -+ from nova.tests import uuidsentinel as uuids -+ from nova import utils -++from nova.virt import images -+ -+ -+ CONF = cfg.CONF -+@@ -303,6 +304,8 @@ def setUp(self): -+ # nova.utils._IS_NEUTRON. We set it to None to avoid any -+ # caching of that value. -+ utils._IS_NEUTRON = None -++ # Reset the global QEMU version flag. -++ images.QEMU_VERSION = None -+ -+ mox_fixture = self.useFixture(moxstubout.MoxStubout()) -+ self.mox = mox_fixture.mox -+diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py -+index fe54dc75e7f..4e9f2bd250e 100644 -+--- a/nova/tests/unit/virt/libvirt/test_driver.py -++++ b/nova/tests/unit/virt/libvirt/test_driver.py -+@@ -986,6 +986,23 @@ def test_next_min_qemu_version_ok(self, mock_warning, mock_get_libversion): -+ break -+ self.assertFalse(version_arg_found) -+ -++ # NOTE(sdague): python2.7 and python3.5 have different behaviors -++ # when it comes to comparing against the sentinel, so -++ # has_min_version is needed to pass python3.5. -++ @mock.patch.object(nova.virt.libvirt.host.Host, "has_min_version", -++ return_value=True) -++ @mock.patch.object(fakelibvirt.Connection, 'getVersion', -++ return_value=mock.sentinel.qemu_version) -++ def test_qemu_image_version(self, mock_get_libversion, min_ver): -++ """Test that init_host sets qemu image version -++ -++ A sentinel is used here so that we aren't chasing this value -++ against minimums that get raised over time. -++ """ -++ drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) -++ drvr.init_host("dummyhost") -++ self.assertEqual(images.QEMU_VERSION, mock.sentinel.qemu_version) -++ -+ @mock.patch.object(fakelibvirt.Connection, 'getLibVersion', -+ return_value=versionutils.convert_version_to_int( -+ libvirt_driver.MIN_LIBVIRT_OTHER_ARCH.get( -+@@ -11605,9 +11622,8 @@ def test_command_with_broken_connection(self): -+ return_value=service_mock), -+ mock.patch.object(host.Host, "get_capabilities")): -+ -+- drvr.init_host("wibble") -+ self.assertRaises(exception.HypervisorUnavailable, -+- drvr.get_num_instances) -++ drvr.init_host, ("wibble",)) -+ self.assertTrue(service_mock.disabled) -+ -+ def test_service_resume_after_broken_connection(self): -+diff --git a/nova/tests/unit/virt/libvirt/test_utils.py b/nova/tests/unit/virt/libvirt/test_utils.py -+index 646a72c8599..49945a3cd3b 100644 -+--- a/nova/tests/unit/virt/libvirt/test_utils.py -++++ b/nova/tests/unit/virt/libvirt/test_utils.py -+@@ -173,6 +173,31 @@ def test_qemu_info_canon(self, mock_execute, mock_exists): -+ -+ @mock.patch('os.path.exists', return_value=True) -+ @mock.patch('nova.utils.execute') -++ def test_qemu_info_canon_qemu_2_10(self, mock_execute, mock_exists): -++ images.QEMU_VERSION = images.QEMU_VERSION_REQ_SHARED -++ path = "disk.config" -++ example_output = """image: disk.config -++file format: raw -++virtual size: 64M (67108864 bytes) -++cluster_size: 65536 -++disk size: 96K -++blah BLAH: bb -++""" -++ mock_execute.return_value = (example_output, '') -++ image_info = images.qemu_img_info(path) -++ mock_execute.assert_called_once_with('env', 'LC_ALL=C', 'LANG=C', -++ 'qemu-img', 'info', path, -++ '--force-share', -++ prlimit=images.QEMU_IMG_LIMITS) -++ mock_exists.assert_called_once_with(path) -++ self.assertEqual('disk.config', image_info.image) -++ self.assertEqual('raw', image_info.file_format) -++ self.assertEqual(67108864, image_info.virtual_size) -++ self.assertEqual(98304, image_info.disk_size) -++ self.assertEqual(65536, image_info.cluster_size) -++ -++ @mock.patch('os.path.exists', return_value=True) -++ @mock.patch('nova.utils.execute') -+ def test_qemu_info_canon2(self, mock_execute, mock_exists): -+ path = "disk.config" -+ example_output = """image: disk.config -+diff --git a/nova/virt/images.py b/nova/virt/images.py -+index dae6bc7ef52..be2a9d9e062 100644 -+--- a/nova/virt/images.py -++++ b/nova/virt/images.py -+@@ -19,6 +19,7 @@ -+ Handling of VM disk images. -+ """ -+ -++import operator -+ import os -+ -+ from oslo_concurrency import processutils -+@@ -42,6 +43,11 @@ -+ cpu_time=8, -+ address_space=1 * units.Gi) -+ -++# This is set by the libvirt driver on startup. The version is used to -++# determine what flags need to be set on the command line. -++QEMU_VERSION = None -++QEMU_VERSION_REQ_SHARED = 2010000 -++ -+ -+ def qemu_img_info(path, format=None): -+ """Return an object containing the parsed output from qemu-img info.""" -+@@ -60,6 +66,10 @@ def qemu_img_info(path, format=None): -+ cmd = ('env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', path) -+ if format is not None: -+ cmd = cmd + ('-f', format) -++ # Check to see if the qemu version is >= 2.10 because if so, we need -++ # to add the --force-share flag. -++ if QEMU_VERSION and operator.ge(QEMU_VERSION, QEMU_VERSION_REQ_SHARED): -++ cmd = cmd + ('--force-share',) -+ out, err = utils.execute(*cmd, prlimit=QEMU_IMG_LIMITS) -+ except processutils.ProcessExecutionError as exp: -+ # this means we hit prlimits, make the exception more specific -+diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py -+index 82dc2b99f6a..8d4eb90ecf5 100644 -+--- a/nova/virt/libvirt/driver.py -++++ b/nova/virt/libvirt/driver.py -+@@ -481,11 +481,15 @@ def init_host(self, host): -+ _('Nova requires libvirt version %s or greater.') % -+ self._version_to_string(MIN_LIBVIRT_VERSION)) -+ -+- if (CONF.libvirt.virt_type in ("qemu", "kvm") and -+- not self._host.has_min_version(hv_ver=MIN_QEMU_VERSION)): -+- raise exception.InternalError( -+- _('Nova requires QEMU version %s or greater.') % -+- self._version_to_string(MIN_QEMU_VERSION)) -++ if CONF.libvirt.virt_type in ("qemu", "kvm"): -++ if self._host.has_min_version(hv_ver=MIN_QEMU_VERSION): -++ # "qemu-img info" calls are version dependent, so we need to -++ # store the version in the images module. -++ images.QEMU_VERSION = self._host.get_connection().getVersion() -++ else: -++ raise exception.InternalError( -++ _('Nova requires QEMU version %s or greater.') % -++ self._version_to_string(MIN_QEMU_VERSION)) -+ -+ if CONF.libvirt.virt_type == 'parallels': -+ if not self._host.has_min_version(hv_ver=MIN_VIRTUOZZO_VERSION): -+-- -+ -+From: Stanislaw Kardach -+Date: Tue, 22 Mar 2016 12:05:09 +0100 -+Subject: [PATCH] nova: Update console defaults for armv7, aarch64 -+ -+Nova hardcodes default options for serial console. -+For armv7 and aarch64 direct kernel boot, adding console=ttyAMA0 is -+a nice UX addition. -+ -+Signed-off-by: Stanislaw Kardach -+Signed-off-by: Alexandru Avadanii -+Signed-off-by: Guillermo Herrero -+ -+--- -+ -+diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py -+--- a/nova/virt/libvirt/driver.py -++++ b/nova/virt/libvirt/driver.py -+@@ -4179,7 +4179,12 @@ class LibvirtDriver(driver.ComputeDriver): -+ if virt_type == "xen": -+ guest.os_cmdline = "ro root=%s" % root_device_name -+ else: -++ guestarch = libvirt_utils.get_arch(image_meta) -+ guest.os_cmdline = ("root=%s %s" % (root_device_name, CONSOLE)) -++ if guestarch in (fields.Architecture.ARMV7, -++ fields.Architecture.AARCH64): -++ # NOTE(armband): ARM v7/v8 use PL011 drv, add ttyAMA0 console -++ guest.os_cmdline += " console=ttyAMA0" -+ if virt_type == "qemu": -+ guest.os_cmdline += " no_timer_check" -+ if instance.ramdisk_id: -+-- -+ -+From: Alexandru Avadanii -+Date: Thu, 24 Aug 2017 10:57:28 +0200 -+Subject: [PATCH] libvirt: AArch64: ACPI depends on AAVMF -+ -+On AArch64, ACPI should be added to domain XML only if guest UEFI -+(AAVMF) is also used. -+ -+Signed-off-by: Alexandru Avadanii -+Signed-off-by: Ciprian Barbu -+ -+--- -+ -+diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py -+--- a/nova/virt/libvirt/driver.py -++++ b/nova/virt/libvirt/driver.py -+@@ -4255,7 +4255,7 @@ -+ tmhyperv.present = True -+ clk.add_timer(tmhyperv) -+ -+- def _set_features(self, guest, os_type, caps, virt_type): -++ def _set_features(self, guest, os_type, image_meta, caps, virt_type): -+ if virt_type == "xen": -+ # PAE only makes sense in X86 -+ if caps.host.cpu.arch in (fields.Architecture.I686, -+@@ -4264,7 +4264,10 @@ -+ -+ if (virt_type not in ("lxc", "uml", "parallels", "xen") or -+ (virt_type == "xen" and guest.os_type == fields.VMMode.HVM)): -+- guest.features.append(vconfig.LibvirtConfigGuestFeatureACPI()) -++ guestarch = libvirt_utils.get_arch(image_meta) -++ if (guestarch not in (fields.Architecture.ARMV7, fields.Architecture.AARCH64) or -++ image_meta.properties.get('hw_firmware_type') == 'uefi'): -++ guest.features.append(vconfig.LibvirtConfigGuestFeatureACPI()) -+ guest.features.append(vconfig.LibvirtConfigGuestFeatureAPIC()) -+ -+ if (virt_type in ("qemu", "kvm") and -+@@ -4799,7 +4802,7 @@ -+ self._conf_non_lxc_uml(virt_type, guest, root_device_name, rescue, -+ instance, inst_path, image_meta, disk_info) -+ -+- self._set_features(guest, instance.os_type, caps, virt_type) -++ self._set_features(guest, instance.os_type, image_meta, caps, virt_type) -+ self._set_clock(guest, instance.os_type, image_meta, virt_type) -+ -+ storage_configs = self._get_guest_storage_config( -+-- -+ -+From f0f09530ee9169eb29bc28d4f118676d7dc6640e Mon Sep 17 00:00:00 2001 -+From: Kevin Zhao -+Date: Tue, 15 Aug 2017 09:52:09 +0000 -+Subject: [PATCH] Add video type virtio for AArch64 -+ -+Currently only "virtio" type is supported on AArch64, and the -+other "virrus", "qxl" and "vga" don't work on AArch64 according to -+libvirt upstream: -+https://www.redhat.com/archives/libvir-list/2016-September/msg00546.html -+Then this patch adds the virtio for AArch64 and tweaks the related test cases. -+ -+Closes-bug: #1710766 -+ -+[ Alexandru.Avadanii@enea.com ] -+Dropped test changes so it applies cleanly on Newton without more backports. -+ -+Change-Id: Iba8a1e671f2b5759b3d9178aa1871d0cf888b26b -+Signed-off-by: Kevin Zhao -+Signed-off-by: Alexandru Avadanii -+--- -+ -+--- a/nova/virt/libvirt/driver.py -++++ b/nova/virt/libvirt/driver.py -+@@ -4342,7 +4342,8 @@ def _check_number_of_serial_console(self, num_ports): -+ allowed=ALLOWED_QEMU_SERIAL_PORTS, virt_type=virt_type) -+ -+ def _add_video_driver(self, guest, image_meta, flavor): -+- VALID_VIDEO_DEVICES = ("vga", "cirrus", "vmvga", "xen", "qxl") -++ VALID_VIDEO_DEVICES = ("vga", "cirrus", "vmvga", -++ "xen", "qxl", "virtio") -+ video = vconfig.LibvirtConfigGuestVideo() -+ # NOTE(ldbragst): The following logic sets the video.type -+ # depending on supported defaults given the architecture, -+@@ -4360,6 +4361,10 @@ def _add_video_driver(self, guest, image_meta, flavor): -+ # NOTE(ldbragst): PowerKVM doesn't support 'cirrus' be default -+ # so use 'vga' instead when running on Power hardware. -+ video.type = 'vga' -++ elif guestarch in (fields.Architecture.AARCH64): -++ # NOTE(kevinz): Only virtio device type is supported by AARCH64 -++ # so use 'virtio' instead when running on AArch64 hardware. -++ video.type = 'virtio' -+ elif CONF.spice.enabled: -+ video.type = 'qxl' -+ if image_meta.properties.get('hw_video_model'): -diff --git a/mcp/salt-formulas/armband/init.sls b/mcp/salt-formulas/armband/init.sls -new file mode 100644 -index 0000000..8a8cf2a ---- /dev/null -+++ b/mcp/salt-formulas/armband/init.sls -@@ -0,0 +1,7 @@ -+include: -+ - armband.qemu_efi -+ - armband.vgabios -+ {%- if salt['pkg.version']('python-nova') %} -+ - armband.nova_libvirt -+ - armband.nova_config -+ {%- endif %} -diff --git a/mcp/salt-formulas/armband/nova_config.sls b/mcp/salt-formulas/armband/nova_config.sls -new file mode 100644 -index 0000000..674f371 ---- /dev/null -+++ b/mcp/salt-formulas/armband/nova_config.sls -@@ -0,0 +1,30 @@ -+{% if grains['virtual'] == 'kvm' %} -+nova_virt_type: -+ file.replace: -+ - name: "/etc/nova/nova.conf" -+ - pattern: '^virt_type\s*=.*$' -+ - repl: "virt_type = qemu" -+{% endif %} -+nova_pointer_model: -+ file.replace: -+ - name: "/etc/nova/nova.conf" -+ - pattern: '^#pointer_model\s*=.*$' -+ - repl: "pointer_model = ps2mouse" -+nova_cpu_mode: -+ file.replace: -+ - name: "/etc/nova/nova.conf" -+ - pattern: '^cpu_mode\s*=\s*host-passthrough' -+ - repl: "cpu_mode = custom" -+nova_cpu_model: -+ file.replace: -+ - name: "/etc/nova/nova.conf" -+ - pattern: '^#cpu_model\s*=.*$' -+ {% if grains['virtual'] == 'kvm' %} -+ - repl: "cpu_model = cortex-a57" -+ {% else %} -+ - repl: "cpu_model = host" -+ {% endif %} -+restart_nova-compute: -+ cmd: -+ - run -+ - name: "service nova-compute restart" -diff --git a/mcp/salt-formulas/armband/nova_libvirt.sls b/mcp/salt-formulas/armband/nova_libvirt.sls -new file mode 100644 -index 0000000..bc2cbda ---- /dev/null -+++ b/mcp/salt-formulas/armband/nova_libvirt.sls -@@ -0,0 +1,7 @@ -+nova-libvirt-aarch64-rollup: -+ file.patch: -+ - name: /usr/lib/python2.7/dist-packages -+ - source: salt://armband/files/nova-libvirt-aarch64-rollup.diff -+ - hash: False -+ - options: '-p1' -+ - unless: 'test -f /var/cache/salt/minion/files/base/armband/files/nova-libvirt-aarch64-rollup.diff && cd /usr/lib/python2.7/dist-packages && patch -p1 -R --dry-run /var/cache/salt/minion/files/base/armband/files/nova-libvirt-aarch64-rollup.diff' -diff --git a/mcp/salt-formulas/armband/qemu_efi.sls b/mcp/salt-formulas/armband/qemu_efi.sls -new file mode 100644 -index 0000000..c697dae ---- /dev/null -+++ b/mcp/salt-formulas/armband/qemu_efi.sls -@@ -0,0 +1,2 @@ -+qemu-efi: -+ pkg.installed -diff --git a/mcp/salt-formulas/armband/vgabios.sls b/mcp/salt-formulas/armband/vgabios.sls -new file mode 100644 -index 0000000..500c2bc ---- /dev/null -+++ b/mcp/salt-formulas/armband/vgabios.sls -@@ -0,0 +1,7 @@ -+vgabios: -+ pkg.installed -+/usr/share/qemu: -+ file.directory -+/usr/share/qemu/vgabios-stdvga.bin: -+ file.symlink: -+ - target: "/usr/share/vgabios/vgabios.bin" diff --git a/patches/opnfv-fuel/0002-network-public-Use-arm-virtual2-POD-config.patch b/patches/opnfv-fuel/0002-network-public-Use-arm-virtual2-POD-config.patch deleted file mode 100644 index 1dc8f99b..00000000 --- a/patches/opnfv-fuel/0002-network-public-Use-arm-virtual2-POD-config.patch +++ /dev/null @@ -1,109 +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: Tue, 18 Jul 2017 19:17:24 +0200 -Subject: [PATCH] network: public: Use arm-virtual2 POD config - -grep -e "10\.16\.0\." -R . -l | \ - xargs sed -i \ - -e 's/10\.16\.0\./10.0.9./g' \ - -e 's/10\.0\.9\.254/10.0.9.200/g' \ - -e 's/10\.0\.9\.1/10.0.9.254/g' - -NOTE: This should be converted into a dynamic configuration read from -the universal POD descriptor in securedlab, once that is ready. - -Until then, just align the public network configuration used by the -virtual POD with the Enea lab configuration specific to arm-virtual2 -(i.e. public network on 10.0.9.0/24). - -NOTE: Replace the gateway at 10.16.0.1 (now 10.0.9.1) with the same -IP address as our lab's gateway (10.0.9.254), to keep both possible -network layouts in sync (using all virtual networks created via -virsh, respectively our lab's static config). -This will ensure deploys continue to work in both enviroments. - -Also, since our new gateway resides at 10.0.9.254, trim the DHCP pool -range for the public network to not include that address. - -Signed-off-by: Alexandru Avadanii ---- - mcp/config/states/networks | 6 +++--- - .../classes/cluster/virtual-mcp-ocata-common/infra/config.yml | 6 +++--- - .../classes/cluster/virtual-mcp-ocata-common/openstack_init.yml | 2 +- - mcp/scripts/net_public.xml | 2 +- - 4 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/mcp/config/states/networks b/mcp/config/states/networks -index d4735ad..e566903 100755 ---- a/mcp/config/states/networks -+++ b/mcp/config/states/networks -@@ -18,7 +18,7 @@ PUBLIC_NET=$(salt --out yaml 'cmp*' pillar.get _param:external_address | \ - pillar.get _param:openstack_compute_node01_external_address | \ - awk --re-interval '/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/{print $2; exit}') - --[ -n "${PUBLIC_NET}" ] && PUBLIC_NET="${PUBLIC_NET%.*}.0/24" || PUBLIC_NET="10.16.0.0/24" -+[ -n "${PUBLIC_NET}" ] && PUBLIC_NET="${PUBLIC_NET%.*}.0/24" || PUBLIC_NET="10.0.9.0/24" - - salt 'ctl01*' cmd.run ". /root/keystonercv3; \ - openstack compute service list; \ -@@ -29,6 +29,6 @@ salt 'ctl01*' cmd.run ". /root/keystonercv3; \ - openstack network create --external --default --provider-network-type flat \ - --provider-physical-network physnet1 floating_net" - salt 'ctl01*' cmd.run ". /root/keystonercv3; \ -- openstack subnet create --gateway ${PUBLIC_NET%.*}.1 --no-dhcp \ -- --allocation-pool start=${PUBLIC_NET%.*}.130,end=${PUBLIC_NET%.*}.254 \ -+ openstack subnet create --gateway ${PUBLIC_NET%.*}.254 --no-dhcp \ -+ --allocation-pool start=${PUBLIC_NET%.*}.130,end=${PUBLIC_NET%.*}.200 \ - --network floating_net --subnet-range ${PUBLIC_NET} floating_subnet" -diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml -index 3c3d526..e114ec2 100644 ---- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml -+++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml -@@ -61,13 +61,13 @@ parameters: - params: - single_address: 172.16.10.105 - tenant_address: 10.1.0.105 -- external_address: 10.16.0.105 -+ external_address: 10.0.9.105 - openstack_compute_node02: - params: - single_address: 172.16.10.106 - tenant_address: 10.1.0.106 -- external_address: 10.16.0.106 -+ external_address: 10.0.9.106 - openstack_gateway_node01: - params: - tenant_address: 10.1.0.110 -- external_address: 10.16.0.110 -+ external_address: 10.0.9.110 -diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_init.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_init.yml -index 81f050f..b304c28 100644 ---- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_init.yml -+++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_init.yml -@@ -14,7 +14,7 @@ parameters: - openstack_region: RegionOne - admin_email: root@localhost - cluster_public_protocol: http -- cluster_public_host: 10.16.0.101 -+ cluster_public_host: 10.0.9.101 - neutron_public_protocol: http - neutron_control_dvr: 'False' - neutron_l3_ha: 'False' -diff --git a/mcp/scripts/net_public.xml b/mcp/scripts/net_public.xml -index d6df4aa..87f3146 100644 ---- a/mcp/scripts/net_public.xml -+++ b/mcp/scripts/net_public.xml -@@ -10,5 +10,5 @@ - public - - -- -+ - diff --git a/patches/opnfv-fuel/0002-salt-formulas-Add-enable-armband-formula.patch b/patches/opnfv-fuel/0002-salt-formulas-Add-enable-armband-formula.patch new file mode 100644 index 00000000..2fef9ae3 --- /dev/null +++ b/patches/opnfv-fuel/0002-salt-formulas-Add-enable-armband-formula.patch @@ -0,0 +1,487 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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: Guillermo Herrero +Date: Tue, 25 Jul 2017 00:58:32 +0200 +Subject: [PATCH] salt-formulas: Add & enable armband formula + +- prereq: install qemu-efi; +- prereq: install vgabios; +- prereq: fix missing link for vgabios binary blob; +- nova patch: Support qemu >= 2.10 (backport from [1]); +- nova patch: Add video type virtio for AArch64 (backport from [2]); +- nova patch: libvirt driver: Add ttyAMA0 by default on AArch64; +- nova patch: libvirt driver: AArch64: ACPI depends on AAVMF; +- nova conf: cpu_model=cortex-a57 (only for virtual deploys); +- nova conf: virt_type=qemu (only for virtual deploys); +- nova conf: pointer_model=ps2mouse since AArch64 has no USB tablet; + +[1] https://github.com/openstack/nova/commit/8075797 +[2] https://github.com/openstack/nova/commit/f0f0953 + +Signed-off-by: Guillermo Herrero +Signed-off-by: Charalampos Kominos +Signed-off-by: Alexandru Avadanii +--- + mcp/config/states/openstack | 2 + + mcp/config/states/openstack_ha | 1 + + mcp/config/states/virtual_control_plane | 1 + + .../armband/files/nova-libvirt-aarch64-rollup.diff | 317 +++++++++++++++++++++ + mcp/salt-formulas/armband/init.sls | 7 + + mcp/salt-formulas/armband/nova_config.sls | 30 ++ + mcp/salt-formulas/armband/nova_libvirt.sls | 7 + + mcp/salt-formulas/armband/qemu_efi.sls | 2 + + mcp/salt-formulas/armband/vgabios.sls | 7 + + 9 files changed, 374 insertions(+) + create mode 100644 mcp/salt-formulas/armband/files/nova-libvirt-aarch64-rollup.diff + create mode 100644 mcp/salt-formulas/armband/init.sls + create mode 100644 mcp/salt-formulas/armband/nova_config.sls + create mode 100644 mcp/salt-formulas/armband/nova_libvirt.sls + create mode 100644 mcp/salt-formulas/armband/qemu_efi.sls + create mode 100644 mcp/salt-formulas/armband/vgabios.sls + +diff --git a/mcp/config/states/openstack b/mcp/config/states/openstack +index 369e165..d2a0b63 100755 +--- a/mcp/config/states/openstack ++++ b/mcp/config/states/openstack +@@ -47,3 +47,5 @@ salt -I 'ceilometer:server' state.sls ceilometer + salt -I 'ceilometer:agent' state.sls ceilometer + + salt -I 'horizon:server' state.sls horizon ++ ++salt -I 'nova:compute' state.sls armband || true +diff --git a/mcp/config/states/openstack_ha b/mcp/config/states/openstack_ha +index e1fdf73..e1f705c 100755 +--- a/mcp/config/states/openstack_ha ++++ b/mcp/config/states/openstack_ha +@@ -52,6 +52,7 @@ salt -I 'neutron:server' state.sls neutron -b 1 + salt -I 'neutron:gateway' state.sls neutron.gateway + + salt -I 'nova:compute' state.sls nova ++salt -I 'nova:compute' state.sls armband || true + + salt -I 'mongodb:server' state.sls mongodb || true + wait_for 90 "salt -C 'I@mongodb:server and *01*' cmd.run 'mongo localhost:27017/admin'" +diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane +index c355126..99fb517 100755 +--- a/mcp/config/states/virtual_control_plane ++++ b/mcp/config/states/virtual_control_plane +@@ -46,6 +46,7 @@ wait_for 90 "! salt -C 'kvm* or cmp*' test.ping | " \ + + salt -C '* and not cfg01* and not mas01*' state.apply linux,ntp + ++salt -C 'kvm*' state.sls armband || true + wait_for 5 "salt -C 'kvm*' state.sls libvirt" + + salt -C '* and not cfg01* and not mas01*' state.apply salt +diff --git a/mcp/salt-formulas/armband/files/nova-libvirt-aarch64-rollup.diff b/mcp/salt-formulas/armband/files/nova-libvirt-aarch64-rollup.diff +new file mode 100644 +index 0000000..4d7f04c +--- /dev/null ++++ b/mcp/salt-formulas/armband/files/nova-libvirt-aarch64-rollup.diff +@@ -0,0 +1,317 @@ ++From 807579755c4a116309eca5b2bcdbab9d1f393bab Mon Sep 17 00:00:00 2001 ++From: Matt Riedemann ++Date: Wed, 20 Sep 2017 10:44:11 -0400 ++Subject: [PATCH] Support qemu >= 2.10 ++ ++Qemu 2.10 added the requirement of a --force-share flag to qemu-img ++info when reading information about a disk that is in use by a ++guest. We do this a lot in Nova for operations like gathering ++information before live migration. ++ ++Up until this point all qemu/libvirt version matching has been solely ++inside the libvirt driver, however all the image manip code was moved ++out to nova.virt.images. We need the version of QEMU available there. ++ ++This does it by initializing that version on driver init host. The net ++effect is also that broken libvirt connections are figured out ++earlier, as there is an active probe for this value. ++ ++Co-Authored-By: Sean Dague ++ ++[ Alexandru.Avadanii@enea.com ] ++Minor patch adjustment to apply cleanly on Newton without further ++backporting. ++ ++Change-Id: Iae2962bb86100f03fd3ad9aac3767da876291e74 ++Closes-Bug: #1718295 ++ ++Signed-off-by: Alexandru Avadanii ++--- ++ nova/test.py | 3 +++ ++ nova/tests/unit/virt/libvirt/test_driver.py | 20 ++++++++++++++++++-- ++ nova/tests/unit/virt/libvirt/test_utils.py | 25 +++++++++++++++++++++++++ ++ nova/virt/images.py | 10 ++++++++++ ++ nova/virt/libvirt/driver.py | 14 +++++++++----- ++ 5 files changed, 65 insertions(+), 7 deletions(-) ++ ++diff --git a/nova/test.py b/nova/test.py ++index f0e6953b965..9b9ea9507e8 100644 ++--- a/nova/test.py +++++ b/nova/test.py ++@@ -61,6 +61,7 @@ ++ from nova.tests.unit import policy_fixture ++ from nova.tests import uuidsentinel as uuids ++ from nova import utils +++from nova.virt import images ++ ++ ++ CONF = cfg.CONF ++@@ -303,6 +304,8 @@ def setUp(self): ++ # nova.utils._IS_NEUTRON. We set it to None to avoid any ++ # caching of that value. ++ utils._IS_NEUTRON = None +++ # Reset the global QEMU version flag. +++ images.QEMU_VERSION = None ++ ++ mox_fixture = self.useFixture(moxstubout.MoxStubout()) ++ self.mox = mox_fixture.mox ++diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py ++index fe54dc75e7f..4e9f2bd250e 100644 ++--- a/nova/tests/unit/virt/libvirt/test_driver.py +++++ b/nova/tests/unit/virt/libvirt/test_driver.py ++@@ -986,6 +986,23 @@ def test_next_min_qemu_version_ok(self, mock_warning, mock_get_libversion): ++ break ++ self.assertFalse(version_arg_found) ++ +++ # NOTE(sdague): python2.7 and python3.5 have different behaviors +++ # when it comes to comparing against the sentinel, so +++ # has_min_version is needed to pass python3.5. +++ @mock.patch.object(nova.virt.libvirt.host.Host, "has_min_version", +++ return_value=True) +++ @mock.patch.object(fakelibvirt.Connection, 'getVersion', +++ return_value=mock.sentinel.qemu_version) +++ def test_qemu_image_version(self, mock_get_libversion, min_ver): +++ """Test that init_host sets qemu image version +++ +++ A sentinel is used here so that we aren't chasing this value +++ against minimums that get raised over time. +++ """ +++ drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) +++ drvr.init_host("dummyhost") +++ self.assertEqual(images.QEMU_VERSION, mock.sentinel.qemu_version) +++ ++ @mock.patch.object(fakelibvirt.Connection, 'getLibVersion', ++ return_value=versionutils.convert_version_to_int( ++ libvirt_driver.MIN_LIBVIRT_OTHER_ARCH.get( ++@@ -11605,9 +11622,8 @@ def test_command_with_broken_connection(self): ++ return_value=service_mock), ++ mock.patch.object(host.Host, "get_capabilities")): ++ ++- drvr.init_host("wibble") ++ self.assertRaises(exception.HypervisorUnavailable, ++- drvr.get_num_instances) +++ drvr.init_host, ("wibble",)) ++ self.assertTrue(service_mock.disabled) ++ ++ def test_service_resume_after_broken_connection(self): ++diff --git a/nova/tests/unit/virt/libvirt/test_utils.py b/nova/tests/unit/virt/libvirt/test_utils.py ++index 646a72c8599..49945a3cd3b 100644 ++--- a/nova/tests/unit/virt/libvirt/test_utils.py +++++ b/nova/tests/unit/virt/libvirt/test_utils.py ++@@ -173,6 +173,31 @@ def test_qemu_info_canon(self, mock_execute, mock_exists): ++ ++ @mock.patch('os.path.exists', return_value=True) ++ @mock.patch('nova.utils.execute') +++ def test_qemu_info_canon_qemu_2_10(self, mock_execute, mock_exists): +++ images.QEMU_VERSION = images.QEMU_VERSION_REQ_SHARED +++ path = "disk.config" +++ example_output = """image: disk.config +++file format: raw +++virtual size: 64M (67108864 bytes) +++cluster_size: 65536 +++disk size: 96K +++blah BLAH: bb +++""" +++ mock_execute.return_value = (example_output, '') +++ image_info = images.qemu_img_info(path) +++ mock_execute.assert_called_once_with('env', 'LC_ALL=C', 'LANG=C', +++ 'qemu-img', 'info', path, +++ '--force-share', +++ prlimit=images.QEMU_IMG_LIMITS) +++ mock_exists.assert_called_once_with(path) +++ self.assertEqual('disk.config', image_info.image) +++ self.assertEqual('raw', image_info.file_format) +++ self.assertEqual(67108864, image_info.virtual_size) +++ self.assertEqual(98304, image_info.disk_size) +++ self.assertEqual(65536, image_info.cluster_size) +++ +++ @mock.patch('os.path.exists', return_value=True) +++ @mock.patch('nova.utils.execute') ++ def test_qemu_info_canon2(self, mock_execute, mock_exists): ++ path = "disk.config" ++ example_output = """image: disk.config ++diff --git a/nova/virt/images.py b/nova/virt/images.py ++index dae6bc7ef52..be2a9d9e062 100644 ++--- a/nova/virt/images.py +++++ b/nova/virt/images.py ++@@ -19,6 +19,7 @@ ++ Handling of VM disk images. ++ """ ++ +++import operator ++ import os ++ ++ from oslo_concurrency import processutils ++@@ -42,6 +43,11 @@ ++ cpu_time=8, ++ address_space=1 * units.Gi) ++ +++# This is set by the libvirt driver on startup. The version is used to +++# determine what flags need to be set on the command line. +++QEMU_VERSION = None +++QEMU_VERSION_REQ_SHARED = 2010000 +++ ++ ++ def qemu_img_info(path, format=None): ++ """Return an object containing the parsed output from qemu-img info.""" ++@@ -60,6 +66,10 @@ def qemu_img_info(path, format=None): ++ cmd = ('env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', path) ++ if format is not None: ++ cmd = cmd + ('-f', format) +++ # Check to see if the qemu version is >= 2.10 because if so, we need +++ # to add the --force-share flag. +++ if QEMU_VERSION and operator.ge(QEMU_VERSION, QEMU_VERSION_REQ_SHARED): +++ cmd = cmd + ('--force-share',) ++ out, err = utils.execute(*cmd, prlimit=QEMU_IMG_LIMITS) ++ except processutils.ProcessExecutionError as exp: ++ # this means we hit prlimits, make the exception more specific ++diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py ++index 82dc2b99f6a..8d4eb90ecf5 100644 ++--- a/nova/virt/libvirt/driver.py +++++ b/nova/virt/libvirt/driver.py ++@@ -481,11 +481,15 @@ def init_host(self, host): ++ _('Nova requires libvirt version %s or greater.') % ++ self._version_to_string(MIN_LIBVIRT_VERSION)) ++ ++- if (CONF.libvirt.virt_type in ("qemu", "kvm") and ++- not self._host.has_min_version(hv_ver=MIN_QEMU_VERSION)): ++- raise exception.InternalError( ++- _('Nova requires QEMU version %s or greater.') % ++- self._version_to_string(MIN_QEMU_VERSION)) +++ if CONF.libvirt.virt_type in ("qemu", "kvm"): +++ if self._host.has_min_version(hv_ver=MIN_QEMU_VERSION): +++ # "qemu-img info" calls are version dependent, so we need to +++ # store the version in the images module. +++ images.QEMU_VERSION = self._host.get_connection().getVersion() +++ else: +++ raise exception.InternalError( +++ _('Nova requires QEMU version %s or greater.') % +++ self._version_to_string(MIN_QEMU_VERSION)) ++ ++ if CONF.libvirt.virt_type == 'parallels': ++ if not self._host.has_min_version(hv_ver=MIN_VIRTUOZZO_VERSION): ++-- ++ ++From: Stanislaw Kardach ++Date: Tue, 22 Mar 2016 12:05:09 +0100 ++Subject: [PATCH] nova: Update console defaults for armv7, aarch64 ++ ++Nova hardcodes default options for serial console. ++For armv7 and aarch64 direct kernel boot, adding console=ttyAMA0 is ++a nice UX addition. ++ ++Signed-off-by: Stanislaw Kardach ++Signed-off-by: Alexandru Avadanii ++Signed-off-by: Guillermo Herrero ++ ++--- ++ ++diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py ++--- a/nova/virt/libvirt/driver.py +++++ b/nova/virt/libvirt/driver.py ++@@ -4179,7 +4179,12 @@ class LibvirtDriver(driver.ComputeDriver): ++ if virt_type == "xen": ++ guest.os_cmdline = "ro root=%s" % root_device_name ++ else: +++ guestarch = libvirt_utils.get_arch(image_meta) ++ guest.os_cmdline = ("root=%s %s" % (root_device_name, CONSOLE)) +++ if guestarch in (fields.Architecture.ARMV7, +++ fields.Architecture.AARCH64): +++ # NOTE(armband): ARM v7/v8 use PL011 drv, add ttyAMA0 console +++ guest.os_cmdline += " console=ttyAMA0" ++ if virt_type == "qemu": ++ guest.os_cmdline += " no_timer_check" ++ if instance.ramdisk_id: ++-- ++ ++From: Alexandru Avadanii ++Date: Thu, 24 Aug 2017 10:57:28 +0200 ++Subject: [PATCH] libvirt: AArch64: ACPI depends on AAVMF ++ ++On AArch64, ACPI should be added to domain XML only if guest UEFI ++(AAVMF) is also used. ++ ++Signed-off-by: Alexandru Avadanii ++Signed-off-by: Ciprian Barbu ++ ++--- ++ ++diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py ++--- a/nova/virt/libvirt/driver.py +++++ b/nova/virt/libvirt/driver.py ++@@ -4255,7 +4255,7 @@ ++ tmhyperv.present = True ++ clk.add_timer(tmhyperv) ++ ++- def _set_features(self, guest, os_type, caps, virt_type): +++ def _set_features(self, guest, os_type, image_meta, caps, virt_type): ++ if virt_type == "xen": ++ # PAE only makes sense in X86 ++ if caps.host.cpu.arch in (fields.Architecture.I686, ++@@ -4264,7 +4264,10 @@ ++ ++ if (virt_type not in ("lxc", "uml", "parallels", "xen") or ++ (virt_type == "xen" and guest.os_type == fields.VMMode.HVM)): ++- guest.features.append(vconfig.LibvirtConfigGuestFeatureACPI()) +++ guestarch = libvirt_utils.get_arch(image_meta) +++ if (guestarch not in (fields.Architecture.ARMV7, fields.Architecture.AARCH64) or +++ image_meta.properties.get('hw_firmware_type') == 'uefi'): +++ guest.features.append(vconfig.LibvirtConfigGuestFeatureACPI()) ++ guest.features.append(vconfig.LibvirtConfigGuestFeatureAPIC()) ++ ++ if (virt_type in ("qemu", "kvm") and ++@@ -4799,7 +4802,7 @@ ++ self._conf_non_lxc_uml(virt_type, guest, root_device_name, rescue, ++ instance, inst_path, image_meta, disk_info) ++ ++- self._set_features(guest, instance.os_type, caps, virt_type) +++ self._set_features(guest, instance.os_type, image_meta, caps, virt_type) ++ self._set_clock(guest, instance.os_type, image_meta, virt_type) ++ ++ storage_configs = self._get_guest_storage_config( ++-- ++ ++From f0f09530ee9169eb29bc28d4f118676d7dc6640e Mon Sep 17 00:00:00 2001 ++From: Kevin Zhao ++Date: Tue, 15 Aug 2017 09:52:09 +0000 ++Subject: [PATCH] Add video type virtio for AArch64 ++ ++Currently only "virtio" type is supported on AArch64, and the ++other "virrus", "qxl" and "vga" don't work on AArch64 according to ++libvirt upstream: ++https://www.redhat.com/archives/libvir-list/2016-September/msg00546.html ++Then this patch adds the virtio for AArch64 and tweaks the related test cases. ++ ++Closes-bug: #1710766 ++ ++[ Alexandru.Avadanii@enea.com ] ++Dropped test changes so it applies cleanly on Newton without more backports. ++ ++Change-Id: Iba8a1e671f2b5759b3d9178aa1871d0cf888b26b ++Signed-off-by: Kevin Zhao ++Signed-off-by: Alexandru Avadanii ++--- ++ ++--- a/nova/virt/libvirt/driver.py +++++ b/nova/virt/libvirt/driver.py ++@@ -4342,7 +4342,8 @@ def _check_number_of_serial_console(self, num_ports): ++ allowed=ALLOWED_QEMU_SERIAL_PORTS, virt_type=virt_type) ++ ++ def _add_video_driver(self, guest, image_meta, flavor): ++- VALID_VIDEO_DEVICES = ("vga", "cirrus", "vmvga", "xen", "qxl") +++ VALID_VIDEO_DEVICES = ("vga", "cirrus", "vmvga", +++ "xen", "qxl", "virtio") ++ video = vconfig.LibvirtConfigGuestVideo() ++ # NOTE(ldbragst): The following logic sets the video.type ++ # depending on supported defaults given the architecture, ++@@ -4360,6 +4361,10 @@ def _add_video_driver(self, guest, image_meta, flavor): ++ # NOTE(ldbragst): PowerKVM doesn't support 'cirrus' be default ++ # so use 'vga' instead when running on Power hardware. ++ video.type = 'vga' +++ elif guestarch in (fields.Architecture.AARCH64): +++ # NOTE(kevinz): Only virtio device type is supported by AARCH64 +++ # so use 'virtio' instead when running on AArch64 hardware. +++ video.type = 'virtio' ++ elif CONF.spice.enabled: ++ video.type = 'qxl' ++ if image_meta.properties.get('hw_video_model'): +diff --git a/mcp/salt-formulas/armband/init.sls b/mcp/salt-formulas/armband/init.sls +new file mode 100644 +index 0000000..8a8cf2a +--- /dev/null ++++ b/mcp/salt-formulas/armband/init.sls +@@ -0,0 +1,7 @@ ++include: ++ - armband.qemu_efi ++ - armband.vgabios ++ {%- if salt['pkg.version']('python-nova') %} ++ - armband.nova_libvirt ++ - armband.nova_config ++ {%- endif %} +diff --git a/mcp/salt-formulas/armband/nova_config.sls b/mcp/salt-formulas/armband/nova_config.sls +new file mode 100644 +index 0000000..674f371 +--- /dev/null ++++ b/mcp/salt-formulas/armband/nova_config.sls +@@ -0,0 +1,30 @@ ++{% if grains['virtual'] == 'kvm' %} ++nova_virt_type: ++ file.replace: ++ - name: "/etc/nova/nova.conf" ++ - pattern: '^virt_type\s*=.*$' ++ - repl: "virt_type = qemu" ++{% endif %} ++nova_pointer_model: ++ file.replace: ++ - name: "/etc/nova/nova.conf" ++ - pattern: '^#pointer_model\s*=.*$' ++ - repl: "pointer_model = ps2mouse" ++nova_cpu_mode: ++ file.replace: ++ - name: "/etc/nova/nova.conf" ++ - pattern: '^cpu_mode\s*=\s*host-passthrough' ++ - repl: "cpu_mode = custom" ++nova_cpu_model: ++ file.replace: ++ - name: "/etc/nova/nova.conf" ++ - pattern: '^#cpu_model\s*=.*$' ++ {% if grains['virtual'] == 'kvm' %} ++ - repl: "cpu_model = cortex-a57" ++ {% else %} ++ - repl: "cpu_model = host" ++ {% endif %} ++restart_nova-compute: ++ cmd: ++ - run ++ - name: "service nova-compute restart" +diff --git a/mcp/salt-formulas/armband/nova_libvirt.sls b/mcp/salt-formulas/armband/nova_libvirt.sls +new file mode 100644 +index 0000000..bc2cbda +--- /dev/null ++++ b/mcp/salt-formulas/armband/nova_libvirt.sls +@@ -0,0 +1,7 @@ ++nova-libvirt-aarch64-rollup: ++ file.patch: ++ - name: /usr/lib/python2.7/dist-packages ++ - source: salt://armband/files/nova-libvirt-aarch64-rollup.diff ++ - hash: False ++ - options: '-p1' ++ - unless: 'test -f /var/cache/salt/minion/files/base/armband/files/nova-libvirt-aarch64-rollup.diff && cd /usr/lib/python2.7/dist-packages && patch -p1 -R --dry-run /var/cache/salt/minion/files/base/armband/files/nova-libvirt-aarch64-rollup.diff' +diff --git a/mcp/salt-formulas/armband/qemu_efi.sls b/mcp/salt-formulas/armband/qemu_efi.sls +new file mode 100644 +index 0000000..c697dae +--- /dev/null ++++ b/mcp/salt-formulas/armband/qemu_efi.sls +@@ -0,0 +1,2 @@ ++qemu-efi: ++ pkg.installed +diff --git a/mcp/salt-formulas/armband/vgabios.sls b/mcp/salt-formulas/armband/vgabios.sls +new file mode 100644 +index 0000000..500c2bc +--- /dev/null ++++ b/mcp/salt-formulas/armband/vgabios.sls +@@ -0,0 +1,7 @@ ++vgabios: ++ pkg.installed ++/usr/share/qemu: ++ file.directory ++/usr/share/qemu/vgabios-stdvga.bin: ++ file.symlink: ++ - target: "/usr/share/vgabios/vgabios.bin" diff --git a/patches/opnfv-fuel/0003-mcp-salt-formulas-opendaylight-AArch64-leveldb.patch b/patches/opnfv-fuel/0003-mcp-salt-formulas-opendaylight-AArch64-leveldb.patch deleted file mode 100644 index af8e35ef..00000000 --- a/patches/opnfv-fuel/0003-mcp-salt-formulas-opendaylight-AArch64-leveldb.patch +++ /dev/null @@ -1,48 +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: Thu, 27 Jul 2017 23:42:29 +0200 -Subject: [PATCH] mcp: salt-formulas: opendaylight: AArch64 leveldb - -ODL requires native leveldbjni support on architectures like AArch64. -Armband provides a Debian package that provides exactly that, -specially tailored to be applied on top of upstream Opendaylight -Debian package. - -Install as part of the existing Opendaylight -salt-formula (and not as part of Armband's separate salt-formula, like -previous fixups). - -Some dependencies are not self-contained in this formula yet, and -should be handled before upstreaming this patch: -- Armband DEB repository (mcp-repos) is added by "openstack" state; -- only Debian systems are supported (no equivalent RPM provided); -- only systemd is supported (unlikely to change); - -JIRA: https://jira.opnfv.org/browse/ARMBAND-283 - -Signed-off-by: Alexandru Avadanii ---- - mcp/salt-formulas/opendaylight/server.sls | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/mcp/salt-formulas/opendaylight/server.sls b/mcp/salt-formulas/opendaylight/server.sls -index 5de4eee..4bf81a9 100644 ---- a/mcp/salt-formulas/opendaylight/server.sls -+++ b/mcp/salt-formulas/opendaylight/server.sls -@@ -72,4 +72,9 @@ opendaylight: - - service: opendaylight - {%- endif %} - -+opendaylight_aarch64_leveldbjni: -+ pkg.installed: -+ {% if grains['cpuarch'] == 'aarch64'%} -+ - name: armband-odl-leveldb-fix -+ {% endif %} - {%- endif %} diff --git a/patches/opnfv-fuel/0003-network-public-Use-arm-virtual2-POD-config.patch b/patches/opnfv-fuel/0003-network-public-Use-arm-virtual2-POD-config.patch new file mode 100644 index 00000000..1dc8f99b --- /dev/null +++ b/patches/opnfv-fuel/0003-network-public-Use-arm-virtual2-POD-config.patch @@ -0,0 +1,109 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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: Tue, 18 Jul 2017 19:17:24 +0200 +Subject: [PATCH] network: public: Use arm-virtual2 POD config + +grep -e "10\.16\.0\." -R . -l | \ + xargs sed -i \ + -e 's/10\.16\.0\./10.0.9./g' \ + -e 's/10\.0\.9\.254/10.0.9.200/g' \ + -e 's/10\.0\.9\.1/10.0.9.254/g' + +NOTE: This should be converted into a dynamic configuration read from +the universal POD descriptor in securedlab, once that is ready. + +Until then, just align the public network configuration used by the +virtual POD with the Enea lab configuration specific to arm-virtual2 +(i.e. public network on 10.0.9.0/24). + +NOTE: Replace the gateway at 10.16.0.1 (now 10.0.9.1) with the same +IP address as our lab's gateway (10.0.9.254), to keep both possible +network layouts in sync (using all virtual networks created via +virsh, respectively our lab's static config). +This will ensure deploys continue to work in both enviroments. + +Also, since our new gateway resides at 10.0.9.254, trim the DHCP pool +range for the public network to not include that address. + +Signed-off-by: Alexandru Avadanii +--- + mcp/config/states/networks | 6 +++--- + .../classes/cluster/virtual-mcp-ocata-common/infra/config.yml | 6 +++--- + .../classes/cluster/virtual-mcp-ocata-common/openstack_init.yml | 2 +- + mcp/scripts/net_public.xml | 2 +- + 4 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/mcp/config/states/networks b/mcp/config/states/networks +index d4735ad..e566903 100755 +--- a/mcp/config/states/networks ++++ b/mcp/config/states/networks +@@ -18,7 +18,7 @@ PUBLIC_NET=$(salt --out yaml 'cmp*' pillar.get _param:external_address | \ + pillar.get _param:openstack_compute_node01_external_address | \ + awk --re-interval '/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/{print $2; exit}') + +-[ -n "${PUBLIC_NET}" ] && PUBLIC_NET="${PUBLIC_NET%.*}.0/24" || PUBLIC_NET="10.16.0.0/24" ++[ -n "${PUBLIC_NET}" ] && PUBLIC_NET="${PUBLIC_NET%.*}.0/24" || PUBLIC_NET="10.0.9.0/24" + + salt 'ctl01*' cmd.run ". /root/keystonercv3; \ + openstack compute service list; \ +@@ -29,6 +29,6 @@ salt 'ctl01*' cmd.run ". /root/keystonercv3; \ + openstack network create --external --default --provider-network-type flat \ + --provider-physical-network physnet1 floating_net" + salt 'ctl01*' cmd.run ". /root/keystonercv3; \ +- openstack subnet create --gateway ${PUBLIC_NET%.*}.1 --no-dhcp \ +- --allocation-pool start=${PUBLIC_NET%.*}.130,end=${PUBLIC_NET%.*}.254 \ ++ openstack subnet create --gateway ${PUBLIC_NET%.*}.254 --no-dhcp \ ++ --allocation-pool start=${PUBLIC_NET%.*}.130,end=${PUBLIC_NET%.*}.200 \ + --network floating_net --subnet-range ${PUBLIC_NET} floating_subnet" +diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml +index 3c3d526..e114ec2 100644 +--- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml ++++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml +@@ -61,13 +61,13 @@ parameters: + params: + single_address: 172.16.10.105 + tenant_address: 10.1.0.105 +- external_address: 10.16.0.105 ++ external_address: 10.0.9.105 + openstack_compute_node02: + params: + single_address: 172.16.10.106 + tenant_address: 10.1.0.106 +- external_address: 10.16.0.106 ++ external_address: 10.0.9.106 + openstack_gateway_node01: + params: + tenant_address: 10.1.0.110 +- external_address: 10.16.0.110 ++ external_address: 10.0.9.110 +diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_init.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_init.yml +index 81f050f..b304c28 100644 +--- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_init.yml ++++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_init.yml +@@ -14,7 +14,7 @@ parameters: + openstack_region: RegionOne + admin_email: root@localhost + cluster_public_protocol: http +- cluster_public_host: 10.16.0.101 ++ cluster_public_host: 10.0.9.101 + neutron_public_protocol: http + neutron_control_dvr: 'False' + neutron_l3_ha: 'False' +diff --git a/mcp/scripts/net_public.xml b/mcp/scripts/net_public.xml +index d6df4aa..87f3146 100644 +--- a/mcp/scripts/net_public.xml ++++ b/mcp/scripts/net_public.xml +@@ -10,5 +10,5 @@ + public + + +- ++ + diff --git a/patches/opnfv-fuel/0004-maas-Add-curtin_userdata_arm64_generic_xenial.patch b/patches/opnfv-fuel/0004-maas-Add-curtin_userdata_arm64_generic_xenial.patch deleted file mode 100644 index 3e17f899..00000000 --- a/patches/opnfv-fuel/0004-maas-Add-curtin_userdata_arm64_generic_xenial.patch +++ /dev/null @@ -1,160 +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: Mon, 7 Aug 2017 19:45:01 +0200 -Subject: [PATCH] maas: Add curtin_userdata_arm64_generic_xenial - -Add AArch64 specific configuration. - -Signed-off-by: Alexandru Avadanii ---- - ...-Add-curtin_userdata_arm64_generic_xenial.patch | 35 ++++++++++++++++++ - mcp/patches/patches.list | 1 + - .../baremetal-mcp-ocata-common/infra/maas.yml | 26 +++++++++++++ - .../files/curtin_userdata_arm64_generic_xenial | 43 ++++++++++++++++++++++ - 4 files changed, 105 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 - -diff --git a/mcp/patches/0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch b/mcp/patches/0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch -new file mode 100644 -index 0000000..0368937 ---- /dev/null -+++ b/mcp/patches/0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch -@@ -0,0 +1,35 @@ -+From: Alexandru Avadanii -+Date: Sat, 5 Aug 2017 02:03:01 +0200 -+Subject: [PATCH] maas: Add curtin_userdata_arm64_generic_xenial -+ -+Based on curtin_userdata_amd64_generic_xenial, add new arm64 -+specific configuration file: -+- curtin_userdata_arm64_generic_xenial -+ -+Requires Salt repo key and repo URL to be defined via reclass. -+ -+Signed-off-by: Alexandru Avadanii -+--- -+ -+diff --git a/maas/region.sls b/maas/region.sls -+--- a/maas/region.sls -++++ b/maas/region.sls -+@@ -70,6 +70,18 @@ -+ - require: -+ - pkg: maas_region_packages -+ -++/etc/maas/preseeds/curtin_userdata_arm64_generic_xenial: -++ file.managed: -++ - source: salt://maas/files/curtin_userdata_arm64_generic_xenial -++ - template: jinja -++ - user: root -++ - group: root -++ - mode: 644 -++ - context: -++ salt_master_ip: {{ region.salt_master_ip }} -++ - require: -++ - pkg: maas_region_packages -++ -+ /root/.pgpass: -+ file.managed: -+ - source: salt://maas/files/pgpass -diff --git a/mcp/patches/patches.list b/mcp/patches/patches.list -index 6358109..4f6cc56 100644 ---- a/mcp/patches/patches.list -+++ b/mcp/patches/patches.list -@@ -18,3 +18,4 @@ - /usr/share/salt-formulas/reclass: 0011-service.horizon.server.cluster-Default-to-v2-API.patch - /usr/share/salt-formulas/env: 0012-linux.storage.lvm-Disable-filter.patch - /usr/share/salt-formulas/env: 0013-maas-region-Allow-subnets-without-fabrics.patch -+/usr/share/salt-formulas/env: 0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch -diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/maas.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/maas.yml -index e8c2965..b15f9cb 100644 ---- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/maas.yml -+++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/maas.yml -@@ -110,6 +110,32 @@ parameters: - architecture: ${_param:opnfv_maas_node05_architecture} - distro_series: xenial - hwe_kernel: hwe-16.04 -+ cluster: -+ enabled: true -+ region: -+ port: 80 -+ host: localhost -+ saltstack_repo_key_arm64: | -+ -----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: -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 ---- /dev/null -+++ b/mcp/salt-formulas/maas/files/curtin_userdata_arm64_generic_xenial -@@ -0,0 +1,43 @@ -+{%- from "maas/map.jinja" import cluster with context %} -+{% raw %} -+#cloud-config -+debconf_selections: -+ maas: | -+ {{for line in str(curtin_preseed).splitlines()}} -+ {{line}} -+ {{endfor}} -+{{if third_party_drivers and driver}} -+early_commands: -+ {{py: key_string = ''.join(['\\x%x' % x for x in map(ord, driver['key_binary'])])}} -+ driver_00_get_key: /bin/echo -en '{{key_string}}' > /tmp/maas-{{driver['package']}}.gpg -+ driver_01_add_key: ["apt-key", "add", "/tmp/maas-{{driver['package']}}.gpg"] -+ driver_02_add: ["add-apt-repository", "-y", "deb {{driver['repository']}} {{node.get_distro_series()}} main"] -+ driver_03_update_install: ["sh", "-c", "apt-get update --quiet && apt-get --assume-yes install {{driver['package']}}"] -+ driver_04_load: ["sh", "-c", "depmod && modprobe {{driver['module']}}"] -+{{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}}"] -+ salt_03_hostname_get: ["curtin", "in-target", "--", "sh", "-c", "echo 'id: {% raw %}{{node.hostname}}{% endraw %}.{{pillar.linux.system.domain}}' >> /etc/salt/minion"] -+ salt_04_master: ["curtin", "in-target", "--", "sh", "-c", "echo 'master: {{ salt_master_ip }}' >> /etc/salt/minion"] -+{% 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" -+ driver_02_key_add: ["curtin", "in-target", "--", "apt-key", "add", "/tmp/maas-{{driver['package']}}.gpg"] -+ driver_03_add: ["curtin", "in-target", "--", "add-apt-repository", "-y", "deb {{driver['repository']}} {{node.get_distro_series()}} main"] -+ driver_04_update_install: ["curtin", "in-target", "--", "apt-get", "update", "--quiet"] -+ driver_05_install: ["curtin", "in-target", "--", "apt-get", "-y", "install", "{{driver['package']}}"] -+ driver_06_depmod: ["curtin", "in-target", "--", "depmod"] -+ driver_07_update_initramfs: ["curtin", "in-target", "--", "update-initramfs", "-u"] -+{{endif}} -+{% endraw %} diff --git a/patches/opnfv-fuel/0004-mcp-salt-formulas-opendaylight-AArch64-leveldb.patch b/patches/opnfv-fuel/0004-mcp-salt-formulas-opendaylight-AArch64-leveldb.patch new file mode 100644 index 00000000..af8e35ef --- /dev/null +++ b/patches/opnfv-fuel/0004-mcp-salt-formulas-opendaylight-AArch64-leveldb.patch @@ -0,0 +1,48 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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: Thu, 27 Jul 2017 23:42:29 +0200 +Subject: [PATCH] mcp: salt-formulas: opendaylight: AArch64 leveldb + +ODL requires native leveldbjni support on architectures like AArch64. +Armband provides a Debian package that provides exactly that, +specially tailored to be applied on top of upstream Opendaylight +Debian package. + +Install as part of the existing Opendaylight +salt-formula (and not as part of Armband's separate salt-formula, like +previous fixups). + +Some dependencies are not self-contained in this formula yet, and +should be handled before upstreaming this patch: +- Armband DEB repository (mcp-repos) is added by "openstack" state; +- only Debian systems are supported (no equivalent RPM provided); +- only systemd is supported (unlikely to change); + +JIRA: https://jira.opnfv.org/browse/ARMBAND-283 + +Signed-off-by: Alexandru Avadanii +--- + mcp/salt-formulas/opendaylight/server.sls | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/mcp/salt-formulas/opendaylight/server.sls b/mcp/salt-formulas/opendaylight/server.sls +index 5de4eee..4bf81a9 100644 +--- a/mcp/salt-formulas/opendaylight/server.sls ++++ b/mcp/salt-formulas/opendaylight/server.sls +@@ -72,4 +72,9 @@ opendaylight: + - service: opendaylight + {%- endif %} + ++opendaylight_aarch64_leveldbjni: ++ pkg.installed: ++ {% if grains['cpuarch'] == 'aarch64'%} ++ - name: armband-odl-leveldb-fix ++ {% endif %} + {%- endif %} 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 new file mode 100644 index 00000000..3e17f899 --- /dev/null +++ b/patches/opnfv-fuel/0005-maas-Add-curtin_userdata_arm64_generic_xenial.patch @@ -0,0 +1,160 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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: Mon, 7 Aug 2017 19:45:01 +0200 +Subject: [PATCH] maas: Add curtin_userdata_arm64_generic_xenial + +Add AArch64 specific configuration. + +Signed-off-by: Alexandru Avadanii +--- + ...-Add-curtin_userdata_arm64_generic_xenial.patch | 35 ++++++++++++++++++ + mcp/patches/patches.list | 1 + + .../baremetal-mcp-ocata-common/infra/maas.yml | 26 +++++++++++++ + .../files/curtin_userdata_arm64_generic_xenial | 43 ++++++++++++++++++++++ + 4 files changed, 105 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 + +diff --git a/mcp/patches/0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch b/mcp/patches/0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch +new file mode 100644 +index 0000000..0368937 +--- /dev/null ++++ b/mcp/patches/0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch +@@ -0,0 +1,35 @@ ++From: Alexandru Avadanii ++Date: Sat, 5 Aug 2017 02:03:01 +0200 ++Subject: [PATCH] maas: Add curtin_userdata_arm64_generic_xenial ++ ++Based on curtin_userdata_amd64_generic_xenial, add new arm64 ++specific configuration file: ++- curtin_userdata_arm64_generic_xenial ++ ++Requires Salt repo key and repo URL to be defined via reclass. ++ ++Signed-off-by: Alexandru Avadanii ++--- ++ ++diff --git a/maas/region.sls b/maas/region.sls ++--- a/maas/region.sls +++++ b/maas/region.sls ++@@ -70,6 +70,18 @@ ++ - require: ++ - pkg: maas_region_packages ++ +++/etc/maas/preseeds/curtin_userdata_arm64_generic_xenial: +++ file.managed: +++ - source: salt://maas/files/curtin_userdata_arm64_generic_xenial +++ - template: jinja +++ - user: root +++ - group: root +++ - mode: 644 +++ - context: +++ salt_master_ip: {{ region.salt_master_ip }} +++ - require: +++ - pkg: maas_region_packages +++ ++ /root/.pgpass: ++ file.managed: ++ - source: salt://maas/files/pgpass +diff --git a/mcp/patches/patches.list b/mcp/patches/patches.list +index 6358109..4f6cc56 100644 +--- a/mcp/patches/patches.list ++++ b/mcp/patches/patches.list +@@ -18,3 +18,4 @@ + /usr/share/salt-formulas/reclass: 0011-service.horizon.server.cluster-Default-to-v2-API.patch + /usr/share/salt-formulas/env: 0012-linux.storage.lvm-Disable-filter.patch + /usr/share/salt-formulas/env: 0013-maas-region-Allow-subnets-without-fabrics.patch ++/usr/share/salt-formulas/env: 0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/maas.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/maas.yml +index e8c2965..b15f9cb 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/maas.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/maas.yml +@@ -110,6 +110,32 @@ parameters: + architecture: ${_param:opnfv_maas_node05_architecture} + distro_series: xenial + hwe_kernel: hwe-16.04 ++ cluster: ++ enabled: true ++ region: ++ port: 80 ++ host: localhost ++ saltstack_repo_key_arm64: | ++ -----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: +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 +--- /dev/null ++++ b/mcp/salt-formulas/maas/files/curtin_userdata_arm64_generic_xenial +@@ -0,0 +1,43 @@ ++{%- from "maas/map.jinja" import cluster with context %} ++{% raw %} ++#cloud-config ++debconf_selections: ++ maas: | ++ {{for line in str(curtin_preseed).splitlines()}} ++ {{line}} ++ {{endfor}} ++{{if third_party_drivers and driver}} ++early_commands: ++ {{py: key_string = ''.join(['\\x%x' % x for x in map(ord, driver['key_binary'])])}} ++ driver_00_get_key: /bin/echo -en '{{key_string}}' > /tmp/maas-{{driver['package']}}.gpg ++ driver_01_add_key: ["apt-key", "add", "/tmp/maas-{{driver['package']}}.gpg"] ++ driver_02_add: ["add-apt-repository", "-y", "deb {{driver['repository']}} {{node.get_distro_series()}} main"] ++ driver_03_update_install: ["sh", "-c", "apt-get update --quiet && apt-get --assume-yes install {{driver['package']}}"] ++ driver_04_load: ["sh", "-c", "depmod && modprobe {{driver['module']}}"] ++{{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}}"] ++ salt_03_hostname_get: ["curtin", "in-target", "--", "sh", "-c", "echo 'id: {% raw %}{{node.hostname}}{% endraw %}.{{pillar.linux.system.domain}}' >> /etc/salt/minion"] ++ salt_04_master: ["curtin", "in-target", "--", "sh", "-c", "echo 'master: {{ salt_master_ip }}' >> /etc/salt/minion"] ++{% 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" ++ driver_02_key_add: ["curtin", "in-target", "--", "apt-key", "add", "/tmp/maas-{{driver['package']}}.gpg"] ++ driver_03_add: ["curtin", "in-target", "--", "add-apt-repository", "-y", "deb {{driver['repository']}} {{node.get_distro_series()}} main"] ++ driver_04_update_install: ["curtin", "in-target", "--", "apt-get", "update", "--quiet"] ++ driver_05_install: ["curtin", "in-target", "--", "apt-get", "-y", "install", "{{driver['package']}}"] ++ driver_06_depmod: ["curtin", "in-target", "--", "depmod"] ++ driver_07_update_initramfs: ["curtin", "in-target", "--", "update-initramfs", "-u"] ++{{endif}} ++{% endraw %} diff --git a/patches/opnfv-fuel/0005-maas-boot-resources-Add-arm64-architecture.patch b/patches/opnfv-fuel/0005-maas-boot-resources-Add-arm64-architecture.patch deleted file mode 100644 index 91e13434..00000000 --- a/patches/opnfv-fuel/0005-maas-boot-resources-Add-arm64-architecture.patch +++ /dev/null @@ -1,39 +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, 11 Aug 2017 00:07:29 +0200 -Subject: [PATCH] maas: boot-resources: Add arm64 architecture - -Signed-off-by: Alexandru Avadanii ---- - mcp/patches/0003-maas-region-force-artifact-download.patch | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/mcp/patches/0003-maas-region-force-artifact-download.patch b/mcp/patches/0003-maas-region-force-artifact-download.patch -index ecda80a..a8d27d7 100644 ---- a/mcp/patches/0003-maas-region-force-artifact-download.patch -+++ b/mcp/patches/0003-maas-region-force-artifact-download.patch -@@ -50,7 +50,7 @@ diff --git a/maas/files/maas-artifact-sync.sh b/maas/files/maas-artifact-sync.sh - new file mode 100644 - --- /dev/null - +++ b/maas/files/maas-artifact-sync.sh --@@ -0,0 +1,21 @@ -+@@ -0,0 +1,26 @@ - +{%- from "maas/map.jinja" import region with context %} - +#!/bin/bash - +function wait_for { -@@ -72,3 +72,8 @@ new file mode 100644 - +wait_for 90 "! maas opnfv boot-resources is-importing | grep -q 'true'" - +maas opnfv rack-controllers import-boot-images || exit 3 - +wait_for 30 "test -d /var/lib/maas/boot-resources/current/ubuntu/amd64" -++maas opnfv boot-source-selection update 1 1 arches='amd64' arches='arm64' || exit 4 -++maas opnfv boot-resources import || exit 2 -++wait_for 90 "! maas opnfv boot-resources is-importing | grep -q 'true'" -++maas opnfv rack-controllers import-boot-images || exit 3 -++wait_for 30 "test -d /var/lib/maas/boot-resources/current/ubuntu/arm64" diff --git a/patches/opnfv-fuel/0006-libvirt-Use-libvirt-unix_sock_group.patch b/patches/opnfv-fuel/0006-libvirt-Use-libvirt-unix_sock_group.patch deleted file mode 100644 index 581cd71f..00000000 --- a/patches/opnfv-fuel/0006-libvirt-Use-libvirt-unix_sock_group.patch +++ /dev/null @@ -1,58 +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, 20 Aug 2017 18:18:53 +0200 -Subject: [PATCH] libvirt: Use "libvirt" unix_sock_group - -On AArch64, libvirt 3.x is used, which uses "libvirt" by default, -so change old "libvirtd" in . - -Signed-off-by: Alexandru Avadanii ---- - ...libvirt-unix_sock_group-s-libvirtd-libvirt.patch | 21 +++++++++++++++++++++ - mcp/patches/patches.list | 1 + - 2 files changed, 22 insertions(+) - create mode 100644 mcp/patches/0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch - -diff --git a/mcp/patches/0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch b/mcp/patches/0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch -new file mode 100644 -index 0000000..003b249 ---- /dev/null -+++ b/mcp/patches/0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch -@@ -0,0 +1,21 @@ -+From: Alexandru Avadanii -+Date: Sun, 20 Aug 2017 02:03:01 +0200 -+Subject: [PATCH] libvirt: unix_sock_group: s/libvirtd/libvirt/ -+ -+On AArch64, libvirt 3.x is used, which uses "libvirt" by default. -+ -+Signed-off-by: Alexandru Avadanii -+--- -+ -+diff --git a/libvirt/files/libvirtd.conf.Debian b/libvirt/files/libvirtd.conf.Debian -+--- a/libvirt/files/libvirtd.conf.Debian -++++ b/libvirt/files/libvirtd.conf.Debian -+@@ -81,7 +81,7 @@ -+ # without becoming root. -+ # -+ # This is restricted to 'root' by default. -+-unix_sock_group = "libvirtd" -++unix_sock_group = "libvirt" -+ -+ # Set the UNIX socket permissions for the R/O socket. This is used -+ # for monitoring VM status only -diff --git a/mcp/patches/patches.list b/mcp/patches/patches.list -index 4f6cc56..688a9af 100644 ---- a/mcp/patches/patches.list -+++ b/mcp/patches/patches.list -@@ -19,3 +19,4 @@ - /usr/share/salt-formulas/env: 0012-linux.storage.lvm-Disable-filter.patch - /usr/share/salt-formulas/env: 0013-maas-region-Allow-subnets-without-fabrics.patch - /usr/share/salt-formulas/env: 0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch -+/usr/share/salt-formulas/env: 0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch diff --git a/patches/opnfv-fuel/0006-maas-boot-resources-Add-arm64-architecture.patch b/patches/opnfv-fuel/0006-maas-boot-resources-Add-arm64-architecture.patch new file mode 100644 index 00000000..91e13434 --- /dev/null +++ b/patches/opnfv-fuel/0006-maas-boot-resources-Add-arm64-architecture.patch @@ -0,0 +1,39 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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, 11 Aug 2017 00:07:29 +0200 +Subject: [PATCH] maas: boot-resources: Add arm64 architecture + +Signed-off-by: Alexandru Avadanii +--- + mcp/patches/0003-maas-region-force-artifact-download.patch | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/mcp/patches/0003-maas-region-force-artifact-download.patch b/mcp/patches/0003-maas-region-force-artifact-download.patch +index ecda80a..a8d27d7 100644 +--- a/mcp/patches/0003-maas-region-force-artifact-download.patch ++++ b/mcp/patches/0003-maas-region-force-artifact-download.patch +@@ -50,7 +50,7 @@ diff --git a/maas/files/maas-artifact-sync.sh b/maas/files/maas-artifact-sync.sh + new file mode 100644 + --- /dev/null + +++ b/maas/files/maas-artifact-sync.sh +-@@ -0,0 +1,21 @@ ++@@ -0,0 +1,26 @@ + +{%- from "maas/map.jinja" import region with context %} + +#!/bin/bash + +function wait_for { +@@ -72,3 +72,8 @@ new file mode 100644 + +wait_for 90 "! maas opnfv boot-resources is-importing | grep -q 'true'" + +maas opnfv rack-controllers import-boot-images || exit 3 + +wait_for 30 "test -d /var/lib/maas/boot-resources/current/ubuntu/amd64" +++maas opnfv boot-source-selection update 1 1 arches='amd64' arches='arm64' || exit 4 +++maas opnfv boot-resources import || exit 2 +++wait_for 90 "! maas opnfv boot-resources is-importing | grep -q 'true'" +++maas opnfv rack-controllers import-boot-images || exit 3 +++wait_for 30 "test -d /var/lib/maas/boot-resources/current/ubuntu/arm64" diff --git a/patches/opnfv-fuel/0007-libvirt-Use-libvirt-unix_sock_group.patch b/patches/opnfv-fuel/0007-libvirt-Use-libvirt-unix_sock_group.patch new file mode 100644 index 00000000..581cd71f --- /dev/null +++ b/patches/opnfv-fuel/0007-libvirt-Use-libvirt-unix_sock_group.patch @@ -0,0 +1,58 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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, 20 Aug 2017 18:18:53 +0200 +Subject: [PATCH] libvirt: Use "libvirt" unix_sock_group + +On AArch64, libvirt 3.x is used, which uses "libvirt" by default, +so change old "libvirtd" in . + +Signed-off-by: Alexandru Avadanii +--- + ...libvirt-unix_sock_group-s-libvirtd-libvirt.patch | 21 +++++++++++++++++++++ + mcp/patches/patches.list | 1 + + 2 files changed, 22 insertions(+) + create mode 100644 mcp/patches/0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch + +diff --git a/mcp/patches/0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch b/mcp/patches/0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch +new file mode 100644 +index 0000000..003b249 +--- /dev/null ++++ b/mcp/patches/0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch +@@ -0,0 +1,21 @@ ++From: Alexandru Avadanii ++Date: Sun, 20 Aug 2017 02:03:01 +0200 ++Subject: [PATCH] libvirt: unix_sock_group: s/libvirtd/libvirt/ ++ ++On AArch64, libvirt 3.x is used, which uses "libvirt" by default. ++ ++Signed-off-by: Alexandru Avadanii ++--- ++ ++diff --git a/libvirt/files/libvirtd.conf.Debian b/libvirt/files/libvirtd.conf.Debian ++--- a/libvirt/files/libvirtd.conf.Debian +++++ b/libvirt/files/libvirtd.conf.Debian ++@@ -81,7 +81,7 @@ ++ # without becoming root. ++ # ++ # This is restricted to 'root' by default. ++-unix_sock_group = "libvirtd" +++unix_sock_group = "libvirt" ++ ++ # Set the UNIX socket permissions for the R/O socket. This is used ++ # for monitoring VM status only +diff --git a/mcp/patches/patches.list b/mcp/patches/patches.list +index 4f6cc56..688a9af 100644 +--- a/mcp/patches/patches.list ++++ b/mcp/patches/patches.list +@@ -19,3 +19,4 @@ + /usr/share/salt-formulas/env: 0012-linux.storage.lvm-Disable-filter.patch + /usr/share/salt-formulas/env: 0013-maas-region-Allow-subnets-without-fabrics.patch + /usr/share/salt-formulas/env: 0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch ++/usr/share/salt-formulas/env: 0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch diff --git a/patches/opnfv-fuel/0007-mcp-salt-formulas-armband-Extend-libvirt_domain.patch b/patches/opnfv-fuel/0007-mcp-salt-formulas-armband-Extend-libvirt_domain.patch deleted file mode 100644 index 1ea8f5af..00000000 --- a/patches/opnfv-fuel/0007-mcp-salt-formulas-armband-Extend-libvirt_domain.patch +++ /dev/null @@ -1,174 +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, 20 Aug 2017 22:41:26 +0200 -Subject: [PATCH] mcp: salt-formulas: armband: Extend libvirt_domain - -Add new state in armband salt formula that: -* extends salt's virt libvirt_domain.jinja template with support for: - - hw_firmware_type; - - virt_machine_model; - - cpu_model; - These will later be leveraged via salt virt formula with AArch64 - specific values. -* to ensure compatibilty of `virt.purge` with NVRAM-enabled domains - at undefine time, pass down the proper flag to libvirt from virt.py. -* re-enable AArch64 bootstrap - Recent changes in salt bootstrap script from [1] whitelist a - fixed pool of known architectures. Add "arm64" to that list on the - fly, as part of `config.gather_bootstrap_script`. - NOTE: This change will be leveraged by passing a custom DEB repo to - the bootstrap script with `-R linux.enea.com/saltstack`. - -NOTE: After running this new state, salt-minion should be restarted -to pick up the changes, so we'll run it before rebooting kvm nodes. - -[1] http://bootstrap.saltstack.com - -Signed-off-by: Alexandru Avadanii ---- - mcp/config/states/virtual_control_plane | 1 + - .../armband/files/salt-minion-aarch64-rollup.diff | 101 +++++++++++++++++++++ - mcp/salt-formulas/armband/salt_minion.sls | 7 ++ - 3 files changed, 109 insertions(+) - create mode 100644 mcp/salt-formulas/armband/files/salt-minion-aarch64-rollup.diff - create mode 100644 mcp/salt-formulas/armband/salt_minion.sls - -diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane -index 99fb517..88a4488 100755 ---- a/mcp/config/states/virtual_control_plane -+++ b/mcp/config/states/virtual_control_plane -@@ -40,6 +40,7 @@ salt -C 'kvm*' pkg.install bridge-utils - salt -C 'kvm*' state.apply linux.network - salt -C 'cmp*' state.apply linux.system - salt -C 'cmp*' state.apply linux.network || true -+salt -C 'kvm*' state.apply armband.salt_minion || true - 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/mcp/salt-formulas/armband/files/salt-minion-aarch64-rollup.diff b/mcp/salt-formulas/armband/files/salt-minion-aarch64-rollup.diff -new file mode 100644 -index 0000000..9e74c24 ---- /dev/null -+++ b/mcp/salt-formulas/armband/files/salt-minion-aarch64-rollup.diff -@@ -0,0 +1,101 @@ -+From: Alexandru Avadanii -+Date: Sun Aug 20 18:18:53 2017 +0200 -+Subject: [PATCH] cloud.py: Allow AArch64 arch in salt bootstrap -+ -+Recent changes in salt bootstrap script from [1] whitelist a -+fixed pool of known architectures. Add "arm64" to that list on the -+fly, as part of `config.gather_bootstrap_script`. -+ -+NOTE: This change will be leveraged by passing a custom DEB repo to -+the bootstrap script with `-R linux.enea.com/saltstack`. -+ -+[1] http://bootstrap.saltstack.com -+ -+Signed-off-by: Alexandru Avadanii -+--- -+ -+diff --git a/salt/utils/cloud.py b/salt/utils/cloud.py -+--- a/salt/utils/cloud.py -++++ b/salt/utils/cloud.py -+@@ -2772,6 +2772,9 @@ -+ if not script_content: -+ raise ValueError('No content in bootstrap script !') -+ -++ # NOTE(armband): edit bootstrap script on the fly to allow AArch64 -++ script_content = script_content.replace('"amd64")', '"amd64"|"arm64")') -++ -+ # Get the path to the built-in deploy scripts directory -+ builtin_deploy_dir = os.path.join( -+ os.path.dirname(__file__), -+-- -+ -+From: Alexandru Avadanii -+Date: Sun Aug 20 18:18:53 2017 +0200 -+Subject: [PATCH] libvirt_domain.jinja: Add AArch64 support -+ -+Salt virt state relies on a Jinja template to create a libvirt -+XML definition for each new VM. -+This template needs to be extended with a few specific options -+for AArch64: -+- UEFI loader support (pflash); -+- custom machine model (e.g. 'virt-2.9'), since AArch64 defaults to -+ 'integratorcp'; -+- custom cpu model; -+ -+Allow all these to be parametrized from the salt virt formula, -+which we will also adapt to allow the params to be passed via our -+reclass model. -+ -+Signed-off-by: Alexandru Avadanii -+--- -+ -+diff --git a/salt/templates/virt/libvirt_domain.jinja b/salt/templates/virt/libvirt_domain.jinja -+--- a/salt/templates/virt/libvirt_domain.jinja -++++ b/salt/templates/virt/libvirt_domain.jinja -+@@ -3,11 +3,22 @@ -+ {{ cpu }} -+ {{ mem }} -+ -++ {% if custom_virt_machine %} -++ hvm -++ {% else %} -+ hvm -++ {% endif %} -++ {% if os_loader_type == 'pflash' %} -++ {{ os_loader }} -++ {{ os_loader_nvram }} -++ {% endif %} -+ {% for dev in boot_dev %} -+ -+ {% endfor %} -+ -++ {% if cpu_mode == 'custom' %} -++ -++ {% endif %} -+ -+ {% for diskname, disk in disks.items() %} -+ -+-- -+ -+From: Alexandru Avadanii -+Date: Sun Nov 19 02:18:53 2017 +0200 -+Subject: [PATCH] virt.py: undefine: NVRAM flag support -+ -+Signed-off-by: Alexandru Avadanii -+--- -+ -+diff --git a/salt/modules/virt.py b/salt/modules/virt.py -+--- a/salt/modules/virt.py -++++ b/salt/modules/virt.py -+@@ -1523,7 +1523,10 @@ -+ salt '*' virt.undefine -+ ''' -+ dom = _get_domain(vm_) -+- return dom.undefine() == 0 -++ try: -++ return dom.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_NVRAM) == 0 -++ except libvirt.libvirtError: -++ return dom.undefine() == 0 -+ -+ -+ def purge(vm_, dirs=False): -diff --git a/mcp/salt-formulas/armband/salt_minion.sls b/mcp/salt-formulas/armband/salt_minion.sls -new file mode 100644 -index 0000000..9cce636 ---- /dev/null -+++ b/mcp/salt-formulas/armband/salt_minion.sls -@@ -0,0 +1,7 @@ -+salt-minion-aarch64-rollup: -+ file.patch: -+ - name: /usr/lib/python2.7/dist-packages -+ - source: salt://armband/files/salt-minion-aarch64-rollup.diff -+ - hash: False -+ - options: '-p1' -+ - unless: 'test -f /var/cache/salt/minion/files/base/armband/files/salt-minion-aarch64-rollup.diff && cd /usr/lib/python2.7/dist-packages && patch -p1 -R --dry-run /var/cache/salt/minion/files/base/armband/files/salt-minion-aarch64-rollup.diff' diff --git a/patches/opnfv-fuel/0008-mcp-salt-formulas-armband-Extend-libvirt_domain.patch b/patches/opnfv-fuel/0008-mcp-salt-formulas-armband-Extend-libvirt_domain.patch new file mode 100644 index 00000000..1ea8f5af --- /dev/null +++ b/patches/opnfv-fuel/0008-mcp-salt-formulas-armband-Extend-libvirt_domain.patch @@ -0,0 +1,174 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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, 20 Aug 2017 22:41:26 +0200 +Subject: [PATCH] mcp: salt-formulas: armband: Extend libvirt_domain + +Add new state in armband salt formula that: +* extends salt's virt libvirt_domain.jinja template with support for: + - hw_firmware_type; + - virt_machine_model; + - cpu_model; + These will later be leveraged via salt virt formula with AArch64 + specific values. +* to ensure compatibilty of `virt.purge` with NVRAM-enabled domains + at undefine time, pass down the proper flag to libvirt from virt.py. +* re-enable AArch64 bootstrap + Recent changes in salt bootstrap script from [1] whitelist a + fixed pool of known architectures. Add "arm64" to that list on the + fly, as part of `config.gather_bootstrap_script`. + NOTE: This change will be leveraged by passing a custom DEB repo to + the bootstrap script with `-R linux.enea.com/saltstack`. + +NOTE: After running this new state, salt-minion should be restarted +to pick up the changes, so we'll run it before rebooting kvm nodes. + +[1] http://bootstrap.saltstack.com + +Signed-off-by: Alexandru Avadanii +--- + mcp/config/states/virtual_control_plane | 1 + + .../armband/files/salt-minion-aarch64-rollup.diff | 101 +++++++++++++++++++++ + mcp/salt-formulas/armband/salt_minion.sls | 7 ++ + 3 files changed, 109 insertions(+) + create mode 100644 mcp/salt-formulas/armband/files/salt-minion-aarch64-rollup.diff + create mode 100644 mcp/salt-formulas/armband/salt_minion.sls + +diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane +index 99fb517..88a4488 100755 +--- a/mcp/config/states/virtual_control_plane ++++ b/mcp/config/states/virtual_control_plane +@@ -40,6 +40,7 @@ salt -C 'kvm*' pkg.install bridge-utils + salt -C 'kvm*' state.apply linux.network + salt -C 'cmp*' state.apply linux.system + salt -C 'cmp*' state.apply linux.network || true ++salt -C 'kvm*' state.apply armband.salt_minion || true + 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/mcp/salt-formulas/armband/files/salt-minion-aarch64-rollup.diff b/mcp/salt-formulas/armband/files/salt-minion-aarch64-rollup.diff +new file mode 100644 +index 0000000..9e74c24 +--- /dev/null ++++ b/mcp/salt-formulas/armband/files/salt-minion-aarch64-rollup.diff +@@ -0,0 +1,101 @@ ++From: Alexandru Avadanii ++Date: Sun Aug 20 18:18:53 2017 +0200 ++Subject: [PATCH] cloud.py: Allow AArch64 arch in salt bootstrap ++ ++Recent changes in salt bootstrap script from [1] whitelist a ++fixed pool of known architectures. Add "arm64" to that list on the ++fly, as part of `config.gather_bootstrap_script`. ++ ++NOTE: This change will be leveraged by passing a custom DEB repo to ++the bootstrap script with `-R linux.enea.com/saltstack`. ++ ++[1] http://bootstrap.saltstack.com ++ ++Signed-off-by: Alexandru Avadanii ++--- ++ ++diff --git a/salt/utils/cloud.py b/salt/utils/cloud.py ++--- a/salt/utils/cloud.py +++++ b/salt/utils/cloud.py ++@@ -2772,6 +2772,9 @@ ++ if not script_content: ++ raise ValueError('No content in bootstrap script !') ++ +++ # NOTE(armband): edit bootstrap script on the fly to allow AArch64 +++ script_content = script_content.replace('"amd64")', '"amd64"|"arm64")') +++ ++ # Get the path to the built-in deploy scripts directory ++ builtin_deploy_dir = os.path.join( ++ os.path.dirname(__file__), ++-- ++ ++From: Alexandru Avadanii ++Date: Sun Aug 20 18:18:53 2017 +0200 ++Subject: [PATCH] libvirt_domain.jinja: Add AArch64 support ++ ++Salt virt state relies on a Jinja template to create a libvirt ++XML definition for each new VM. ++This template needs to be extended with a few specific options ++for AArch64: ++- UEFI loader support (pflash); ++- custom machine model (e.g. 'virt-2.9'), since AArch64 defaults to ++ 'integratorcp'; ++- custom cpu model; ++ ++Allow all these to be parametrized from the salt virt formula, ++which we will also adapt to allow the params to be passed via our ++reclass model. ++ ++Signed-off-by: Alexandru Avadanii ++--- ++ ++diff --git a/salt/templates/virt/libvirt_domain.jinja b/salt/templates/virt/libvirt_domain.jinja ++--- a/salt/templates/virt/libvirt_domain.jinja +++++ b/salt/templates/virt/libvirt_domain.jinja ++@@ -3,11 +3,22 @@ ++ {{ cpu }} ++ {{ mem }} ++ +++ {% if custom_virt_machine %} +++ hvm +++ {% else %} ++ hvm +++ {% endif %} +++ {% if os_loader_type == 'pflash' %} +++ {{ os_loader }} +++ {{ os_loader_nvram }} +++ {% endif %} ++ {% for dev in boot_dev %} ++ ++ {% endfor %} ++ +++ {% if cpu_mode == 'custom' %} +++ +++ {% endif %} ++ ++ {% for diskname, disk in disks.items() %} ++ ++-- ++ ++From: Alexandru Avadanii ++Date: Sun Nov 19 02:18:53 2017 +0200 ++Subject: [PATCH] virt.py: undefine: NVRAM flag support ++ ++Signed-off-by: Alexandru Avadanii ++--- ++ ++diff --git a/salt/modules/virt.py b/salt/modules/virt.py ++--- a/salt/modules/virt.py +++++ b/salt/modules/virt.py ++@@ -1523,7 +1523,10 @@ ++ salt '*' virt.undefine ++ ''' ++ dom = _get_domain(vm_) ++- return dom.undefine() == 0 +++ try: +++ return dom.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_NVRAM) == 0 +++ except libvirt.libvirtError: +++ return dom.undefine() == 0 ++ ++ ++ def purge(vm_, dirs=False): +diff --git a/mcp/salt-formulas/armband/salt_minion.sls b/mcp/salt-formulas/armband/salt_minion.sls +new file mode 100644 +index 0000000..9cce636 +--- /dev/null ++++ b/mcp/salt-formulas/armband/salt_minion.sls +@@ -0,0 +1,7 @@ ++salt-minion-aarch64-rollup: ++ file.patch: ++ - name: /usr/lib/python2.7/dist-packages ++ - source: salt://armband/files/salt-minion-aarch64-rollup.diff ++ - hash: False ++ - options: '-p1' ++ - unless: 'test -f /var/cache/salt/minion/files/base/armband/files/salt-minion-aarch64-rollup.diff && cd /usr/lib/python2.7/dist-packages && patch -p1 -R --dry-run /var/cache/salt/minion/files/base/armband/files/salt-minion-aarch64-rollup.diff' diff --git a/patches/opnfv-fuel/0008-virtng.py-virt.sls-Extend-libvirt_domain.patch b/patches/opnfv-fuel/0008-virtng.py-virt.sls-Extend-libvirt_domain.patch deleted file mode 100644 index 6b84b840..00000000 --- a/patches/opnfv-fuel/0008-virtng.py-virt.sls-Extend-libvirt_domain.patch +++ /dev/null @@ -1,223 +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: Mon, 21 Aug 2017 01:10:16 +0200 -Subject: [PATCH] virtng.py, virt.sls: Extend libvirt_domain - -Extend _modules/virtng.py, salt/control/virt.sls with support for: -- hw_firmware_type; -- virt_machine_model; -- cpu_model; - -This functionality relies on the corresponding changes to be -implemented in libvirt_domain.jinja template. - -These will later be leveraged via our reclass model with AArch64 -specific values. - -Signed-off-by: Alexandru Avadanii ---- - .../0103-virtng-module-Extend-libvirt_domain.patch | 54 ++++++++++++++++++++++ - ...4-salt-control-virt-Extend-libvirt_domain.patch | 51 ++++++++++++++++++++ - mcp/patches/patches.list | 2 + - .../baremetal-mcp-ocata-common/infra/kvm.yml | 15 ++++++ - .../baremetal-mcp-ocata-odl-ha/infra/kvm.yml | 3 ++ - 5 files changed, 125 insertions(+) - create mode 100644 mcp/patches/0103-virtng-module-Extend-libvirt_domain.patch - create mode 100644 mcp/patches/0104-salt-control-virt-Extend-libvirt_domain.patch - -diff --git a/mcp/patches/0103-virtng-module-Extend-libvirt_domain.patch b/mcp/patches/0103-virtng-module-Extend-libvirt_domain.patch -new file mode 100644 -index 0000000..706b67d ---- /dev/null -+++ b/mcp/patches/0103-virtng-module-Extend-libvirt_domain.patch -@@ -0,0 +1,54 @@ -+From: Alexandru Avadanii -+Date: Mon, 21 Aug 2017 02:03:01 +0200 -+Subject: [PATCH] virtng: module: Extend libvirt_domain -+ -+Extend virtng.py with support for passing down new params: -+- hw_firmware_type; -+- virt_machine_model; -+- cpu_model; -+ -+This functionality relies on the corresponding changes to be -+implemented in libvirt_domain.jinja template. -+ -+These will later be leveraged via salt virt formula with AArch64 -+specific values. -+ -+Signed-off-by: Alexandru Avadanii -+--- -+ -+diff --git a/_modules/virtng.py b/_modules/virtng.py -+--- a/_modules/virtng.py -++++ b/_modules/virtng.py -+@@ -56,6 +56,10 @@ -+ -+ VIRT_DEFAULT_HYPER = 'kvm' -+ -++DEFAULT_UEFI_LOADER_PATH = { -++ "x86_64": "/usr/share/OVMF/OVMF_CODE.fd", -++ "aarch64": "/usr/share/AAVMF/AAVMF_CODE.fd" -++} -+ -+ def __virtual__(): -+ if not HAS_ALL_IMPORTS: -+@@ -227,6 +231,21 @@ -+ # TODO: make bus and model parameterized, this works for 64-bit Linux -+ context['controller_model'] = 'lsilogic' -+ -++ # TODO: limit cpu_model, hw_firmware_type, virt_machine_type to qemu/kvm -++ # FIXME: parametrize hardcoded path for NVRAM storage -++ if 'hw_firmware_type' in kwargs and kwargs['hw_firmware_type'] == 'uefi': -++ context['os_loader_type'] = 'pflash' -++ context['os_loader'] = DEFAULT_UEFI_LOADER_PATH[os.uname()[-1]] -++ context['os_loader_nvram'] = '/var/lib/libvirt/qemu/nvram/{0}_VARS.fd'.format(name) -++ -++ if 'virt_machine_model' in kwargs: -++ context['custom_virt_machine'] = True -++ context['virt_machine_model'] = kwargs['virt_machine_model'] -++ -++ if 'cpu_model' in kwargs: -++ context['cpu_mode'] = 'custom' -++ context['cpu_model'] = kwargs['cpu_model'] -++ -+ if 'boot_dev' in kwargs: -+ context['boot_dev'] = [] -+ for dev in kwargs['boot_dev'].split(): -diff --git a/mcp/patches/0104-salt-control-virt-Extend-libvirt_domain.patch b/mcp/patches/0104-salt-control-virt-Extend-libvirt_domain.patch -new file mode 100644 -index 0000000..a9fe11b ---- /dev/null -+++ b/mcp/patches/0104-salt-control-virt-Extend-libvirt_domain.patch -@@ -0,0 +1,51 @@ -+From: Alexandru Avadanii -+Date: Mon, 21 Aug 2017 02:03:01 +0200 -+Subject: [PATCH] salt: control: virt: Extend libvirt_domain -+ -+Extend salt/control/virt.sls with support for new params: -+- hw_firmware_type; -+- virt_machine_model; -+- cpu_model; -+ -+This functionality relies on the corresponding changes to be -+implemented in libvirt_domain.jinja template, as well as in -+salt custom py module virtng.py. -+ -+These will later be leveraged via reclass model with AArch64 -+specific values. -+ -+FIXME: Move all new params to different section, as "size" is -+definitely not the best choice. -+ -+Example reclass model usage: -+salt: -+ control: -+ size: -+ openstack.example_vm_type: -+ hw_firmware_type: uefi -+ virt_machine_model: virt -+ cpu_model: host-passthrough -+ -+Signed-off-by: Alexandru Avadanii -+--- -+ -+diff --git a/salt/control/virt.sls b/salt/control/virt.sls -+--- a/salt/control/virt.sls -++++ b/salt/control/virt.sls -+@@ -44,6 +44,16 @@ -+ seed: True -+ serial_type: pty -+ console: True -++ # FIXME(armband): Move these 3 params to different section -++ {%- if size.hw_firmware_type is defined %} -++ hw_firmware_type: {{ size.hw_firmware_type }} -++ {%- endif %} -++ {%- if size.virt_machine_model is defined %} -++ virt_machine_model: {{ size.virt_machine_model }} -++ {%- endif %} -++ {%- if size.cpu_model is defined %} -++ cpu_model: {{ size.cpu_model }} -++ {%- endif %} -+ - unless: virsh list --all --name| grep -E "^{{ node_name }}.{{ cluster.domain }}$" -+ -+ #salt_control_seed_{{ cluster_name }}_{{ node_name }}: -diff --git a/mcp/patches/patches.list b/mcp/patches/patches.list -index 688a9af..e618d57 100644 ---- a/mcp/patches/patches.list -+++ b/mcp/patches/patches.list -@@ -20,3 +20,5 @@ - /usr/share/salt-formulas/env: 0013-maas-region-Allow-subnets-without-fabrics.patch - /usr/share/salt-formulas/env: 0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch - /usr/share/salt-formulas/env: 0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch -+/usr/share/salt-formulas/env: 0103-virtng-module-Extend-libvirt_domain.patch -+/usr/share/salt-formulas/env: 0104-salt-control-virt-Extend-libvirt_domain.patch -diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml -index 7f2f572..9698875 100644 ---- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml -+++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml -@@ -46,21 +46,33 @@ parameters: - openstack.control: - cpu: 4 - ram: 12288 -+ hw_firmware_type: uefi -+ virt_machine_model: virt -+ cpu_model: host-passthrough - disk_profile: small - net_profile: default - openstack.database: - cpu: 4 - ram: 6144 -+ hw_firmware_type: uefi -+ virt_machine_model: virt -+ cpu_model: host-passthrough - disk_profile: large - net_profile: default - openstack.message_queue: - cpu: 4 - ram: 2048 -+ hw_firmware_type: uefi -+ virt_machine_model: virt -+ cpu_model: host-passthrough - disk_profile: small - net_profile: default - openstack.telemetry: - cpu: 2 - ram: 3072 -+ hw_firmware_type: uefi -+ virt_machine_model: virt -+ cpu_model: host-passthrough - disk_profile: xxlarge - net_profile: default - # stacklight.log: -@@ -81,6 +93,9 @@ parameters: - openstack.proxy: - cpu: 2 - ram: 2048 -+ hw_firmware_type: uefi -+ virt_machine_model: virt -+ cpu_model: host-passthrough - disk_profile: small - net_profile: default_ext - cluster: -diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/kvm.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/kvm.yml -index d7bbadd..f8b9662 100644 ---- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/kvm.yml -+++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/kvm.yml -@@ -17,6 +17,9 @@ parameters: - opendaylight.server: - cpu: 4 - ram: 6144 -+ hw_firmware_type: uefi -+ virt_machine_model: virt -+ cpu_model: host-passthrough - disk_profile: small - net_profile: default - cluster: diff --git a/patches/opnfv-fuel/0009-seedng-module-Add-AArch64-repo.patch b/patches/opnfv-fuel/0009-seedng-module-Add-AArch64-repo.patch deleted file mode 100644 index 86a57386..00000000 --- a/patches/opnfv-fuel/0009-seedng-module-Add-AArch64-repo.patch +++ /dev/null @@ -1,57 +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: Mon, 21 Aug 2017 20:42:00 +0200 -Subject: [PATCH] seedng: module: Add AArch64 repo - -salt custom py module seedng.py should use custom repo arg -"-R linux.enea.com/saltstack" on AArch64 nodes. - -Signed-off-by: Alexandru Avadanii ---- - mcp/patches/0009-seedng-module-Sync-salt-version.patch | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/mcp/patches/0009-seedng-module-Sync-salt-version.patch b/mcp/patches/0009-seedng-module-Sync-salt-version.patch -index d116c81..20233a9 100644 ---- a/mcp/patches/0009-seedng-module-Sync-salt-version.patch -+++ b/mcp/patches/0009-seedng-module-Sync-salt-version.patch -@@ -8,23 +8,29 @@ - :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - From: Alexandru Avadanii - Date: Mon, 21 Aug 2017 02:03:01 +0200 --Subject: [PATCH] seedng: module: Sync salt version -+Subject: [PATCH] seedng: module: Sync salt version, AArch64 repo - - salt custom py module seedng.py should use the same Salt version - when preinstalling minion for salt-controlled VMs via bootstrap - script. - -+While at it, add AArch64 repo. This used to be a separate patch, but -+we'll squash it in, so reverse-apply checks still work: -+- salt custom py module seedng.py should use custom repo arg -+ "-R linux.enea.com/saltstack" on AArch64 nodes. -+ - Signed-off-by: Alexandru Avadanii - --- - - diff --git a/_modules/seedng.py b/_modules/seedng.py - --- a/_modules/seedng.py - +++ b/_modules/seedng.py --@@ -256,8 +256,10 @@ -+@@ -256,8 +256,11 @@ - boot_, tmppath = (prep_bootstrap(mpt) - or salt.syspaths.BOOTSTRAP) - # Exec the chroot command --+ arg = 'stable {0}'.format('.'.join(salt.version.__version__.split('.')[:2])) -++ arg = '-R linux.enea.com/saltstack ' if os.uname()[-1] == 'aarch64' else '' -++ arg += 'stable {0}'.format('.'.join(salt.version.__version__.split('.')[:2])) - cmd = 'if type salt-minion; then exit 0; ' - - cmd += 'else sh {0} -c /tmp; fi'.format(os.path.join(tmppath, 'bootstrap-salt.sh')) - + cmd += 'else sh {0} -c /tmp {1}; fi'.format( diff --git a/patches/opnfv-fuel/0009-virtng.py-virt.sls-Extend-libvirt_domain.patch b/patches/opnfv-fuel/0009-virtng.py-virt.sls-Extend-libvirt_domain.patch new file mode 100644 index 00000000..187e8679 --- /dev/null +++ b/patches/opnfv-fuel/0009-virtng.py-virt.sls-Extend-libvirt_domain.patch @@ -0,0 +1,223 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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: Mon, 21 Aug 2017 01:10:16 +0200 +Subject: [PATCH] virtng.py, virt.sls: Extend libvirt_domain + +Extend _modules/virtng.py, salt/control/virt.sls with support for: +- hw_firmware_type; +- virt_machine_model; +- cpu_model; + +This functionality relies on the corresponding changes to be +implemented in libvirt_domain.jinja template. + +These will later be leveraged via our reclass model with AArch64 +specific values. + +Signed-off-by: Alexandru Avadanii +--- + .../0103-virtng-module-Extend-libvirt_domain.patch | 54 ++++++++++++++++++++++ + ...4-salt-control-virt-Extend-libvirt_domain.patch | 51 ++++++++++++++++++++ + mcp/patches/patches.list | 2 + + .../baremetal-mcp-ocata-common/infra/kvm.yml | 15 ++++++ + .../baremetal-mcp-ocata-odl-ha/infra/kvm.yml | 3 ++ + 5 files changed, 125 insertions(+) + create mode 100644 mcp/patches/0103-virtng-module-Extend-libvirt_domain.patch + create mode 100644 mcp/patches/0104-salt-control-virt-Extend-libvirt_domain.patch + +diff --git a/mcp/patches/0103-virtng-module-Extend-libvirt_domain.patch b/mcp/patches/0103-virtng-module-Extend-libvirt_domain.patch +new file mode 100644 +index 0000000..706b67d +--- /dev/null ++++ b/mcp/patches/0103-virtng-module-Extend-libvirt_domain.patch +@@ -0,0 +1,54 @@ ++From: Alexandru Avadanii ++Date: Mon, 21 Aug 2017 02:03:01 +0200 ++Subject: [PATCH] virtng: module: Extend libvirt_domain ++ ++Extend virtng.py with support for passing down new params: ++- hw_firmware_type; ++- virt_machine_model; ++- cpu_model; ++ ++This functionality relies on the corresponding changes to be ++implemented in libvirt_domain.jinja template. ++ ++These will later be leveraged via salt virt formula with AArch64 ++specific values. ++ ++Signed-off-by: Alexandru Avadanii ++--- ++ ++diff --git a/_modules/virtng.py b/_modules/virtng.py ++--- a/_modules/virtng.py +++++ b/_modules/virtng.py ++@@ -56,6 +56,10 @@ ++ ++ VIRT_DEFAULT_HYPER = 'kvm' ++ +++DEFAULT_UEFI_LOADER_PATH = { +++ "x86_64": "/usr/share/OVMF/OVMF_CODE.fd", +++ "aarch64": "/usr/share/AAVMF/AAVMF_CODE.fd" +++} ++ ++ def __virtual__(): ++ if not HAS_ALL_IMPORTS: ++@@ -227,6 +231,21 @@ ++ # TODO: make bus and model parameterized, this works for 64-bit Linux ++ context['controller_model'] = 'lsilogic' ++ +++ # TODO: limit cpu_model, hw_firmware_type, virt_machine_type to qemu/kvm +++ # FIXME: parametrize hardcoded path for NVRAM storage +++ if 'hw_firmware_type' in kwargs and kwargs['hw_firmware_type'] == 'uefi': +++ context['os_loader_type'] = 'pflash' +++ context['os_loader'] = DEFAULT_UEFI_LOADER_PATH[os.uname()[-1]] +++ context['os_loader_nvram'] = '/var/lib/libvirt/qemu/nvram/{0}_VARS.fd'.format(name) +++ +++ if 'virt_machine_model' in kwargs: +++ context['custom_virt_machine'] = True +++ context['virt_machine_model'] = kwargs['virt_machine_model'] +++ +++ if 'cpu_model' in kwargs: +++ context['cpu_mode'] = 'custom' +++ context['cpu_model'] = kwargs['cpu_model'] +++ ++ if 'boot_dev' in kwargs: ++ context['boot_dev'] = [] ++ for dev in kwargs['boot_dev'].split(): +diff --git a/mcp/patches/0104-salt-control-virt-Extend-libvirt_domain.patch b/mcp/patches/0104-salt-control-virt-Extend-libvirt_domain.patch +new file mode 100644 +index 0000000..a9fe11b +--- /dev/null ++++ b/mcp/patches/0104-salt-control-virt-Extend-libvirt_domain.patch +@@ -0,0 +1,51 @@ ++From: Alexandru Avadanii ++Date: Mon, 21 Aug 2017 02:03:01 +0200 ++Subject: [PATCH] salt: control: virt: Extend libvirt_domain ++ ++Extend salt/control/virt.sls with support for new params: ++- hw_firmware_type; ++- virt_machine_model; ++- cpu_model; ++ ++This functionality relies on the corresponding changes to be ++implemented in libvirt_domain.jinja template, as well as in ++salt custom py module virtng.py. ++ ++These will later be leveraged via reclass model with AArch64 ++specific values. ++ ++FIXME: Move all new params to different section, as "size" is ++definitely not the best choice. ++ ++Example reclass model usage: ++salt: ++ control: ++ size: ++ openstack.example_vm_type: ++ hw_firmware_type: uefi ++ virt_machine_model: virt ++ cpu_model: host-passthrough ++ ++Signed-off-by: Alexandru Avadanii ++--- ++ ++diff --git a/salt/control/virt.sls b/salt/control/virt.sls ++--- a/salt/control/virt.sls +++++ b/salt/control/virt.sls ++@@ -44,6 +44,16 @@ ++ seed: True ++ serial_type: pty ++ console: True +++ # FIXME(armband): Move these 3 params to different section +++ {%- if size.hw_firmware_type is defined %} +++ hw_firmware_type: {{ size.hw_firmware_type }} +++ {%- endif %} +++ {%- if size.virt_machine_model is defined %} +++ virt_machine_model: {{ size.virt_machine_model }} +++ {%- endif %} +++ {%- if size.cpu_model is defined %} +++ cpu_model: {{ size.cpu_model }} +++ {%- endif %} ++ - unless: virsh list --all --name| grep -E "^{{ node_name }}.{{ cluster.domain }}$" ++ ++ #salt_control_seed_{{ cluster_name }}_{{ node_name }}: +diff --git a/mcp/patches/patches.list b/mcp/patches/patches.list +index 688a9af..e618d57 100644 +--- a/mcp/patches/patches.list ++++ b/mcp/patches/patches.list +@@ -20,3 +20,5 @@ + /usr/share/salt-formulas/env: 0013-maas-region-Allow-subnets-without-fabrics.patch + /usr/share/salt-formulas/env: 0101-maas-Add-curtin_userdata_arm64_generic_xenial.patch + /usr/share/salt-formulas/env: 0102-libvirt-unix_sock_group-s-libvirtd-libvirt.patch ++/usr/share/salt-formulas/env: 0103-virtng-module-Extend-libvirt_domain.patch ++/usr/share/salt-formulas/env: 0104-salt-control-virt-Extend-libvirt_domain.patch +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml +index 9011e47..d759675 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/infra/kvm.yml +@@ -49,21 +49,33 @@ parameters: + openstack.control: + cpu: 4 + ram: 12288 ++ hw_firmware_type: uefi ++ virt_machine_model: virt ++ cpu_model: host-passthrough + disk_profile: small + net_profile: default + openstack.database: + cpu: 4 + ram: 6144 ++ hw_firmware_type: uefi ++ virt_machine_model: virt ++ cpu_model: host-passthrough + disk_profile: large + net_profile: default + openstack.message_queue: + cpu: 4 + ram: 2048 ++ hw_firmware_type: uefi ++ virt_machine_model: virt ++ cpu_model: host-passthrough + disk_profile: small + net_profile: default + openstack.telemetry: + cpu: 2 + ram: 3072 ++ hw_firmware_type: uefi ++ virt_machine_model: virt ++ cpu_model: host-passthrough + disk_profile: xxlarge + net_profile: default + # stacklight.log: +@@ -84,6 +96,9 @@ parameters: + openstack.proxy: + cpu: 2 + ram: 2048 ++ hw_firmware_type: uefi ++ virt_machine_model: virt ++ cpu_model: host-passthrough + disk_profile: small + net_profile: default_ext + cluster: +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/kvm.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/kvm.yml +index d7bbadd..f8b9662 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/kvm.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/kvm.yml +@@ -17,6 +17,9 @@ parameters: + opendaylight.server: + cpu: 4 + ram: 6144 ++ hw_firmware_type: uefi ++ virt_machine_model: virt ++ cpu_model: host-passthrough + disk_profile: small + net_profile: default + cluster: diff --git a/patches/opnfv-fuel/0010-aarch64-skip-configuration-of-hugepages.patch b/patches/opnfv-fuel/0010-aarch64-skip-configuration-of-hugepages.patch deleted file mode 100644 index 7aef2328..00000000 --- a/patches/opnfv-fuel/0010-aarch64-skip-configuration-of-hugepages.patch +++ /dev/null @@ -1,36 +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: Charalampos Kominos -Date: Thu, 24 Aug 2017 19:28:14 +0200 -Subject: [PATCH] aarch64: skip configuration of hugepages - -The reclass model contains instructions on how to setup nova.conf. -Those instructions need to be overwritten for ARM. - -Signed-off-by: Guillermo Herrero -Signed-off-by: Charalampos Kominos ---- - .../classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml -index a78850f..ce67588 100644 ---- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml -+++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml -@@ -12,8 +12,8 @@ classes: - - system.linux.storage.loopback - - system.glusterfs.client.cluster - - system.nova.compute.cluster -- - system.nova.compute.nfv.hugepages -- - system.nova.compute.nfv.cpu_pinning -+ # - system.nova.compute.nfv.hugepages -+ # - system.nova.compute.nfv.cpu_pinning - - system.neutron.gateway.cluster - - system.cinder.volume.single - - system.cinder.volume.backend.lvm diff --git a/patches/opnfv-fuel/0010-seedng-module-Add-AArch64-repo.patch b/patches/opnfv-fuel/0010-seedng-module-Add-AArch64-repo.patch new file mode 100644 index 00000000..86a57386 --- /dev/null +++ b/patches/opnfv-fuel/0010-seedng-module-Add-AArch64-repo.patch @@ -0,0 +1,57 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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: Mon, 21 Aug 2017 20:42:00 +0200 +Subject: [PATCH] seedng: module: Add AArch64 repo + +salt custom py module seedng.py should use custom repo arg +"-R linux.enea.com/saltstack" on AArch64 nodes. + +Signed-off-by: Alexandru Avadanii +--- + mcp/patches/0009-seedng-module-Sync-salt-version.patch | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/mcp/patches/0009-seedng-module-Sync-salt-version.patch b/mcp/patches/0009-seedng-module-Sync-salt-version.patch +index d116c81..20233a9 100644 +--- a/mcp/patches/0009-seedng-module-Sync-salt-version.patch ++++ b/mcp/patches/0009-seedng-module-Sync-salt-version.patch +@@ -8,23 +8,29 @@ + :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + From: Alexandru Avadanii + Date: Mon, 21 Aug 2017 02:03:01 +0200 +-Subject: [PATCH] seedng: module: Sync salt version ++Subject: [PATCH] seedng: module: Sync salt version, AArch64 repo + + salt custom py module seedng.py should use the same Salt version + when preinstalling minion for salt-controlled VMs via bootstrap + script. + ++While at it, add AArch64 repo. This used to be a separate patch, but ++we'll squash it in, so reverse-apply checks still work: ++- salt custom py module seedng.py should use custom repo arg ++ "-R linux.enea.com/saltstack" on AArch64 nodes. ++ + Signed-off-by: Alexandru Avadanii + --- + + diff --git a/_modules/seedng.py b/_modules/seedng.py + --- a/_modules/seedng.py + +++ b/_modules/seedng.py +-@@ -256,8 +256,10 @@ ++@@ -256,8 +256,11 @@ + boot_, tmppath = (prep_bootstrap(mpt) + or salt.syspaths.BOOTSTRAP) + # Exec the chroot command +-+ arg = 'stable {0}'.format('.'.join(salt.version.__version__.split('.')[:2])) +++ arg = '-R linux.enea.com/saltstack ' if os.uname()[-1] == 'aarch64' else '' +++ arg += 'stable {0}'.format('.'.join(salt.version.__version__.split('.')[:2])) + cmd = 'if type salt-minion; then exit 0; ' + - cmd += 'else sh {0} -c /tmp; fi'.format(os.path.join(tmppath, 'bootstrap-salt.sh')) + + cmd += 'else sh {0} -c /tmp {1}; fi'.format( diff --git a/patches/opnfv-fuel/0011-aarch64-skip-configuration-of-hugepages.patch b/patches/opnfv-fuel/0011-aarch64-skip-configuration-of-hugepages.patch new file mode 100644 index 00000000..ebf454f4 --- /dev/null +++ b/patches/opnfv-fuel/0011-aarch64-skip-configuration-of-hugepages.patch @@ -0,0 +1,36 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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: Charalampos Kominos +Date: Thu, 24 Aug 2017 19:28:14 +0200 +Subject: [PATCH] aarch64: skip configuration of hugepages + +The reclass model contains instructions on how to setup nova.conf. +Those instructions need to be overwritten for ARM. + +Signed-off-by: Guillermo Herrero +Signed-off-by: Charalampos Kominos +--- + .../classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml +index 278e55b..ff57ad3 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_compute.yml +@@ -13,8 +13,8 @@ classes: + - system.linux.storage.loopback + - system.glusterfs.client.cluster + - system.nova.compute.cluster +- - system.nova.compute.nfv.hugepages +- - system.nova.compute.nfv.cpu_pinning ++ # - system.nova.compute.nfv.hugepages ++ # - system.nova.compute.nfv.cpu_pinning + - system.neutron.gateway.cluster + - system.cinder.volume.single + - system.cinder.volume.backend.lvm diff --git a/patches/opnfv-fuel/0011-baremetal-virtual-Extend-arch-list-for-UCA-repo.patch b/patches/opnfv-fuel/0011-baremetal-virtual-Extend-arch-list-for-UCA-repo.patch deleted file mode 100644 index 3bc5d324..00000000 --- a/patches/opnfv-fuel/0011-baremetal-virtual-Extend-arch-list-for-UCA-repo.patch +++ /dev/null @@ -1,88 +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: Wed, 30 Aug 2017 22:15:07 +0200 -Subject: [PATCH] baremetal, virtual: Extend arch list for UCA repo - -JIRA: https://jira.opnfv.org/browse/ARMBAND-304 - -Signed-off-by: Alexandru Avadanii ---- - .../classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/init.yml | 2 +- - .../cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/compute.yml | 2 +- - .../classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/init.yml | 2 +- - .../classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml | 2 +- - .../classes/cluster/virtual-mcp-ocata-odl-router/openstack/init.yml | 2 +- - 5 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/init.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/init.yml -index 9a04c84..80e5bb7 100644 ---- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/init.yml -+++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/init.yml -@@ -27,7 +27,7 @@ parameters: - repo: - uca: - source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/ocata main" -- architectures: amd64 -+ architectures: amd64,arm64 - key_id: EC4926EA - key_server: keyserver.ubuntu.com - kernel: -diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/compute.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/compute.yml -index aa6b4e3..5b6752e 100644 ---- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/compute.yml -+++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/compute.yml -@@ -25,7 +25,7 @@ parameters: - repo: - uca: - source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/ocata main" -- architectures: amd64 -+ architectures: amd64,arm64 - key_id: EC4926EA - key_server: keyserver.ubuntu.com - network: -diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/init.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/init.yml -index 5e855ac..2392cf0 100644 ---- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/init.yml -+++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/init.yml -@@ -27,7 +27,7 @@ parameters: - repo: - uca: - source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/ocata main" -- architectures: amd64 -+ architectures: amd64,arm64 - key_id: EC4926EA - key_server: keyserver.ubuntu.com - kernel: -diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml -index ad06754..d4e1c40 100644 ---- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml -+++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml -@@ -65,7 +65,7 @@ parameters: - repo: - uca: - source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/ocata main" -- architectures: amd64 -+ architectures: amd64,arm64 - key_id: EC4926EA - key_server: keyserver.ubuntu.com - kernel: -diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/openstack/init.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/openstack/init.yml -index 5be63e5..1cfd5a3 100644 ---- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/openstack/init.yml -+++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/openstack/init.yml -@@ -17,7 +17,7 @@ parameters: - repo: - uca: - source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/ocata main" -- architectures: amd64 -+ architectures: amd64,arm64 - key_id: EC4926EA - key_server: keyserver.ubuntu.com - network: diff --git a/patches/opnfv-fuel/0012-Add-opnfv-user-to-the-deployment.patch b/patches/opnfv-fuel/0012-Add-opnfv-user-to-the-deployment.patch deleted file mode 100644 index 42fba2e0..00000000 --- a/patches/opnfv-fuel/0012-Add-opnfv-user-to-the-deployment.patch +++ /dev/null @@ -1,67 +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: Charalampos Kominos -Date: Fri, 1 Sep 2017 12:24:35 +0200 -Subject: [PATCH] Add opnfv user to the deployment - -Signed-off-by: Alexandru Avadanii -Signed-off-by: Charalampos Kominos -Signed-off-by: Guillermo Herrero ---- - mcp/config/states/virtual_control_plane | 2 ++ - mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml | 4 ++++ - mcp/salt-formulas/opnfv/adduser.sls | 7 +++++++ - 3 files changed, 13 insertions(+) - create mode 100644 mcp/salt-formulas/opnfv/adduser.sls - -diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane -index 88a4488..298a9de 100755 ---- a/mcp/config/states/virtual_control_plane -+++ b/mcp/config/states/virtual_control_plane -@@ -37,6 +37,7 @@ salt -C 'kvm* or cmp*' file.replace $debian_ip_source \ - repl="\n if not __salt__['pkg.version']('vlan'):\n __salt__['pkg.install']('vlan')" - - salt -C 'kvm*' pkg.install bridge-utils -+salt -C '*' state.apply opnfv.adduser - salt -C 'kvm*' state.apply linux.network - salt -C 'cmp*' state.apply linux.system - salt -C 'cmp*' state.apply linux.network || true -@@ -66,6 +67,7 @@ while [ $rc -ne 0 ] && [ ${attempt} -lt ${total_attempts} ]; do - rc=0 - for node in $vcp_nodes; do - salt "$node" test.ping 2>/dev/null || { rc=$?; break; }; -+ salt -C "$node" state.apply opnfv.adduser - done - sleep 5 - ((attempt+=1)) -diff --git a/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml b/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml -index aa780e6..e4069c0 100644 ---- a/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml -+++ b/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml -@@ -9,3 +9,7 @@ - classes: - - cluster.all-mcp-ocata-common.opnfv.runtime - - cluster.all-mcp-ocata-common.opnfv.pod_config -+parameters: -+ _param: -+ opnfv_user_username: opnfv -+ opnfv_user_password: $1$5/pIEHT1$XFBhNWW4Q8gYd19hczgPF1 -diff --git a/mcp/salt-formulas/opnfv/adduser.sls b/mcp/salt-formulas/opnfv/adduser.sls -new file mode 100644 -index 0000000..78ef993 ---- /dev/null -+++ b/mcp/salt-formulas/opnfv/adduser.sls -@@ -0,0 +1,7 @@ -+add_opnfv_user: -+ user.present: -+ - name: {{ salt['pillar.get']('_param:opnfv_user_username') }} -+ - password: {{ salt['pillar.get']('_param:opnfv_user_password') }} -+ - createhome: True -+ - groups: -+ - sudo diff --git a/patches/opnfv-fuel/0012-baremetal-virtual-Extend-arch-list-for-UCA-repo.patch b/patches/opnfv-fuel/0012-baremetal-virtual-Extend-arch-list-for-UCA-repo.patch new file mode 100644 index 00000000..9c03bf6e --- /dev/null +++ b/patches/opnfv-fuel/0012-baremetal-virtual-Extend-arch-list-for-UCA-repo.patch @@ -0,0 +1,101 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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: Wed, 30 Aug 2017 22:15:07 +0200 +Subject: [PATCH] baremetal, virtual: Extend arch list for UCA repo + +JIRA: https://jira.opnfv.org/browse/ARMBAND-304 + +Signed-off-by: Alexandru Avadanii +--- + .../classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/init.yml | 2 +- + .../cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/compute.yml | 2 +- + .../classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/init.yml | 2 +- + .../classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/compute.yml | 2 +- + .../classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml | 2 +- + .../classes/cluster/virtual-mcp-ocata-odl-router/openstack/init.yml | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/init.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/init.yml +index 9a04c84..80e5bb7 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/init.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/init.yml +@@ -27,7 +27,7 @@ parameters: + repo: + uca: + source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/ocata main" +- architectures: amd64 ++ architectures: amd64,arm64 + key_id: EC4926EA + key_server: keyserver.ubuntu.com + kernel: +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/compute.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/compute.yml +index e610dc9..47f4b09 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/compute.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/compute.yml +@@ -26,7 +26,7 @@ parameters: + repo: + uca: + source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/ocata main" +- architectures: amd64 ++ architectures: amd64,arm64 + key_id: EC4926EA + key_server: keyserver.ubuntu.com + network: +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/init.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/init.yml +index 5e855ac..2392cf0 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/init.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/init.yml +@@ -27,7 +27,7 @@ parameters: + repo: + uca: + source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/ocata main" +- architectures: amd64 ++ architectures: amd64,arm64 + key_id: EC4926EA + key_server: keyserver.ubuntu.com + kernel: +diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/compute.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/compute.yml +index 9ed3a80..e865d5c 100644 +--- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/compute.yml ++++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/compute.yml +@@ -20,6 +20,6 @@ parameters: + repo: + uca: + source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/ocata main" +- architectures: amd64 ++ architectures: amd64,arm64 + key_id: EC4926EA + key_server: keyserver.ubuntu.com +diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml +index ad06754..d4e1c40 100644 +--- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml ++++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml +@@ -65,7 +65,7 @@ parameters: + repo: + uca: + source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/ocata main" +- architectures: amd64 ++ architectures: amd64,arm64 + key_id: EC4926EA + key_server: keyserver.ubuntu.com + kernel: +diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/openstack/init.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/openstack/init.yml +index 5be63e5..1cfd5a3 100644 +--- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/openstack/init.yml ++++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/openstack/init.yml +@@ -17,7 +17,7 @@ parameters: + repo: + uca: + source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/ocata main" +- architectures: amd64 ++ architectures: amd64,arm64 + key_id: EC4926EA + key_server: keyserver.ubuntu.com + network: diff --git a/patches/opnfv-fuel/0013-Add-opnfv-user-to-the-deployment.patch b/patches/opnfv-fuel/0013-Add-opnfv-user-to-the-deployment.patch new file mode 100644 index 00000000..42fba2e0 --- /dev/null +++ b/patches/opnfv-fuel/0013-Add-opnfv-user-to-the-deployment.patch @@ -0,0 +1,67 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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: Charalampos Kominos +Date: Fri, 1 Sep 2017 12:24:35 +0200 +Subject: [PATCH] Add opnfv user to the deployment + +Signed-off-by: Alexandru Avadanii +Signed-off-by: Charalampos Kominos +Signed-off-by: Guillermo Herrero +--- + mcp/config/states/virtual_control_plane | 2 ++ + mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml | 4 ++++ + mcp/salt-formulas/opnfv/adduser.sls | 7 +++++++ + 3 files changed, 13 insertions(+) + create mode 100644 mcp/salt-formulas/opnfv/adduser.sls + +diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane +index 88a4488..298a9de 100755 +--- a/mcp/config/states/virtual_control_plane ++++ b/mcp/config/states/virtual_control_plane +@@ -37,6 +37,7 @@ salt -C 'kvm* or cmp*' file.replace $debian_ip_source \ + repl="\n if not __salt__['pkg.version']('vlan'):\n __salt__['pkg.install']('vlan')" + + salt -C 'kvm*' pkg.install bridge-utils ++salt -C '*' state.apply opnfv.adduser + salt -C 'kvm*' state.apply linux.network + salt -C 'cmp*' state.apply linux.system + salt -C 'cmp*' state.apply linux.network || true +@@ -66,6 +67,7 @@ while [ $rc -ne 0 ] && [ ${attempt} -lt ${total_attempts} ]; do + rc=0 + for node in $vcp_nodes; do + salt "$node" test.ping 2>/dev/null || { rc=$?; break; }; ++ salt -C "$node" state.apply opnfv.adduser + done + sleep 5 + ((attempt+=1)) +diff --git a/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml b/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml +index aa780e6..e4069c0 100644 +--- a/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml ++++ b/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml +@@ -9,3 +9,7 @@ + classes: + - cluster.all-mcp-ocata-common.opnfv.runtime + - cluster.all-mcp-ocata-common.opnfv.pod_config ++parameters: ++ _param: ++ opnfv_user_username: opnfv ++ opnfv_user_password: $1$5/pIEHT1$XFBhNWW4Q8gYd19hczgPF1 +diff --git a/mcp/salt-formulas/opnfv/adduser.sls b/mcp/salt-formulas/opnfv/adduser.sls +new file mode 100644 +index 0000000..78ef993 +--- /dev/null ++++ b/mcp/salt-formulas/opnfv/adduser.sls +@@ -0,0 +1,7 @@ ++add_opnfv_user: ++ user.present: ++ - name: {{ salt['pillar.get']('_param:opnfv_user_username') }} ++ - password: {{ salt['pillar.get']('_param:opnfv_user_password') }} ++ - createhome: True ++ - groups: ++ - sudo 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 58718995..00000000 --- a/patches/opnfv-fuel/0013-baremetal-linux-image-generic-hwe-16.04-edge.patch +++ /dev/null @@ -1,62 +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 -JIRA: ARMBAND-330 - -Signed-off-by: Alexandru Avadanii ---- - mcp/config/states/virtual_control_plane | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane -index 298a9de..c07d342 100755 ---- a/mcp/config/states/virtual_control_plane -+++ b/mcp/config/states/virtual_control_plane -@@ -39,9 +39,12 @@ salt -C 'kvm* or cmp*' file.replace $debian_ip_source \ - salt -C 'kvm*' pkg.install bridge-utils - salt -C '*' 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'" -@@ -84,3 +87,10 @@ wait_for 10 "salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' ssh.set_auth_key ${SUDO_US - # Disable proxy dhcp routes after installation - salt -C 'prx*' file.write /etc/dhcp/dhclient-enter-hooks.d/no-default-route \ - args='unset new_routers' -+ -+# NOTE(armband): Should be later moved to reclass as system.kernel.version -+salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' pkg.install \ -+ linux-image-generic-hwe-16.04-edge,linux-headers-generic-hwe-16.04-edge -+salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' system.reboot -+wait_for 90 "! salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' test.ping | " \ -+ "tee /dev/stderr | grep -Fq 'Not connected'" diff --git a/patches/opnfv-fuel/0014-baremetal-linux-image-generic-hwe-16.04-edge.patch b/patches/opnfv-fuel/0014-baremetal-linux-image-generic-hwe-16.04-edge.patch new file mode 100644 index 00000000..6a131c20 --- /dev/null +++ b/patches/opnfv-fuel/0014-baremetal-linux-image-generic-hwe-16.04-edge.patch @@ -0,0 +1,50 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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/virtual_control_plane | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane +index 298a9de..f569ba2 100755 +--- a/mcp/config/states/virtual_control_plane ++++ b/mcp/config/states/virtual_control_plane +@@ -39,9 +39,12 @@ salt -C 'kvm* or cmp*' file.replace $debian_ip_source \ + salt -C 'kvm*' pkg.install bridge-utils + salt -C '*' 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/0015-Add-pre-install-purge-support-for-base-image.patch b/patches/opnfv-fuel/0015-Add-pre-install-purge-support-for-base-image.patch new file mode 100644 index 00000000..28a31396 --- /dev/null +++ b/patches/opnfv-fuel/0015-Add-pre-install-purge-support-for-base-image.patch @@ -0,0 +1,382 @@ +From: Alexandru Avadanii +Date: Fri, 24 Nov 2017 20:28:01 +0100 +Subject: [PATCH] Add pre-{install,purge} support for base image + +Extend and its invocation from with +support for modifying foundation node VMs base image prior to +using it with: +- additional APT GPG keys; +- additional APT repos; +- packages to pre-install; +- packages to pre-remove; +- (non-configurable) cloud init datasource via NoCloud only, + so VCP VMs won't wait for metadata service; + +While at it, re-use the resulting image as a base for another +round of pre-patching (same operations as above are supported) +to provide a base image for VCP VMs. + +Add AArch64-specific configuration based on new mechanisms: +- pre-install linux-image-generic-hwe-16.04-edge (and headers) + for foundation node and VCP (common) image (also requires new + repo and its key); +- pre-install cloud-init for VCP image (it should already be + installed, but script needs non-empty config for VCP to create + the VCP image and transfer it over to Salt Master); + +NOTE: cloud-init is required on VCP VMs for DHCP on 1st iface. + +JIRA: FUEL-309 + +Change-Id: I7dcaf0ffd9c57009133c6d339496ec831ab14375 +Signed-off-by: Alexandru Avadanii +--- + .gitignore | 1 + + ci/deploy.sh | 23 +++- + mcp/config/scenario/defaults-aarch64.yaml | 18 +++ + .../cluster/all-mcp-ocata-common/aarch64/init.yml | 2 +- + mcp/scripts/lib.sh | 137 ++++++++++++++++++++- + mcp/scripts/salt.sh | 12 ++ + 6 files changed, 185 insertions(+), 8 deletions(-) + +diff --git a/.gitignore b/.gitignore +index 4e90f32..38b4440 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -13,3 +13,4 @@ + **/mcp/scripts/mcp.rsa* + **/mcp/scripts/user-data.sh + **/mcp/scripts/net_mcpcontrol.xml ++**/mcp/scripts/*.img +diff --git a/ci/deploy.sh b/ci/deploy.sh +index b13e18e..427850f 100755 +--- a/ci/deploy.sh ++++ b/ci/deploy.sh +@@ -15,6 +15,7 @@ + do_exit () { + local RC=$? + clean ++ cleanup_mounts + if [ ${RC} -eq 0 ]; then + notify "\n[OK] MCP: Openstack installation finished succesfully!\n\n" 2 + else +@@ -158,6 +159,7 @@ NO_DEPLOY_ENVIRONMENT=${NO_DEPLOY_ENVIRONMENT:-0} + ERASE_ENV=${ERASE_ENV:-0} + + source "${DEPLOY_DIR}/globals.sh" ++source "${DEPLOY_DIR}/lib.sh" + + # + # END of variables to customize +@@ -340,7 +342,6 @@ fi + + # Get required infra deployment data + set +x +-source lib.sh + eval "$(parse_yaml "${SCENARIO_DIR}/defaults-$(uname -i).yaml")" + eval "$(parse_yaml "${SCENARIO_DIR}/${DEPLOY_TYPE}/${DEPLOY_SCENARIO}.yaml")" + eval "$(parse_yaml "${LOCAL_PDF_RECLASS}")" +@@ -358,6 +359,23 @@ for node in "${virtual_nodes[@]}"; do + done + virtual_nodes_data=${virtual_nodes_data%|} + ++# Serialize repos, packages to (pre-)install/remove for: ++# - foundation node VM base image (virtual: all VMs, baremetal: cfg01|mas01) ++# - virtualized control plane VM base image (only when VCP is used) ++base_image_flavors=common ++if [[ "${cluster_states[*]}" =~ virtual_control ]]; then ++ base_image_flavors+=" control" ++fi ++for sc in ${base_image_flavors}; do ++ for va in apt_keys apt_repos pkg_install pkg_remove; do ++ key=virtual_${sc}_${va} ++ eval "${key}=\${${key}[@]// /|}" ++ eval "${key}=\${${key}// /,}" ++ virtual_repos_pkgs+="${!key}^" ++ done ++done ++virtual_repos_pkgs=${virtual_repos_pkgs%^} ++ + # Expand reclass and virsh network templates + for tp in "${RECLASS_CLUSTER_DIR}/all-mcp-ocata-common/opnfv/"*.template \ + net_*.template; do +@@ -413,7 +431,8 @@ elif [ ${USE_EXISTING_INFRA} -gt 0 ]; then + check_connection + else + generate_ssh_key +- prepare_vms "${base_image}" "${STORAGE_DIR}" "${virtual_nodes[@]}" ++ prepare_vms "${base_image}" "${STORAGE_DIR}" "${virtual_repos_pkgs}" \ ++ "${virtual_nodes[@]}" + create_networks "${OPNFV_BRIDGES[@]}" + create_vms "${STORAGE_DIR}" "${virtual_nodes_data}" "${OPNFV_BRIDGES[@]}" + update_mcpcontrol_network +diff --git a/mcp/config/scenario/defaults-aarch64.yaml b/mcp/config/scenario/defaults-aarch64.yaml +index 24a4037..d989819 100644 +--- a/mcp/config/scenario/defaults-aarch64.yaml ++++ b/mcp/config/scenario/defaults-aarch64.yaml +@@ -11,3 +11,21 @@ virtual: + default: + vcpus: 6 + ram: 4096 ++ common: ++ apt: ++ keys: ++ - https://linux.enea.com/mcp-repos/ocata/xenial/archive-mcpocata.key ++ repos: ++ # deb [arch=] ++ - armband_openstack 1100 deb [arch=arm64] http://linux.enea.com/mcp-repos/ocata/xenial ocata main ++ - armband_mk_openstack 1100 deb [arch=arm64] http://linux.enea.com/apt-mk/xenial nightly ocata ++ # NOTE(armband): Empty repo, keep commented out as reference ++ # - armband_mcp_extra 1100 deb [arch=arm64] http://linux.enea.com/apt-mk/xenial nightly extra ++ pkg: ++ install: ++ - linux-image-generic-hwe-16.04-edge ++ - linux-headers-generic-hwe-16.04-edge ++ control: ++ pkg: ++ install: ++ - cloud-init +diff --git a/mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml b/mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml +index b5b78ec..0350afa 100644 +--- a/mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml ++++ b/mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml +@@ -8,7 +8,7 @@ + --- + parameters: + _param: +- salt_control_xenial_image: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img ++ salt_control_xenial_image: salt://salt/files/control/images/base_image_opnfv_fuel_vcp.img + + # VMs spawned on Foundation Node / Jump Host net ifaces (max 4) + opnfv_fn_vm_primary_interface: enp1s0 +diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh +index c6d5d26..654f45e 100644 +--- a/mcp/scripts/lib.sh ++++ b/mcp/scripts/lib.sh +@@ -1,4 +1,5 @@ + #!/bin/bash -e ++# shellcheck disable=SC2155,SC1001 + ############################################################################## + # Copyright (c) 2017 Mirantis Inc., Enea AB and others. + # All rights reserved. This program and the accompanying materials +@@ -11,7 +12,6 @@ + # + + function generate_ssh_key { +- # shellcheck disable=SC2155 + local mcp_ssh_key=$(basename "${SSH_KEY}") + local user=${USER} + if [ -n "${SUDO_USER}" ] && [ "${SUDO_USER}" != 'root' ]; then +@@ -35,6 +35,110 @@ function get_base_image { + wget -P "${image_dir}" -N "${base_image}" + } + ++function mount_image { ++ local image=$1 ++ local image_dir=$2 ++ OPNFV_MNT_DIR="${image_dir}/ubuntu" ++ ++ sudo modprobe nbd loop ++ # Find free nbd, loop devices ++ for dev in '/sys/class/block/nbd'*; do ++ if [ "$(cat "${dev}/size")" = '0' ]; then ++ OPNFV_NBD_DEV=/dev/$(basename "${dev}") ++ break ++ fi ++ done ++ OPNFV_LOOP_DEV=$(losetup -f) ++ export OPNFV_MNT_DIR OPNFV_LOOP_DEV ++ [ -n "${OPNFV_NBD_DEV}" ] && [ -n "${OPNFV_LOOP_DEV}" ] || exit 1 ++ sudo qemu-nbd --connect="${OPNFV_NBD_DEV}" --aio=native --cache=none \ ++ "${image_dir}/${image}" ++ sleep 5 # /dev/nbdNp1 takes some time to come up ++ # grub-update does not like /dev/nbd*, so use a loop device to work around it ++ # Hardcode partition index to 1, unlikely to change for Ubuntu UCA image ++ sudo losetup "${OPNFV_LOOP_DEV}" "${OPNFV_NBD_DEV}p1" ++ mkdir -p "${OPNFV_MNT_DIR}" ++ sudo mount "${OPNFV_LOOP_DEV}" "${OPNFV_MNT_DIR}" ++ sudo mount -t proc proc "${OPNFV_MNT_DIR}/proc" ++ sudo mount -t sysfs sys "${OPNFV_MNT_DIR}/sys" ++ sudo mount -o bind /dev "${OPNFV_MNT_DIR}/dev" ++ sudo mkdir -p "${OPNFV_MNT_DIR}/run/resolvconf" ++ sudo cp /etc/resolv.conf "${OPNFV_MNT_DIR}/run/resolvconf" ++ echo "GRUB_DISABLE_OS_PROBER=true" | \ ++ sudo tee -a "${OPNFV_MNT_DIR}/etc/default/grub" ++} ++ ++function apt_repos_pkgs_image { ++ local apt_key_urls=(${1//,/ }) ++ local all_repos=(${2//,/ }) ++ local pkgs_i=(${3//,/ }) ++ local pkgs_r=(${4//,/ }) ++ [ -n "${OPNFV_MNT_DIR}" ] || exit 1 ++ ++ # APT keys ++ if [ "${#apt_key_urls[@]}" -gt 0 ]; then ++ for apt_key in "${apt_key_urls[@]}"; do ++ sudo chroot "${OPNFV_MNT_DIR}" /bin/bash -c \ ++ "wget -qO - '${apt_key}' | apt-key add -" ++ done ++ fi ++ # Additional repositories ++ for repo_line in "${all_repos[@]}"; do ++ # ||deb|[arch=]||| ++ local repo=(${repo_line//|/ }) ++ [ "${#repo[@]}" -gt 5 ] || continue ++ # NOTE: Names and formatting are compatible with Salt linux.system.repo ++ cat <<-EOF | sudo tee "${OPNFV_MNT_DIR}/etc/apt/preferences.d/${repo[0]}" ++ ++ Package: * ++ Pin: release a=${repo[-2]} ++ Pin-Priority: ${repo[1]} ++ ++ EOF ++ echo "${repo[@]:2}" | sudo tee \ ++ "${OPNFV_MNT_DIR}/etc/apt/sources.list.d/${repo[0]}.list" ++ done ++ # Install packages ++ if [ "${#pkgs_i[@]}" -gt 0 ]; then ++ sudo DEBIAN_FRONTEND="noninteractive" \ ++ chroot "${OPNFV_MNT_DIR}" apt-get update ++ sudo DEBIAN_FRONTEND="noninteractive" FLASH_KERNEL_SKIP="true" \ ++ chroot "${OPNFV_MNT_DIR}" apt-get install -y "${pkgs_i[@]}" ++ fi ++ # Remove packages ++ if [ "${#pkgs_r[@]}" -gt 0 ]; then ++ sudo DEBIAN_FRONTEND="noninteractive" FLASH_KERNEL_SKIP="true" \ ++ chroot "${OPNFV_MNT_DIR}" apt-get purge -y "${pkgs_r[@]}" ++ fi ++ # Disable cloud-init metadata service datasource ++ sudo mkdir -p "${OPNFV_MNT_DIR}/etc/cloud/cloud.cfg.d" ++ echo "datasource_list: [ NoCloud, None ]" | sudo tee \ ++ "${OPNFV_MNT_DIR}/etc/cloud/cloud.cfg.d/95_real_datasources.cfg" ++} ++ ++function cleanup_mounts { ++ # Remove any mounts, loop and/or nbd devs created while patching base image ++ if [ -n "${OPNFV_MNT_DIR}" ] && [ -d "${OPNFV_MNT_DIR}" ]; then ++ if [ -f "${OPNFV_MNT_DIR}/boot/grub/grub.cfg" ]; then ++ # Grub thinks it's running from a live CD ++ sudo sed -i -e 's/^\s*set root=.*$//g' -e 's/^\s*loopback.*$//g' \ ++ "${OPNFV_MNT_DIR}/boot/grub/grub.cfg" ++ fi ++ sudo rm -f "${OPNFV_MNT_DIR}/run/resolvconf/resolv.conf" ++ sync ++ if mountpoint -q "${OPNFV_MNT_DIR}"; then ++ sudo umount -l "${OPNFV_MNT_DIR}" || true ++ fi ++ fi ++ if [ -n "${OPNFV_LOOP_DEV}" ] && \ ++ losetup "${OPNFV_LOOP_DEV}" 1>&2 > /dev/null; then ++ sudo losetup -d "${OPNFV_LOOP_DEV}" ++ fi ++ if [ -n "${OPNFV_NBD_DEV}" ]; then ++ sudo qemu-nbd -d "${OPNFV_NBD_DEV}" || true ++ fi ++} ++ + function cleanup_uefi { + # Clean up Ubuntu boot entry if cfg01, kvm nodes online from previous deploy + # shellcheck disable=SC2086 +@@ -60,22 +164,45 @@ function cleanup_vms { + function prepare_vms { + local base_image=$1; shift + local image_dir=$1; shift ++ local repos_pkgs_str=$1; shift # ^-sep list of repos, pkgs to install/rm + local vnodes=("$@") ++ local image=base_image_opnfv_fuel.img + + cleanup_uefi + cleanup_vms + get_base_image "${base_image}" "${image_dir}" ++ ++ rm -f "${image_dir}/${image%.*}"* ++ if [[ ! "${repos_pkgs_str}" =~ ^\^+$ ]]; then ++ IFS='^' read -r -a repos_pkgs <<< "${repos_pkgs_str}" ++ cp "${image_dir}/${base_image/*\/}" "${image_dir}/${image}" ++ mount_image "${image}" "${image_dir}" ++ apt_repos_pkgs_image "${repos_pkgs[@]:0:4}" ++ cleanup_mounts ++ else ++ ln -sf "${image_dir}/${base_image/*\/}" "${image_dir}/${image}" ++ fi ++ ++ # CWD should be + # shellcheck disable=SC2016 + envsubst '${SALT_MASTER},${CLUSTER_DOMAIN}' < \ + user-data.template > user-data.sh + ++ # Create config ISO and resize OS disk image for each foundation node VM + for node in "${vnodes[@]}"; do +- # create/prepare images + ./create-config-drive.sh -k "$(basename "${SSH_KEY}").pub" -u user-data.sh \ + -h "${node}" "${image_dir}/mcp_${node}.iso" +- cp "${image_dir}/${base_image/*\/}" "${image_dir}/mcp_${node}.qcow2" ++ cp "${image_dir}/${image}" "${image_dir}/mcp_${node}.qcow2" + qemu-img resize "${image_dir}/mcp_${node}.qcow2" 100G + done ++ ++ # VCP VMs base image specific changes ++ if [[ ! "${repos_pkgs_str}" =~ \^{3}$ ]] && [ -n "${repos_pkgs[*]:4}" ]; then ++ mount_image "${image}" "${image_dir}" ++ apt_repos_pkgs_image "${repos_pkgs[@]:4:4}" ++ cleanup_mounts ++ ln -sf "${image_dir}/${image}" "${image_dir}/${image%.*}_vcp.img" ++ fi + } + + function create_networks { +@@ -100,6 +227,8 @@ function create_networks { + + function create_vms { + local image_dir=$1; shift ++ # vnode data should be serialized with the following format: ++ # ',,|,,[...]' + IFS='|' read -r -a vnodes <<< "$1"; shift + local vnode_networks=("$@") + +@@ -139,9 +268,7 @@ function create_vms { + + function update_mcpcontrol_network { + # set static ip address for salt master node, MaaS node +- # shellcheck disable=SC2155 + local cmac=$(virsh domiflist cfg01 2>&1| awk '/mcpcontrol/ {print $5; exit}') +- # shellcheck disable=SC2155 + local amac=$(virsh domiflist mas01 2>&1| awk '/mcpcontrol/ {print $5; exit}') + virsh net-update "mcpcontrol" add ip-dhcp-host \ + "" --live +diff --git a/mcp/scripts/salt.sh b/mcp/scripts/salt.sh +index ab096f3..b719aa8 100755 +--- a/mcp/scripts/salt.sh ++++ b/mcp/scripts/salt.sh +@@ -18,6 +18,8 @@ OPNFV_TMP_DIR="/home/${SALT_MASTER_USER}/opnfv" + OPNFV_GIT_DIR="/root/opnfv" + OPNFV_FUEL_DIR="/root/fuel" + OPNFV_RDIR="reclass/classes/cluster/all-mcp-ocata-common" ++OPNFV_VCP_IMG="mcp/scripts/base_image_opnfv_fuel_vcp.img" ++OPNFV_VCP_DIR="/srv/salt/env/prd/salt/files/control/images" + LOCAL_GIT_DIR="${F_GIT_ROOT%${F_GIT_SUBD}}" + LOCAL_PDF_RECLASS=$1 + NODE_MASK='*' +@@ -34,6 +36,11 @@ if [ -n "${LOCAL_PDF_RECLASS}" ] && [ -f "${LOCAL_PDF_RECLASS}" ]; then + rsync -e "ssh ${SSH_OPTS}" "${LOCAL_PDF_RECLASS}" \ + "${remote_tmp}${F_GIT_SUBD}/mcp/${OPNFV_RDIR}/opnfv/" + fi ++local_vcp_img=$(dirname "${LOCAL_PDF_RECLASS}")/$(basename "${OPNFV_VCP_IMG}") ++if [ -e "${local_vcp_img}" ]; then ++ rsync -L -e "ssh ${SSH_OPTS}" "${local_vcp_img}" \ ++ "${remote_tmp}${F_GIT_SUBD}/${OPNFV_VCP_IMG}" ++fi + + # ssh to cfg01 + # shellcheck disable=SC2086,2087 +@@ -95,4 +102,9 @@ ssh ${SSH_OPTS} "${SSH_SALT}" bash -s -e << SALT_INSTALL_END + salt -C "${NODE_MASK} and not cfg01*" pkg.upgrade refresh=False + + salt -C "${NODE_MASK} or cfg01*" state.sls ntp ++ ++ if [ -f "${OPNFV_FUEL_DIR}/${OPNFV_VCP_IMG}" ]; then ++ mkdir -p "${OPNFV_VCP_DIR}" ++ mv "${OPNFV_FUEL_DIR}/${OPNFV_VCP_IMG}" "${OPNFV_VCP_DIR}/" ++ fi + SALT_INSTALL_END diff --git a/patches/reclass-system-salt-model/0001-linux-system-repo-mcp-Add-Armband-repos.patch b/patches/reclass-system-salt-model/0001-linux-system-repo-mcp-Add-Armband-repos.patch deleted file mode 100644 index b99fa735..00000000 --- a/patches/reclass-system-salt-model/0001-linux-system-repo-mcp-Add-Armband-repos.patch +++ /dev/null @@ -1,93 +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: Mon, 10 Jul 2017 15:31:08 +0000 -Subject: [PATCH] linux/system/repo/mcp: Add Armband repos - -FIXME: Use https for fetching Armband GPG key! - -Signed-off-by: Alexandru Avadanii ---- - linux/system/repo/mcp/extra.yml | 9 +++++++ - linux/system/repo/mcp/openstack.yml | 48 +++++++++++++++++++++++++++++++++++++ - 2 files changed, 57 insertions(+) - -diff --git a/linux/system/repo/mcp/extra.yml b/linux/system/repo/mcp/extra.yml -index 826969b..01b9cc5 100644 ---- a/linux/system/repo/mcp/extra.yml -+++ b/linux/system/repo/mcp/extra.yml -@@ -14,3 +14,12 @@ parameters: - - pin: 'release a=${_param:linux_system_repo_mcp_extra_version}' - priority: 1100 - package: '*' -+ armband_mcp_extra: -+ source: "deb [arch=arm64] http://linux.enea.com/apt-mk/${_param:linux_system_codename}/ nightly extra" -+ architectures: arm64 -+ key_url: "http://linux.enea.com/apt-mk/public.gpg" -+ clean_file: true -+ pin: -+ - pin: 'release a=nightly' -+ priority: 1100 -+ package: '*' -diff --git a/linux/system/repo/mcp/openstack.yml b/linux/system/repo/mcp/openstack.yml -index 2235b2c..be8ffd2 100644 ---- a/linux/system/repo/mcp/openstack.yml -+++ b/linux/system/repo/mcp/openstack.yml -@@ -53,3 +53,51 @@ parameters: - - pin: 'release a=${_param:linux_system_repo_mk_openstack_version}' - priority: 1100 - package: '*' -+ armband_openstack: -+ source: "deb http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename} ${_param:openstack_version} main" -+ architectures: arm64 -+ key_url: "http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}/archive-mcp${_param:openstack_version}.key" -+ pin: -+ - pin: 'release a=${_param:openstack_version}' -+ priority: 1100 -+ package: '*' -+ armband_openstack_hotfix: -+ source: "deb http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename} ${_param:openstack_version}-hotfix main" -+ architectures: arm64 -+ key_url: "http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}/archive-mcp${_param:openstack_version}.key" -+ pin: -+ - pin: 'release a=${_param:openstack_version}-hotfix' -+ priority: 1100 -+ package: '*' -+ armband_openstack_security: -+ source: "deb http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename} ${_param:openstack_version}-security main" -+ architectures: arm64 -+ key_url: "http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}/archive-mcp${_param:openstack_version}.key" -+ pin: -+ - pin: 'release a=${_param:openstack_version}-security' -+ priority: 1100 -+ package: '*' -+ armband_openstack_updates: -+ source: "deb http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename} ${_param:openstack_version}-updates main" -+ architectures: arm64 -+ key_url: "http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}/archive-mcp${_param:openstack_version}.key" -+ pin: -+ - pin: 'release a=${_param:openstack_version}-updates' -+ priority: 1100 -+ package: '*' -+ armband_openstack_holdback: -+ source: "deb http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename} ${_param:openstack_version}-holdback main" -+ architectures: arm64 -+ key_url: "http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}/archive-mcp${_param:openstack_version}.key" -+ pin: -+ - pin: 'release a=${_param:openstack_version}-holdback' -+ priority: 1100 -+ package: '*' -+ armband_mk_openstack: -+ source: "deb [arch=arm64] http://linux.enea.com/apt-mk/${_param:linux_system_codename}/ nightly ${_param:openstack_version}" -+ architectures: arm64 -+ key_url: "http://linux.enea.com/apt-mk/public.gpg" -+ pin: -+ - pin: 'release a=nightly' -+ priority: 1100 -+ package: '*' diff --git a/patches/reclass-system-salt-model/0001-linux.system.repo.mcp-Add-Armband-repos.patch b/patches/reclass-system-salt-model/0001-linux.system.repo.mcp-Add-Armband-repos.patch new file mode 100644 index 00000000..43d1e6a2 --- /dev/null +++ b/patches/reclass-system-salt-model/0001-linux.system.repo.mcp-Add-Armband-repos.patch @@ -0,0 +1,67 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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: Mon, 10 Jul 2017 15:31:08 +0000 +Subject: [PATCH] linux.system.repo.mcp: Add Armband repos + +Signed-off-by: Alexandru Avadanii +--- + linux/system/repo/mcp/armband/extra.yml | 14 ++++++++++++++ + linux/system/repo/mcp/armband/openstack.yml | 21 +++++++++++++++++++++ + 2 files changed, 35 insertions(+) + create mode 100644 linux/system/repo/mcp/armband/extra.yml + create mode 100644 linux/system/repo/mcp/armband/openstack.yml + +diff --git a/linux/system/repo/mcp/armband/extra.yml b/linux/system/repo/mcp/armband/extra.yml +new file mode 100644 +index 0000000..5b10e19 +--- /dev/null ++++ b/linux/system/repo/mcp/armband/extra.yml +@@ -0,0 +1,14 @@ ++parameters: ++ # Armband only provides apt_mk_version=nightly for now ++ linux: ++ system: ++ repo: ++ armband_mcp_extra: ++ source: "deb [arch=arm64] http://linux.enea.com/apt-mk/${_param:linux_system_codename}/ nightly extra" ++ architectures: arm64 ++ key_url: "https://linux.enea.com/apt-mk/public.gpg" ++ clean_file: true ++ pin: ++ - pin: 'release a=nightly' ++ priority: 1100 ++ package: '*' +diff --git a/linux/system/repo/mcp/armband/openstack.yml b/linux/system/repo/mcp/armband/openstack.yml +new file mode 100644 +index 0000000..6aa4fa0 +--- /dev/null ++++ b/linux/system/repo/mcp/armband/openstack.yml +@@ -0,0 +1,21 @@ ++parameters: ++ # Armband only provides apt_mk_version=nightly for now ++ linux: ++ system: ++ repo: ++ armband_openstack: ++ source: "deb http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename} ${_param:openstack_version} main" ++ architectures: arm64 ++ key_url: "https://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}/archive-mcp${_param:openstack_version}.key" ++ pin: ++ - pin: 'release a=${_param:openstack_version}' ++ priority: 1100 ++ package: '*' ++ armband_mk_openstack: ++ source: "deb [arch=arm64] http://linux.enea.com/apt-mk/${_param:linux_system_codename}/ nightly ${_param:openstack_version}" ++ architectures: arm64 ++ key_url: "https://linux.enea.com/apt-mk/public.gpg" ++ pin: ++ - pin: 'release a=nightly' ++ priority: 1100 ++ package: '*' diff --git a/patches/reclass-system-salt-model/0002-linux-system-AArch64-Remove-mcelog.patch b/patches/reclass-system-salt-model/0002-linux-system-AArch64-Remove-mcelog.patch deleted file mode 100644 index 6f2b46ff..00000000 --- a/patches/reclass-system-salt-model/0002-linux-system-AArch64-Remove-mcelog.patch +++ /dev/null @@ -1,34 +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, 14 Jul 2017 19:26:11 +0000 -Subject: [PATCH] linux/system: AArch64: Remove mcelog - -mcelog is not available on AArch64 hardware, so skip trying to install -it. This implies Ceilometer should not use mcelog on AArch64. - -Signed-off-by: Guillermo Herrero -Signed-off-by: Alexandru Avadanii ---- - linux/system/single.yml | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/linux/system/single.yml b/linux/system/single.yml -index ef23a39..f07fa68 100644 ---- a/linux/system/single.yml -+++ b/linux/system/single.yml -@@ -11,8 +11,6 @@ parameters: - version: latest - cloud-init: - version: purged -- mcelog: -- version: latest - kernel: - modules: - - nf_conntrack diff --git a/patches/reclass-system-salt-model/0002-linux.system-AArch64-Remove-mcelog.patch b/patches/reclass-system-salt-model/0002-linux.system-AArch64-Remove-mcelog.patch new file mode 100644 index 00000000..1c33a3a8 --- /dev/null +++ b/patches/reclass-system-salt-model/0002-linux.system-AArch64-Remove-mcelog.patch @@ -0,0 +1,34 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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, 14 Jul 2017 19:26:11 +0000 +Subject: [PATCH] linux.system: AArch64: Remove mcelog + +mcelog is not available on AArch64 hardware, so skip trying to install +it. This implies Ceilometer should not use mcelog on AArch64. + +Signed-off-by: Guillermo Herrero +Signed-off-by: Alexandru Avadanii +--- + linux/system/single/init.yml | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/linux/system/single/init.yml b/linux/system/single/init.yml +index 8de2dda..c702a48 100644 +--- a/linux/system/single/init.yml ++++ b/linux/system/single/init.yml +@@ -19,8 +19,6 @@ parameters: + version: purged + unattended-upgrades: + version: purged +- mcelog: +- version: latest + kernel: + modules: + - nf_conntrack diff --git a/patches/reclass-system-salt-model/0003-linux.system.repo.glusterfs-Add-arm64-arch.patch b/patches/reclass-system-salt-model/0003-linux.system.repo.glusterfs-Add-arm64-arch.patch new file mode 100644 index 00000000..65578721 --- /dev/null +++ b/patches/reclass-system-salt-model/0003-linux.system.repo.glusterfs-Add-arm64-arch.patch @@ -0,0 +1,29 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: 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, 26 Nov 2017 17:55:13 +0100 +Subject: [PATCH] linux.system.repo.glusterfs: Add arm64 arch + +Signed-off-by: Alexandru Avadanii +--- + linux/system/repo/glusterfs.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/linux/system/repo/glusterfs.yml b/linux/system/repo/glusterfs.yml +index fb331f0..ffad938 100644 +--- a/linux/system/repo/glusterfs.yml ++++ b/linux/system/repo/glusterfs.yml +@@ -6,6 +6,6 @@ parameters: + repo: + glusterfs-ppa: + source: "deb http://ppa.launchpad.net/gluster/glusterfs-${_param:glusterfs_version}/ubuntu ${_param:linux_system_codename} main" +- architectures: amd64 ++ architectures: amd64,arm64 + key_id: 3FE869A9 + key_server: keyserver.ubuntu.com diff --git a/upstream/fuel b/upstream/fuel index 0adbe359..8a867449 160000 --- a/upstream/fuel +++ b/upstream/fuel @@ -1 +1 @@ -Subproject commit 0adbe359a0e448e0a8007b0041890e33a612a4dc +Subproject commit 8a867449217151f59766a74c6165ffc26c7f50b4 -- cgit 1.2.3-korg