diff options
Diffstat (limited to 'mcp/config')
36 files changed, 700 insertions, 762 deletions
diff --git a/mcp/config/labs/local/idf-pod1.yaml b/mcp/config/labs/local/idf-pod1.yaml deleted file mode 100644 index b916707a1..000000000 --- a/mcp/config/labs/local/idf-pod1.yaml +++ /dev/null @@ -1,79 +0,0 @@ -############################################################################## -# Copyright (c) 2018 Linux Foundation, Mirantis Inc., 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 -############################################################################## ---- -### LF POD 2 installer descriptor file ### - -idf: - version: 0.1 - net_config: - # NOTE: Network names are likely to change after the PDF spec is updated - oob: - interface: 0 - ip-range: 172.30.8.65-172.30.8.75 - vlan: 410 - admin: - interface: 0 - vlan: native - network: 192.168.11.0 # Untagged, 'PXE/Admin' on wiki, different IP - mask: 24 - mgmt: - interface: 0 - vlan: 300 - network: 10.167.4.0 # Tagged, 'vlan 300' on wiki - ip-range: 10.167.4.10-10.167.4.254 # Some IPs are in use by lab infra - mask: 24 - storage: - interface: 3 - vlan: 301 - network: 10.2.0.0 # Tagged, not the same with 'storage' on wiki - mask: 24 - private: - interface: 1 - vlan: 1000 - network: 10.1.0.0 # Tagged, not the same with 'private' on wiki - mask: 24 - public: - interface: 2 - vlan: native - network: 172.30.10.0 # Untagged, 'public' on wiki - ip-range: 172.30.10.100-172.30.10.254 # Some IPs are in use by lab infra - mask: 24 - gateway: 172.30.10.1 - dns: - - 8.8.8.8 - - 8.8.4.4 - fuel: - jumphost: - bridges: - admin: 'pxebr' - mgmt: 'br-ctl' - private: ~ - public: ~ - network: - node: - # Ordered-list, index should be in sync with node index in PDF - - interfaces: &interfaces - # Ordered-list, index should be in sync with interface index in PDF - - 'enp6s0' - - 'enp7s0' - - 'enp8s0' - - 'enp9s0' - busaddr: &busaddr - # Bus-info reported by `ethtool -i ethX` - - '0000:06:00.0' - - '0000:07:00.0' - - '0000:08:00.0' - - '0000:09:00.0' - - interfaces: *interfaces - busaddr: *busaddr - - interfaces: *interfaces - busaddr: *busaddr - - interfaces: *interfaces - busaddr: *busaddr - - interfaces: *interfaces - busaddr: *busaddr diff --git a/mcp/config/labs/local/idf-virtual1.yaml b/mcp/config/labs/local/idf-virtual1.yaml deleted file mode 100644 index 402af9852..000000000 --- a/mcp/config/labs/local/idf-virtual1.yaml +++ /dev/null @@ -1,103 +0,0 @@ -############################################################################## -# Copyright (c) 2018 Ericsson AB, Mirantis Inc., 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 -############################################################################## ---- -### Fuel@OPNFV sample VIRTUAL installer descriptor file ### - -idf: - version: 0.0 # Intentionally invalid to indicate this is experimental - net_config: - # NOTE: Network names are likely to change after the PDF spec is updated - oob: - interface: 0 - ip-range: ~ - vlan: native - # All networks (except OOB) are virtual networks managed by `libvirt` - # Interface indexes are based on Fuel installer defaults - admin: - interface: 0 # when used, will be first vnet interface, untagged - vlan: native - network: 192.168.11.0 - mask: 24 - mgmt: - interface: 1 # when used, will be second vnet interface, untagged - vlan: native - network: 172.16.10.0 - ip-range: 172.16.10.10-172.16.10.254 # Some IPs are in use by lab infra - mask: 24 - storage: - interface: 4 # when used, will be fifth vnet interface, untagged - vlan: native - network: 192.168.20.0 - mask: 24 - private: - interface: 2 # when used, will be third vnet interface, untagged - vlan: 1000-1999 - network: 10.1.0.0 - mask: 24 - public: - interface: 3 # when used, will be fourth vnet interface, untagged - vlan: native - network: 10.16.0.0 - ip-range: 10.16.0.100-10.16.0.254 # Some IPs are in use by lab infra - mask: 24 - gateway: 10.16.0.1 - dns: - - 8.8.8.8 - - 8.8.4.4 - fuel: - jumphost: - bridges: - admin: ~ - mgmt: ~ - private: ~ - public: ~ - network: - ntp_strata_host1: 1.se.pool.ntp.org - ntp_strata_host2: 0.se.pool.ntp.org - node: - # Ordered-list, index should be in sync with node index in PDF - - interfaces: &interfaces - # Ordered-list, index should be in sync with interface index in PDF - - 'ens3' - - 'ens4' - - 'ens5' - - 'ens6' - busaddr: &busaddr - # Bus-info reported by `ethtool -i ethX` - - '0000:00:03.0' - - '0000:00:04.0' - - '0000:00:05.0' - - '0000:00:06.0' - - interfaces: *interfaces - busaddr: *busaddr - - interfaces: *interfaces - busaddr: *busaddr - - interfaces: *interfaces - busaddr: *busaddr - - interfaces: *interfaces - busaddr: *busaddr - reclass: - node: - - compute_params: &compute_params - common: &compute_params_common - compute_hugepages_size: 2M - compute_hugepages_count: 2048 - compute_hugepages_mount: /mnt/hugepages_2M - dpdk: - <<: *compute_params_common - compute_dpdk_driver: uio - compute_ovs_pmd_cpu_mask: "0x6" - compute_ovs_dpdk_socket_mem: "1024" - compute_ovs_dpdk_lcore_mask: "0x8" - compute_ovs_memory_channels: "2" - dpdk0_driver: igb_uio - dpdk0_n_rxq: 2 - - compute_params: *compute_params - - compute_params: *compute_params - - compute_params: *compute_params - - compute_params: *compute_params diff --git a/mcp/config/labs/local/pod1.yaml b/mcp/config/labs/local/pod1.yaml deleted file mode 100644 index 219b2a683..000000000 --- a/mcp/config/labs/local/pod1.yaml +++ /dev/null @@ -1,199 +0,0 @@ -############################################################################## -# Copyright (c) 2018 Linux Foundation, 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 -############################################################################## ---- -### LF POD 2 descriptor file ### - -version: 1.0 -details: - pod_owner: Trevor Bramwell - contact: tbramwell@linuxfoundation.org - lab: LF Pharos Lab - location: Portland - type: production - link: https://wiki.opnfv.org/display/pharos/LF+POD+2 -############################################################################## -jumphost: - name: pod2-jump - node: - type: baremetal - vendor: Cisco Systems Inc - model: UCSB-B200-M4 - arch: x86_64 - cpus: 2 - cpu_cflags: haswell - cores: 8 - memory: 128G - disks: &disks - - name: 'disk1' - disk_capacity: 2400G - disk_type: hdd - disk_interface: sas - disk_rotation: 0 - os: centos-7 - remote_params: &remote_params - type: ipmi - versions: - - 2.0 - user: admin - pass: octopus - remote_management: - <<: *remote_params - address: 172.30.8.83 - mac_address: "a8:9d:21:c9:c4:9e" - interfaces: - - mac_address: "00:25:b5:a0:00:1a" - speed: 40gb - features: 'dpdk|sriov' - address: 192.168.11.1 - name: 'nic1' - - mac_address: "00:25:b5:a0:00:1b" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic2' - - mac_address: "00:25:b5:a0:00:1c" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic3' - - mac_address: "00:25:b5:a0:00:1d" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic4' -############################################################################## -nodes: - - name: pod2-node1 - node: &nodeparams - type: baremetal - vendor: Cisco Systems Inc - model: UCSB-B200-M4 - arch: x86_64 - cpus: 2 - cpu_cflags: haswell - cores: 8 - memory: 32G - disks: *disks - remote_management: - <<: *remote_params - address: 172.30.8.75 - mac_address: "a8:9d:21:c9:8b:56" - interfaces: - - mac_address: "00:25:b5:a0:00:2a" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic1' - - mac_address: "00:25:b5:a0:00:2b" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic2' - - mac_address: "00:25:b5:a0:00:2c" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic3' - - mac_address: "00:25:b5:a0:00:2d" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic4' - ############################################################################ - - name: pod2-node2 - node: *nodeparams - disks: *disks - remote_management: - <<: *remote_params - address: 172.30.8.65 - mac_address: "a8:9d:21:c9:4d:26" - interfaces: - - mac_address: "00:25:b5:a0:00:3a" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic1' - - mac_address: "00:25:b5:a0:00:3b" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic2' - - mac_address: "00:25:b5:a0:00:3c" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic3' - - mac_address: "00:25:b5:a0:00:3d" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic4' - ############################################################################ - - name: pod2-node3 - node: *nodeparams - disks: *disks - remote_management: - <<: *remote_params - address: 172.30.8.74 - mac_address: "a8:9d:21:c9:3a:92" - interfaces: - - mac_address: "00:25:b5:a0:00:4a" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic1' - - mac_address: "00:25:b5:a0:00:4b" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic2' - - mac_address: "00:25:b5:a0:00:4c" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic3' - - mac_address: "00:25:b5:a0:00:4d" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic4' - ############################################################################ - - name: pod2-node4 - node: *nodeparams - disks: *disks - remote_management: - <<: *remote_params - address: 172.30.8.73 - mac_address: "74:a2:e6:a4:14:9c" - interfaces: - - mac_address: "00:25:b5:a0:00:5a" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic1' - - mac_address: "00:25:b5:a0:00:5b" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic2' - - mac_address: "00:25:b5:a0:00:5c" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic3' - - mac_address: "00:25:b5:a0:00:5d" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic4' - ############################################################################ - - name: pod2-node5 - node: *nodeparams - disks: *disks - remote_management: - <<: *remote_params - address: 172.30.8.72 - mac_address: "a8:9d:21:a0:15:9c" - interfaces: - - mac_address: "00:25:b5:a0:00:6a" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic1' - - mac_address: "00:25:b5:a0:00:6b" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic2' - - mac_address: "00:25:b5:a0:00:6c" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic3' - - mac_address: "00:25:b5:a0:00:6d" - speed: 40gb - features: 'dpdk|sriov' - name: 'nic4' diff --git a/mcp/config/labs/local/virtual1.yaml b/mcp/config/labs/local/virtual1.yaml deleted file mode 100644 index b293b9775..000000000 --- a/mcp/config/labs/local/virtual1.yaml +++ /dev/null @@ -1,127 +0,0 @@ -############################################################################## -# Copyright (c) 2018 Ericsson AB, Mirantis Inc., 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 -############################################################################## ---- -### Fuel@OPNFV sample VIRTUAL POD descriptor file ### -### NOTE: This is subject to change as vPDF is not yet officialy supported ### - -version: 0.0 # Intentionally invalid to indicate this is experimental -details: - pod_owner: Fuel@OPNFV - contact: Fuel@OPNFV - lab: Example Lab - location: Example Location - type: development - link: https://wiki.opnfv.org/display/pharos/ -############################################################################## -jumphost: - name: virtual1-jump - node: - type: baremetal - vendor: HP - model: ProLiant BL460c Gen8 - arch: x86_64 - cpus: 2 - cpu_cflags: ivybridge - cores: 10 - memory: 64G - disks: - - name: 'disk1' - disk_capacity: 800G - disk_type: hdd - disk_interface: scsi - disk_rotation: 15000 - os: ubuntu-16.04 - remote_management: - type: ipmi - versions: - - 1.0 - - 2.0 - user: changeme - pass: changeme - address: 0.0.0.0 - mac_address: "00:00:00:00:00:00" - interfaces: - - name: 'nic1' - speed: 10gb - features: 'dpdk|sriov' - mac_address: "00:00:00:00:00:00" - vlan: native - - name: 'nic2' - speed: 10gb - features: 'dpdk|sriov' - mac_address: "00:00:00:00:00:00" - vlan: native -############################################################################## -nodes: - - name: node-1 # noha ctl01 or ha (novcp) kvm01 - node: &nodeparams - # Fuel overrides certain params (e.g. cpus, mem) based on node role later - type: virtual - vendor: libvirt - model: virt - arch: x86_64 - cpus: 1 - cpu_cflags: ivybridge - cores: 8 - memory: 6G - disks: &disks - - name: 'disk1' - disk_capacity: 100G - disk_type: hdd - disk_interface: scsi # virtio-scsi - disk_rotation: 15000 - remote_management: &remotemgmt - type: libvirt - user: changeme - pass: changeme - address: 127.0.0.1 # Not used currently, will be 'qemu:///system' later - interfaces: &interfaces - - name: 'nic1' - speed: 10gb - features: 'dpdk|sriov' - mac_address: "00:00:00:00:00:00" # MACs will be assigned by libvirt - vlan: native - - name: 'nic2' - speed: 10gb - features: 'dpdk|sriov' - mac_address: "00:00:00:00:00:00" - vlan: native - - name: 'nic3' - speed: 10gb - features: 'dpdk|sriov' - mac_address: "00:00:00:00:00:00" - vlan: native - - name: 'nic4' - speed: 10gb - features: 'dpdk|sriov' - mac_address: "00:00:00:00:00:00" - vlan: native - ############################################################################ - - name: node-2 # noha gtw01 or ha (novcp) kvm02 - node: *nodeparams - disks: *disks - remote_management: *remotemgmt - interfaces: *interfaces - ############################################################################ - - name: node-3 # noha odl01 / unused or ha (novcp) kvm02 - node: *nodeparams - disks: *disks - remote_management: *remotemgmt - interfaces: *interfaces - ############################################################################ - - name: node-4 # cmp001 - node: *nodeparams - disks: *disks - remote_management: *remotemgmt - interfaces: *interfaces - ############################################################################ - - name: node-5 # cmp002 - node: *nodeparams - disks: *disks - remote_management: *remotemgmt - interfaces: *interfaces diff --git a/mcp/config/scenario/.gitignore b/mcp/config/scenario/.gitignore index 13346b908..0e5ba3d09 100644 --- a/mcp/config/scenario/.gitignore +++ b/mcp/config/scenario/.gitignore @@ -1 +1,2 @@ defaults.yaml +os-nosdn-nofeature-noha.yaml diff --git a/mcp/config/scenario/README.rst b/mcp/config/scenario/README.rst index e03182f11..0a5391637 100644 --- a/mcp/config/scenario/README.rst +++ b/mcp/config/scenario/README.rst @@ -1,22 +1,25 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. SPDX-License-Identifier: CC-BY-4.0 -.. (c) 2017 Mirantis Inc., Enea AB and others. +.. (c) 2018 Mirantis Inc., Enea AB and others. -Fuel@OPNFV Scenario Configuration +OPNFV Fuel Scenario Configuration ================================= -Abstract: ---------- +Abstract +-------- + This directory contains configuration files for different OPNFV deployment -feature scenarios used by Fuel@OPNFV, e.g.: +feature scenarios used by OPNFV Fuel, e.g.: - High availability configuration; - Type of SDN controller to be deployed; - OPNFV collaboration project features to be deployed; - Provisioning of any other sevices; -- POD configuration (baremetal, virtual); +- POD configuration (``baremetal``, ``virtual``); + +NOTES +----- -NOTES: ------- This directory is highly likely to change and/or be replaced/complemented -by the new PDF (Pod Descriptor File) info in Pharos OPNFV git repo. +by the new ``SDF`` (Scenario Descriptor File) info in Pharos OPNFV git repo +in upcoming OPNFV releases. diff --git a/mcp/config/scenario/defaults.yaml.j2 b/mcp/config/scenario/defaults.yaml.j2 index 141af4d26..48082a1dc 100644 --- a/mcp/config/scenario/defaults.yaml.j2 +++ b/mcp/config/scenario/defaults.yaml.j2 @@ -8,16 +8,10 @@ {%- import 'net_map.j2' as nm with context %} --- x86_64: - base_image: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img default: - vcpus: 2 - ram: 4096 - virtual: &arch_default_virtual_nodes_infra - nodes: - infra: -{%- if nm.cluster.has_baremetal_nodes %} - - mas01 -{%- endif %} + disks: 100G # ';'-separated list of disk drives to create + vcpus: 4 + ram: 8192 cluster: &arch_default_cluster_states states: - virtual_init @@ -28,44 +22,137 @@ x86_64: - virtual_control_plane {%- endif %} {%- endif %} - common: - apt: - keys: - - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub - repos: - # <repo name> <repo prio> deb [arch=<arch>] <repo url> <repo dist> <repo comp> - - saltstack 500 deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7 xenial main - pkg: - install: - - linux-generic-hwe-16.04 - - salt-minion - control: - apt: ~ - pkg: - install: - - cloud-init + ubuntu1804: + base_image: https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img + common: + repo: + keys: + - https://archive.repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub + repos: + # <repo name> <repo prio> deb [arch=<arch>] <repo url> <repo dist> <repo comp> + - saltstack 500 deb [arch=amd64] http://archive.repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7 bionic main + pkg: + install: + {%- if '-iec-' not in conf.MCP_DEPLOY_SCENARIO and conf.MCP_KERNEL_VER %} + - linux-image-{{ conf.MCP_KERNEL_VER }}-generic + - linux-headers-{{ conf.MCP_KERNEL_VER }}-generic + {%- endif %} + - salt-minion + - ifupdown + - cloud-init + - dnsmasq + control: + repo: ~ + pkg: + install: + - cloud-init + ubuntu1604: + base_image: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img + common: + repo: + keys: + - https://archive.repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub + repos: + # <repo name> <repo prio> deb [arch=<arch>] <repo url> <repo dist> <repo comp> + - saltstack 500 deb [arch=amd64] http://archive.repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7 xenial main + pkg: + install: + - linux-generic-hwe-16.04 + - salt-minion + control: + repo: ~ + pkg: + install: + - cloud-init + centos7: + base_image: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 + common: + repo: + keys: + - https://archive.repo.saltstack.com/yum/redhat/$releasever/x86_64/2017.7/SALTSTACK-GPG-KEY.pub + repos: + # <repo name> <repo prio> rpm <repo url> + - saltstack 0 rpm https://archive.repo.saltstack.com/yum/redhat/$releasever/x86_64/2017.7 + pkg: + install: + - salt-minion + - epel-release + - git + control: + repo: ~ + pkg: + install: + - cloud-init aarch64: - base_image: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img default: + disks: 100G # ';'-separated list of disk drives to create vcpus: 6 ram: 4096 - virtual: *arch_default_virtual_nodes_infra cluster: *arch_default_cluster_states - common: - apt: - keys: - - https://linux.enea.com/mcp-repos/queens/xenial/archive-mcpqueens.key - - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub - repos: - # <repo name> <repo prio> deb [arch=<arch>] <repo url> <repo dist> <repo comp> - - saltstack 500 deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7 xenial main - - armband_3 1201 deb [arch=arm64] http://linux.enea.com/mcp-repos/queens/xenial queens-armband main - pkg: - install: - - python-futures - - salt-minion - control: - apt: ~ - pkg: - install: - - cloud-init + ubuntu1804: + base_image: https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-arm64.img + common: + repo: + keys: + - https://archive.repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub + repos: + # <repo name> <repo prio> deb [arch=<arch>] <repo url> <repo dist> <repo comp> + - saltstack 500 deb [arch=amd64] http://archive.repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7 bionic main + pkg: + install: + {%- if '-iec-' not in conf.MCP_DEPLOY_SCENARIO and conf.MCP_KERNEL_VER %} + - linux-image-{{ conf.MCP_KERNEL_VER }}-generic + - linux-headers-{{ conf.MCP_KERNEL_VER }}-generic + {%- endif %} + - salt-minion + - ifupdown + - cloud-init + - dnsmasq + control: + repo: ~ + pkg: + install: + - cloud-init + ubuntu1604: + base_image: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img + common: + repo: + keys: + - https://linux.enea.com/mcp-repos/rocky/xenial/archive-mcprocky.key + - https://archive.repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub + repos: + # <repo name> <repo prio> deb [arch=<arch>] <repo url> <repo dist> <repo comp> + - saltstack 500 deb [arch=amd64] http://archive.repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7 xenial main + - armband_3 1201 deb [arch=arm64] http://linux.enea.com/mcp-repos/rocky/xenial rocky-armband main + pkg: + install: + {%- if '-iec-' in conf.MCP_DEPLOY_SCENARIO %} + - linux-generic-hwe-16.04 + {%- endif %} + - python-futures + - salt-minion + control: + repo: ~ + pkg: + install: + - cloud-init + centos7: + base_image: https://cloud.centos.org/altarch/7/images/CentOS-7-aarch64-GenericCloud.qcow2.xz + common: + repo: + keys: + - https://archive.repo.saltstack.com/yum/redhat/$releasever/x86_64/2017.7/SALTSTACK-GPG-KEY.pub + repos: + # <repo name> <repo prio> rpm <repo url> + - openstack-rocky 0 rpm http://mirror.centos.org/altarch/$releasever/cloud/aarch64/openstack-rocky + - saltstack 0 rpm https://archive.repo.saltstack.com/yum/redhat/$releasever/x86_64/2017.7 + pkg: + install: + - salt-minion + - epel-release + - git + control: + repo: ~ + pkg: + install: + - cloud-init diff --git a/mcp/config/scenario/k8-calico-iec-noha.yaml b/mcp/config/scenario/k8-calico-iec-noha.yaml new file mode 100644 index 000000000..93f007ba9 --- /dev/null +++ b/mcp/config/scenario/k8-calico-iec-noha.yaml @@ -0,0 +1,27 @@ +############################################################################## +# Copyright (c) 2019 Mirantis Inc., 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 +############################################################################## +--- +cluster: + domain: mcp-iec-noha.local + states: + - akraino_iec +virtual: + nodes: + control: + - iec01 + - iec02 + - iec03 + iec01: + vcpus: 8 + ram: 10240 + iec02: + vcpus: 8 + ram: 10240 + iec03: + vcpus: 8 + ram: 10240 diff --git a/mcp/config/scenario/k8-calico-iec-vcp-noha.yaml b/mcp/config/scenario/k8-calico-iec-vcp-noha.yaml new file mode 100644 index 000000000..dc0c00bf6 --- /dev/null +++ b/mcp/config/scenario/k8-calico-iec-vcp-noha.yaml @@ -0,0 +1,28 @@ +############################################################################## +# Copyright (c) 2019 Mirantis Inc., 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 +############################################################################## +--- +cluster: + domain: mcp-iec-noha.local + states: + - virtual_control_plane + - akraino_iec +virtual: + nodes: + control: + - kvm01 + - kvm02 + - kvm03 + kvm01: + vcpus: 8 + ram: 10240 + kvm02: + vcpus: 8 + ram: 10240 + kvm03: + vcpus: 8 + ram: 10240 diff --git a/mcp/config/scenario/os-nosdn-vpp-noha.yaml b/mcp/config/scenario/k8-calico-nofeature-noha.yaml index e90300407..a47298409 100644 --- a/mcp/config/scenario/os-nosdn-vpp-noha.yaml +++ b/mcp/config/scenario/k8-calico-nofeature-noha.yaml @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2017 Mirantis Inc., Enea AB and others. +# Copyright (c) 2019 Mirantis Inc., 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 @@ -7,21 +7,22 @@ ############################################################################## --- cluster: - domain: mcp-vpp-noha.local + domain: mcp-k8s-calico-noha.local states: - - openstack_noha - - neutron_gateway - - networks + - kubernetes virtual: nodes: control: - ctl01 - - gtw01 compute: - cmp001 - cmp002 ctl01: - vcpus: 4 + vcpus: 8 ram: 14336 - gtw01: - ram: 2048 + cmp001: + vcpus: 6 + ram: 12288 + cmp002: + vcpus: 6 + ram: 12288 diff --git a/mcp/config/scenario/os-nosdn-vpp-ha.yaml b/mcp/config/scenario/os-nosdn-fdio-ha.yaml index 9e7ebc1e2..b010f7ab6 100644 --- a/mcp/config/scenario/os-nosdn-vpp-ha.yaml +++ b/mcp/config/scenario/os-nosdn-fdio-ha.yaml @@ -7,7 +7,7 @@ ############################################################################## --- cluster: - domain: mcp-vpp-ha.local + domain: mcp-fdio-ha.local states: - openstack_ha - networks @@ -38,8 +38,10 @@ virtual: vcpus: 4 ram: 14336 cmp001: + disks: 100G;100G vcpus: 4 - ram: 8192 + ram: 14336 cmp002: + disks: 100G;100G vcpus: 4 - ram: 8192 + ram: 14336 diff --git a/mcp/config/scenario/os-nosdn-nofeature-noha.yaml b/mcp/config/scenario/os-nosdn-fdio-noha.yaml index 46c8bddc1..64b4aaf57 100644 --- a/mcp/config/scenario/os-nosdn-nofeature-noha.yaml +++ b/mcp/config/scenario/os-nosdn-fdio-noha.yaml @@ -7,7 +7,7 @@ ############################################################################## --- cluster: - domain: mcp-ovs-noha.local + domain: mcp-fdio-noha.local states: - openstack_noha - neutron_gateway @@ -24,32 +24,37 @@ virtual: vcpus: 4 ram: 14336 gtw01: - ram: 2048 + vcpus: 8 + ram: 14336 + cpu_topology: + sockets: 1 + cores: 4 + threads: 2 + numa: + cell0: + memory: 14680064 + cpus: 0-7 cmp001: + disks: 100G;100G vcpus: 8 - ram: 16384 + ram: 14336 cpu_topology: - sockets: 2 - cores: 2 + sockets: 1 + cores: 4 threads: 2 numa: cell0: - memory: 8388608 - cpus: 0-3 - cell1: - memory: 8388608 - cpus: 4-7 + memory: 14680064 + cpus: 0-7 cmp002: + disks: 100G;100G vcpus: 8 - ram: 16384 + ram: 14336 cpu_topology: - sockets: 2 - cores: 2 + sockets: 1 + cores: 4 threads: 2 numa: cell0: - memory: 8388608 - cpus: 0-3 - cell1: - memory: 8388608 - cpus: 4-7 + memory: 14680064 + cpus: 0-7 diff --git a/mcp/config/scenario/os-nosdn-nofeature-ha.yaml b/mcp/config/scenario/os-nosdn-nofeature-ha.yaml index ce79b838e..d06d2ae0b 100644 --- a/mcp/config/scenario/os-nosdn-nofeature-ha.yaml +++ b/mcp/config/scenario/os-nosdn-nofeature-ha.yaml @@ -35,8 +35,10 @@ virtual: vcpus: 4 ram: 14336 cmp001: + disks: 100G;100G vcpus: 4 ram: 8192 cmp002: + disks: 100G;100G vcpus: 4 ram: 8192 diff --git a/mcp/config/scenario/os-nosdn-nofeature-noha.yaml.j2 b/mcp/config/scenario/os-nosdn-nofeature-noha.yaml.j2 new file mode 100644 index 000000000..a1f0ddaa6 --- /dev/null +++ b/mcp/config/scenario/os-nosdn-nofeature-noha.yaml.j2 @@ -0,0 +1,52 @@ +############################################################################## +# Copyright (c) 2017 Mirantis Inc., 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 +############################################################################## +{%- import 'net_map.j2' as nm with context %} +--- +cluster: + domain: mcp-ovs-noha.local + states: + - openstack_noha + - neutron_gateway + - networks +virtual: + nodes: + control: + - ctl01 + - gtw01 + compute: + - cmp001 + - cmp002 + ctl01: + disks: {{ conf.nodes[nm.ctl01.idx].disks | map(attribute='disk_capacity') | join(';') }} + vcpus: 4 + ram: 14336 + gtw01: + ram: 2048 +{%- if nm.cmp001.idx < conf.nodes | length %} + {%- set cmp_node = conf.nodes[nm.cmp001.idx].node %} + {%- set cmp_ram = ([16384, ('%.0f' | format((cmp_node.memory | storage_size_num | float) * 1024 / 1000000000) | int)] | sort)[-1] %} + {%- set cmp_sockets = ([2, cmp_node.cpus | int] | sort)[-1] %} + {%- set cmp_threads = 2 %} + {%- set cmp_cores = ([2, ('%.0f' | format((cmp_node.cores | float) / cmp_threads)) | int] | sort)[-1] %} + {%- for cmpi in range(1, 3) %} + cmp00{{ cmpi }}: + disks: {{ conf.nodes[nm.cmp001.idx].disks | map(attribute='disk_capacity') | join(';') }} + vcpus: {{ cmp_sockets * cmp_cores * cmp_threads }} + ram: {{ cmp_ram }} + cpu_topology: + sockets: {{ cmp_sockets }} + cores: {{ cmp_cores }} + threads: {{ cmp_threads }} + numa: + {%- for ci in range(0, cmp_sockets) %} + cell{{ ci }}: + memory: {{ '%.0f' | format((cmp_ram | float) * 1024 / cmp_sockets) }} + cpus: {{ cmp_cores * cmp_threads * (ci | int) }}-{{ cmp_cores * cmp_threads * (ci | int + 1) - 1 }} + {%- endfor %} + {%- endfor %} +{%- endif %} diff --git a/mcp/config/scenario/os-nosdn-onap-ha.yaml b/mcp/config/scenario/os-nosdn-onap-ha.yaml new file mode 100644 index 000000000..653599f6c --- /dev/null +++ b/mcp/config/scenario/os-nosdn-onap-ha.yaml @@ -0,0 +1,48 @@ +############################################################################## +# Copyright (c) 2018 Mirantis Inc., Enea AB, Tieto 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 +############################################################################## +# Scenario details: +# Specific scenario for ONAP deployment on top of OPNFV +# Scenario is based on generic os-nosdn-nofeature-ha scenario +# Responsible: Auto project +--- +cluster: + domain: mcp-ovs-ha.local + states: + - openstack_ha + - networks + - onap +virtual: + nodes: + control: + - kvm01 + - kvm02 + - kvm03 + compute: + - cmp001 + - cmp002 + # Below values are only used for each node if said node is virtual + mas01: + vcpus: 4 + ram: 6144 + kvm01: + vcpus: 4 + ram: 14336 + kvm02: + vcpus: 4 + ram: 14336 + kvm03: + vcpus: 4 + ram: 14336 + cmp001: + disks: 100G;100G + vcpus: 32 + ram: 102400 + cmp002: + disks: 100G;100G + vcpus: 32 + ram: 102400 diff --git a/mcp/config/scenario/os-nosdn-onap-noha.yaml b/mcp/config/scenario/os-nosdn-onap-noha.yaml new file mode 100644 index 000000000..5a08a2cd6 --- /dev/null +++ b/mcp/config/scenario/os-nosdn-onap-noha.yaml @@ -0,0 +1,41 @@ +############################################################################## +# Copyright (c) 2017-2018 Mirantis Inc., Enea AB, Tieto 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 +############################################################################## +# Scenario details: +# Specific scenario for ONAP deployment on top of OPNFV +# Scenario is based on generic os-nosdn-nofeature-noha scenario +# Responsible: Auto project +--- +cluster: + domain: mcp-ovs-noha.local + states: + - openstack_noha + - neutron_gateway + - networks + - onap +virtual: + nodes: + control: + - ctl01 + - gtw01 + compute: + - cmp001 + - cmp002 + # Below values are only used for each node if said node is virtual + ctl01: + vcpus: 4 + ram: 16384 + gtw01: + ram: 2048 + cmp001: + disks: 100G;100G + vcpus: 36 + ram: 122880 + cmp002: + disks: 100G;100G + vcpus: 36 + ram: 122880 diff --git a/mcp/config/scenario/os-nosdn-ovs-ha.yaml b/mcp/config/scenario/os-nosdn-ovs-ha.yaml index 57f2140bb..72a55ea6f 100644 --- a/mcp/config/scenario/os-nosdn-ovs-ha.yaml +++ b/mcp/config/scenario/os-nosdn-ovs-ha.yaml @@ -9,7 +9,6 @@ cluster: domain: mcp-ovs-dpdk-ha.local states: - - dpdk - openstack_ha - networks virtual: @@ -36,8 +35,10 @@ virtual: vcpus: 4 ram: 14336 cmp001: + disks: 100G;100G vcpus: 4 - ram: 8192 + ram: 10240 cmp002: + disks: 100G;100G vcpus: 4 - ram: 8192 + ram: 10240 diff --git a/mcp/config/scenario/os-nosdn-ovs-noha.yaml b/mcp/config/scenario/os-nosdn-ovs-noha.yaml index 15cad1d29..b109200e1 100644 --- a/mcp/config/scenario/os-nosdn-ovs-noha.yaml +++ b/mcp/config/scenario/os-nosdn-ovs-noha.yaml @@ -9,7 +9,6 @@ cluster: domain: mcp-ovs-dpdk-noha.local states: - - dpdk - openstack_noha - neutron_gateway - networks @@ -22,13 +21,14 @@ virtual: - cmp001 - cmp002 ctl01: - vcpus: 4 ram: 14336 gtw01: - ram: 2048 + ram: 4096 cmp001: - vcpus: 4 - ram: 8192 + disks: 100G;100G + vcpus: 6 + ram: 14336 cmp002: - vcpus: 4 - ram: 8192 + disks: 100G;100G + vcpus: 6 + ram: 14336 diff --git a/mcp/config/scenario/os-odl-bgpvpn-noha.yaml b/mcp/config/scenario/os-odl-bgpvpn-noha.yaml index 1b2e2d0fb..a083e154e 100644 --- a/mcp/config/scenario/os-odl-bgpvpn-noha.yaml +++ b/mcp/config/scenario/os-odl-bgpvpn-noha.yaml @@ -24,16 +24,15 @@ virtual: - cmp001 - cmp002 ctl01: - vcpus: 4 ram: 14336 gtw01: + vcpus: 2 ram: 2048 odl01: - vcpus: 4 - ram: 16384 + ram: 6144 cmp001: - vcpus: 4 - ram: 16384 + disks: 100G;100G + ram: 12288 cmp002: - vcpus: 4 - ram: 16384 + disks: 100G;100G + ram: 12288 diff --git a/mcp/config/scenario/os-odl-nofeature-ha.yaml b/mcp/config/scenario/os-odl-nofeature-ha.yaml index 51d476de5..f295df2ec 100644 --- a/mcp/config/scenario/os-odl-nofeature-ha.yaml +++ b/mcp/config/scenario/os-odl-nofeature-ha.yaml @@ -36,8 +36,10 @@ virtual: vcpus: 4 ram: 14336 cmp001: + disks: 100G;100G vcpus: 4 ram: 8192 cmp002: + disks: 100G;100G vcpus: 4 ram: 8192 diff --git a/mcp/config/scenario/os-odl-nofeature-noha.yaml b/mcp/config/scenario/os-odl-nofeature-noha.yaml index 3133d0e62..1bb47bbc7 100644 --- a/mcp/config/scenario/os-odl-nofeature-noha.yaml +++ b/mcp/config/scenario/os-odl-nofeature-noha.yaml @@ -23,10 +23,13 @@ virtual: - cmp001 - cmp002 ctl01: - vcpus: 4 ram: 14336 gtw01: + vcpus: 2 ram: 2048 odl01: - vcpus: 4 - ram: 5120 + ram: 6144 + cmp001: + disks: 100G;100G + cmp002: + disks: 100G;100G diff --git a/mcp/config/scenario/os-odl-ovs-noha.yaml b/mcp/config/scenario/os-odl-ovs-noha.yaml index e2df6a476..d47ad9668 100644 --- a/mcp/config/scenario/os-odl-ovs-noha.yaml +++ b/mcp/config/scenario/os-odl-ovs-noha.yaml @@ -9,7 +9,6 @@ cluster: domain: mcp-odl-noha.local states: - - dpdk - opendaylight - openstack_noha - neutron_gateway @@ -24,16 +23,17 @@ virtual: - cmp001 - cmp002 ctl01: - vcpus: 4 ram: 14336 gtw01: - ram: 1024 + vcpus: 2 + ram: 2048 odl01: - vcpus: 4 - ram: 5120 + ram: 6144 cmp001: - vcpus: 4 - ram: 8192 + disks: 100G;100G + vcpus: 6 + ram: 14336 cmp002: - vcpus: 4 - ram: 8192 + disks: 100G;100G + vcpus: 6 + ram: 14336 diff --git a/mcp/config/scenario/os-odl-sfc-noha.yaml b/mcp/config/scenario/os-odl-sfc-noha.yaml index 8611b0261..735855433 100644 --- a/mcp/config/scenario/os-odl-sfc-noha.yaml +++ b/mcp/config/scenario/os-odl-sfc-noha.yaml @@ -24,10 +24,13 @@ virtual: - cmp001 - cmp002 ctl01: - vcpus: 4 ram: 14336 gtw01: + vcpus: 2 ram: 2048 odl01: - vcpus: 4 - ram: 5120 + ram: 6144 + cmp001: + disks: 100G;100G + cmp002: + disks: 100G;100G diff --git a/mcp/config/scenario/os-ovn-nofeature-ha.yaml b/mcp/config/scenario/os-ovn-nofeature-ha.yaml index f76b0dce4..69c5b9495 100644 --- a/mcp/config/scenario/os-ovn-nofeature-ha.yaml +++ b/mcp/config/scenario/os-ovn-nofeature-ha.yaml @@ -35,8 +35,10 @@ virtual: vcpus: 4 ram: 14336 cmp001: + disks: 100G;100G vcpus: 4 ram: 8192 cmp002: + disks: 100G;100G vcpus: 4 ram: 8192 diff --git a/mcp/config/scenario/os-ovn-nofeature-noha.yaml b/mcp/config/scenario/os-ovn-nofeature-noha.yaml index 0369f3fe9..e7ff2a7d8 100644 --- a/mcp/config/scenario/os-ovn-nofeature-noha.yaml +++ b/mcp/config/scenario/os-ovn-nofeature-noha.yaml @@ -19,11 +19,12 @@ virtual: - cmp001 - cmp002 ctl01: - vcpus: 4 ram: 14336 cmp001: - vcpus: 5 - ram: 8192 + disks: 100G;100G + vcpus: 6 + ram: 10240 cmp002: - vcpus: 5 - ram: 8192 + disks: 100G;100G + vcpus: 6 + ram: 10240 diff --git a/mcp/config/states/akraino_iec b/mcp/config/states/akraino_iec new file mode 100755 index 000000000..efe0d4df0 --- /dev/null +++ b/mcp/config/states/akraino_iec @@ -0,0 +1,62 @@ +#!/bin/bash -e +# shellcheck disable=SC1090 +############################################################################## +# Copyright (c) 2019 Mirantis Inc., 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 +############################################################################## + +CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x +SCRIPTS_DIR=$(dirname "${BASH_SOURCE[0]}")/../../scripts + +source "${SCRIPTS_DIR}/lib.sh" +source "${SCRIPTS_DIR}/xdf_data.sh" +source "${SCRIPTS_DIR}/globals.sh" + +IEC_REPO_URI='https://gerrit.akraino.org/r/iec' +IEC_USER_L='ubuntu' +# shellcheck disable=SC2154 +if [[ "${base_image}" =~ centos ]]; then + IEC_USER='centos' +else + IEC_USER=${IEC_USER_L} +fi +IEC_REPO_PATH=/var/lib/akraino/iec +IEC_SCRIPTS_PATH="${IEC_REPO_PATH}/src/foundation/scripts" + +POD_NETWORK_CIDR='100.100.0.0/16' # Avoid overlapping Fuel's PXE/admin net + +# shellcheck disable=SC2174 +mkdir -p -m 777 "$(dirname ${IEC_REPO_PATH})" +[ -e "${IEC_REPO_PATH}" ] || su - "${IEC_USER_L}" -c \ + "git clone '${IEC_REPO_URI}' '${IEC_REPO_PATH}'" +# shellcheck disable=SC2086 +wait_for 3.0 "! salt-cp 'iec*' -C '${IEC_REPO_PATH}/' \ + '$(dirname ${IEC_REPO_PATH})' | grep -e False" +salt -C 'iec*' cmd.run "chown -R ${IEC_USER}:${IEC_USER} ${IEC_REPO_PATH}" + +salt -C 'iec*' cmd.run runas="${IEC_USER}" "${IEC_SCRIPTS_PATH}/k8s_common.sh" + +IEC_MASTER_IP=$(salt --out txt -C 'iec* and *01*' pillar.get \ + _param:single_address | cut -d ' ' -f2) +salt -C 'iec* and *01*' cmd.run runas="${IEC_USER}" \ + stdin="$(sed -z 's/\n/\\n/g' "${SCRIPTS_DIR}/$(basename "${SSH_KEY}")")" \ + "mkdir -p .ssh && touch .ssh/id_rsa && chmod 600 .ssh/id_rsa && \ + cat > .ssh/id_rsa && \ + ${IEC_SCRIPTS_PATH}/k8s_master.sh ${IEC_MASTER_IP} ${POD_NETWORK_CIDR}" + +KUBE_NODE_CNT=$(salt --out txt -C 'iec* and *01*' cmd.run runas="${IEC_USER}" \ + 'kubectl get nodes | grep -c -e "^iec"' | cut -d ' ' -f2) +if [ "${KUBE_NODE_CNT}" != "$(salt-key | grep -c -e '^iec')" ]; then + KUBE_JOIN_CMD=$(salt --out txt -C 'iec* and *01*' cmd.run runas="${IEC_USER}" \ + 'kubeadm token create --print-join-command' | cut -d ' ' -f2-) + salt -C 'iec* and not *01*' cmd.run "${KUBE_JOIN_CMD}" +fi +salt -C 'iec* and *01*' cmd.run runas="${IEC_USER}" 'kubectl get nodes' + +salt -C 'iec* and *01*' cmd.run runas="${IEC_USER}" \ + "${IEC_SCRIPTS_PATH}/setup-cni.sh '' ${POD_NETWORK_CIDR}" +salt -C 'iec* and *01*' cmd.run runas="${IEC_USER}" "${IEC_SCRIPTS_PATH}/nginx.sh" +salt -C 'iec* and *01*' cmd.run runas="${IEC_USER}" "${IEC_SCRIPTS_PATH}/helm.sh" diff --git a/mcp/config/states/baremetal_init b/mcp/config/states/baremetal_init index 358e1874d..dcedfbeda 100755 --- a/mcp/config/states/baremetal_init +++ b/mcp/config/states/baremetal_init @@ -14,7 +14,6 @@ source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh" source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/xdf_data.sh" cluster_nodes_query="${control_nodes_query} or cmp*" -compute_nodes_query='cmp*' # KVM, compute node prereqs # patch the networking module for Debian based distros @@ -26,13 +25,16 @@ salt -C "${cluster_nodes_query}" file.replace $debian_ip_source \ pattern="^\s{8}__salt__\['pkg.install'\]\('vlan'\)" \ repl="\n if not __salt__['pkg.version']('vlan'):\n __salt__['pkg.install']('vlan')" -salt -C "${cluster_nodes_query}" pkg.install bridge-utils -salt -C "${control_nodes_query}" state.apply linux.network,linux.system.kernel +salt -C "${cluster_nodes_query}" state.apply linux.system.repo +salt -C "${cluster_nodes_query}" pkg.install force_yes=true bridge-utils,python-jinja2 +salt -C "${cluster_nodes_query}" service.restart salt-minion wait_for 5.0 "salt -C '${cluster_nodes_query}' state.apply salt.minion" -wait_for 5.0 "salt -C '${compute_nodes_query}' state.apply linux.system,linux.network" +salt -C "${cluster_nodes_query}" file.remove /etc/resolv.conf +salt -C "${cluster_nodes_query}" file.touch /etc/resolv.conf +wait_for 5.0 "salt -C '${cluster_nodes_query}' state.apply linux,ntp" wait_for 30.0 "salt -C '${cluster_nodes_query}' test.ping" -salt -C "${cluster_nodes_query}" system.reboot +salt -C "${cluster_nodes_query}" cmd.run 'reboot' wait_for 90.0 "salt -C '${cluster_nodes_query}' test.ping" salt -C "${cluster_nodes_query}" state.apply linux,ntp diff --git a/mcp/config/states/dpdk b/mcp/config/states/dpdk deleted file mode 100755 index 65832db84..000000000 --- a/mcp/config/states/dpdk +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -e -############################################################################## -# Copyright (c) 2017 Mirantis Inc., 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 -############################################################################## - -CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x - -# shellcheck disable=SC1090 -source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh" - -salt -I 'nova:compute' alternatives.set ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk -salt -I 'nova:compute' service.restart openvswitch-switch - -# Set datapath type to netdev for public bridge -salt -I 'nova:compute' cmd.run 'ovs-vsctl br-exists br-floating && ovs-vsctl set bridge br-floating datapath_type=netdev' ignore_retcode=True diff --git a/mcp/config/states/kubernetes b/mcp/config/states/kubernetes new file mode 100755 index 000000000..0894b10a6 --- /dev/null +++ b/mcp/config/states/kubernetes @@ -0,0 +1,39 @@ +#!/bin/bash -e +############################################################################## +# Copyright (c) 2019 Mirantis Inc., 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 +############################################################################## + +CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x + +# Create and distribute SSL certificates for services +salt-call state.sls salt.minion + +# Install etcd +salt -I 'etcd:server' state.sls etcd.server.service +salt -I 'etcd:server' cmd.run ". /var/lib/etcd/configenv && etcdctl cluster-health" + +# Install Kubernetes and Calico +salt -I 'kubernetes:master' state.sls kubernetes.master.kube-addons +salt -I 'kubernetes:pool' state.sls kubernetes.pool +salt -I 'kubernetes:pool' cmd.run "calicoctl node status" +salt -I 'kubernetes:pool' cmd.run "calicoctl get ippool" + +# Setup NAT for Calico +salt -I 'kubernetes:master' state.sls etcd.server.setup + +# Run whole master to check consistency +salt -I 'kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup + +# Register addons +salt -I 'kubernetes:master' state.sls kubernetes.master.setup + +# Upload config +K8S_CONFIG=kubernetes.config +K8S_HOST_ID=$(salt -I 'kubernetes:master' --out=yaml cp.push \ + /etc/kubernetes/admin-kube-config \ + upload_path="$K8S_CONFIG" | cut -d':' -f1) +cd /opt && ln -sf "/var/cache/salt/master/minions/${K8S_HOST_ID}/files/${K8S_CONFIG}" diff --git a/mcp/config/states/maas b/mcp/config/states/maas index f321b7160..28ef4cae0 100755 --- a/mcp/config/states/maas +++ b/mcp/config/states/maas @@ -1,7 +1,7 @@ #!/bin/bash -e -# shellcheck disable=SC1090,SC2155 +# shellcheck disable=SC1090 ############################################################################## -# Copyright (c) 2017 Mirantis Inc., Enea AB and others. +# Copyright (c) 2018 Mirantis Inc., 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 @@ -17,69 +17,18 @@ source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh" bm_nodes=$(salt --out yaml 'mas01*' pillar.get maas:region:machines | \ awk '/^\s+\w+[[:digit:]]+:$/ {gsub(/:$/, "*"); printf "%s ", $1}') -# Wait for MaaS commissioning/deploy to finish, retry on failure -function maas_fixup() { - local statuscmd="salt 'mas01*' --out yaml state.apply maas.machines.status" - local ncount=$(salt --out yaml 'mas01*' pillar.get maas:region:machines | \ - grep -cE '^\s{2}\w+:$') - - # wait_for has 10sec timeout * 96 = 16 min > 15min for Failed state - wait_for 96 "${statuscmd} | tee /dev/stderr | " \ - "grep -Eq '((Deployed|Ready): ${ncount}|status: (Failed|Allocated))'" - local statusout=$(eval "${statuscmd}") - - local fcnodes=$(echo "${statusout}" | \ - grep -Pzo 'status: Failed commissioning\n\s+system_id: \K.+\n') - local ftnodes=$(echo "${statusout}" | \ - grep -Pzo 'status: Failed testing\n\s+system_id: \K.+\n') - for node_system_id in ${fcnodes}; do - salt -C 'mas01*' state.apply maas.machines.delete \ - pillar="{'system_id': '${node_system_id}'}" - sleep 10 - done - for node_system_id in ${ftnodes}; do - salt -C 'mas01*' state.apply maas.machines.override_failed_testing \ - pillar="{'system_id': '${node_system_id}'}" - sleep 10 - done - if [ -n "${fcnodes}" ] || [ -n "${ftnodes}" ]; then - salt -C 'mas01*' state.apply maas.machines - return 1 - fi - - local fdnodes=$(echo "${statusout}" | \ - grep -Pzo 'status: (Failed deployment|Allocated)\n\s+system_id: \K.+\n') - local rnodes=$(echo "${statusout}" | \ - grep -Pzo 'status: Ready\n\s+system_id: \K.+\n') - for node_system_id in ${fdnodes}; do - salt -C 'mas01*' state.apply maas.machines.mark_broken_fixed \ - pillar="{'system_id': '${node_system_id}'}" - sleep 10 - done - if [ -n "${fdnodes}" ] || [ -n "${rnodes}" ]; then - salt -C 'mas01*' state.apply maas.machines.storage - salt -C 'mas01*' state.apply maas.machines.deploy - return 1 - fi - - return 0 -} +wait_for 60.0 "salt --out yaml -C 'mas01*' service.status maas-fixup | fgrep -q 'false'" # Optionally destroy MaaS machines from a previous run if [ "${ERASE_ENV}" -gt 1 ]; then - set +e; dnodes=$(salt 'mas01*' --out yaml state.apply maas.machines.status | \ - grep -Pzo '\s+system_id: \K.+\n'); set -e cleanup_uefi - for node_system_id in ${dnodes}; do - salt -C 'mas01*' state.apply maas.machines.delete \ - pillar="{'system_id': '${node_system_id}'}" - sleep 10 + for node_hostname in ${bm_nodes//\*/}; do + salt -C 'mas01*' maasng.delete_machine "${node_hostname}" || true done fi # MaaS rack/region controller, node commissioning -salt -C 'mas01*' state.apply linux,salt,openssh,ntp -salt -C 'mas01*' state.apply maas.pxe_nat +wait_for 10.0 "salt -C 'mas01*' state.apply salt,iptables" salt -C 'mas01*' state.apply maas.cluster wait_for 10 "salt -C 'mas01*' state.apply maas.region" @@ -94,11 +43,13 @@ salt-key --out yaml | awk '!/^(minions|- cfg01|- mas01)/ {print $2}' | \ xargs --no-run-if-empty -I{} salt-key -yd {} # MaaS node deployment -wait_for 10 maas_fixup - -salt -C 'mas01*' pillar.item\ - maas:region:admin:username \ - maas:region:admin:password +if [ -n "${bm_nodes}" ]; then + notify "[NOTE] MaaS operations might take a long time, please be patient" 2 + salt -C 'mas01*' state.apply maas.machines.wait_for_ready_or_deployed + salt -C 'mas01*' state.apply maas.machines.storage + salt -C 'mas01*' state.apply maas.machines.deploy + salt -C 'mas01*' state.apply maas.machines.wait_for_deployed +fi # Check all baremetal nodes are available wait_for 10.0 "(for n in ${bm_nodes}; do salt \${n} test.ping 2>/dev/null || exit; done)" diff --git a/mcp/config/states/onap b/mcp/config/states/onap new file mode 100755 index 000000000..d196074d9 --- /dev/null +++ b/mcp/config/states/onap @@ -0,0 +1,65 @@ +#!/bin/bash -e +############################################################################## +# Copyright (c) 2018 Tieto +# 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 +############################################################################## +# Deploy ONAP on top of OPNFV installed by Fuel/MCP +# ONAP installation is managed by OPNFV Auto project + +AUTO_INSTALL_DIR=/opt/auto +AUTO_REPO='https://gerrit.opnfv.org/gerrit/auto' +ONAP_INSTALL_SCRIPT='ci/deploy-onap-fuel.sh' + +echo "Clone Auto Repo" +salt -C 'I@nova:controller and *01*' cmd.run "\ + rm -rf $AUTO_INSTALL_DIR; \ + git clone $AUTO_REPO $AUTO_INSTALL_DIR" + +echo "ONAP installation starts at $(date)" +echo "It can take several hours to finish." + +# detect compute HW configuration, i.e. minimal values available across +# all compute nodes +CMP_COUNT=$(salt -C 'I@nova:compute' grains.get id --out txt | wc -l) +CMP_MIN_MEM=$(salt -C 'I@nova:compute' grains.get mem_total --out txt |\ + sed -re 's/^[^:]+: ([0-9]+)$/\1/g' | sort -n | head -n1) +CMP_MIN_CPUS=$(salt -C 'I@nova:compute' grains.get num_cpus --out txt |\ + sed -re 's/^[^:]+: ([0-9]+)$/\1/g' | sort -n | head -n1) +# check disk size for storage of instances; if shared storage is mounted, +# then return its size, otherwise sum up avalable space of root disk of all +# compute nodes +STORAGE_PATH='/var/lib/nova/instances' +MOUNT_COUNT=$(salt "cmp*" mount.is_mounted $STORAGE_PATH --out txt |\ + grep True | wc -l) +if [ $MOUNT_COUNT -eq $CMP_COUNT ] ; then + CMP_STORAGE_TOTAL=$(salt "cmp*" cmd.run "df -BGB $STORAGE_PATH" --out txt |\ + grep "$STORAGE_PATH" |\ + sed -re 's/^.* +([0-9]+)GB +([0-9]+GB +){2}.*$/\1/g' |\ + sort -n | head -n1) +else + CMP_STORAGE_TOTAL=0 + for STORAGE in $(salt "cmp*" cmd.run "df -BGB /" --out txt | grep '/$' |\ + sed -re 's/^.* +([0-9]+GB +){2}([0-9]+)GB +.*$/\2/g') ; do + CMP_STORAGE_TOTAL=$(($CMP_STORAGE_TOTAL+$STORAGE)); + done +fi + +# Deploy ONAP with detected configuration +# execute installation from the 1st controller node +CTL01=$(salt -C 'I@nova:controller and *01*' grains.get id --out txt |\ + head -n1 | cut -d':' -f1) +ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ + -i /root/fuel/mcp/scripts/mcp.rsa -l ubuntu $CTL01 "bash -s" <<COMMANDS + sudo -i + source /root/keystonercv3 + cd $AUTO_INSTALL_DIR + export CMP_COUNT=$CMP_COUNT + export CMP_MIN_MEM=$CMP_MIN_MEM + export CMP_MIN_CPUS=$CMP_MIN_CPUS + export CMP_STORAGE_TOTAL=$CMP_STORAGE_TOTAL + export AUTO_INSTALL_DIR=$AUTO_INSTALL_DIR + $ONAP_INSTALL_SCRIPT | tee $AUTO_INSTALL_DIR/auto_deploy.log +COMMANDS diff --git a/mcp/config/states/opendaylight b/mcp/config/states/opendaylight index de15d0cef..ae8b4cc92 100755 --- a/mcp/config/states/opendaylight +++ b/mcp/config/states/opendaylight @@ -14,8 +14,14 @@ source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh" # Get OpenDaylight server options with prefix odl_ function odl() { - salt --out txt -I 'opendaylight:server' pillar.get "opendaylight:server:odl_$1" | cut -d ' ' -f2 + salt --out txt -C 'I@opendaylight:server and *01*' pillar.get "opendaylight:server:odl_$1" | cut -d ' ' -f2 } wait_for 5.0 "salt -I 'opendaylight:server' state.sls opendaylight" wait_for 20 "salt --out yaml -C 'I@neutron:server and *01*' network.connect $(odl bind_ip) $(odl rest_port) | fgrep -q 'result: true'" + +# https://bugs.launchpad.net/networking-odl/+bug/1822559 +FILE=/usr/lib/python3/dist-packages/networking_odl/cmd/set_ovs_hostconfigs.py +PFILE=/var/tmp/odl_hostconfig.patch +salt -I 'linux:network:bridge:openvswitch' pkg.install python3-networking-odl +salt -I 'linux:network:bridge:openvswitch' cmd.run "patch -R -s --dry-run $FILE < $PFILE || patch $FILE < $PFILE" diff --git a/mcp/config/states/openstack_ha b/mcp/config/states/openstack_ha index 499c1d357..11da4e33a 100755 --- a/mcp/config/states/openstack_ha +++ b/mcp/config/states/openstack_ha @@ -15,8 +15,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh" wait_for 5.0 "salt -I 'keepalived:cluster' state.sls keepalived -b 1" wait_for 5.0 "salt -I 'keepalived:cluster' pillar.get keepalived:cluster:instance:VIP:address" -wait_for 5.0 "salt -C 'I@rabbitmq:server and *01*' state.sls rabbitmq" -salt -I 'rabbitmq:server' state.sls rabbitmq +wait_for 5.0 "salt -I 'rabbitmq:cluster:role:master' state.sls rabbitmq" +salt -I 'rabbitmq:cluster:role:slave' state.sls rabbitmq salt -I 'rabbitmq:server' cmd.run "rabbitmqctl cluster_status" salt -I 'glusterfs:server' state.sls glusterfs.server.service @@ -34,47 +34,68 @@ salt -I 'haproxy:proxy' state.sls haproxy salt -I 'haproxy:proxy' service.status haproxy salt -I 'haproxy:proxy' service.restart rsyslog -set +e; salt -I 'keystone:server' state.sls keystone.server -b 1; set -e +salt -I 'keystone:server:role:primary' state.sls keystone.server +salt -I 'keystone:server:role:secondary' state.sls keystone.server salt -I 'keystone:server' service.restart apache2 -salt -I 'keystone:server' state.sls keystone.server -b 1 wait_for 30.0 "salt -I 'keystone:client' state.sls keystone.client" salt -I 'keystone:server' cmd.run ". /root/keystonercv3; openstack service list" -salt -I 'glance:server' state.sls glance -b 1 -salt -I 'nova:controller' state.sls nova -b 1 -salt -I 'heat:server' state.sls heat -b 1 +salt -I 'glance:server:role:primary' state.sls glance +salt -I 'glance:server:role:secondary' state.sls glance +salt -I 'nova:controller:role:primary' state.sls nova +salt -I 'nova:controller:role:secondary' state.sls nova +salt -I 'heat:server:role:primary' state.sls heat +salt -I 'heat:server:role:secondary' state.sls heat -wait_for 5.0 "salt -I 'cinder:controller' state.sls cinder -b 1" +salt -I 'cinder:controller:role:primary' state.sls cinder +salt -I 'cinder:controller:role:secondary' state.sls cinder wait_for 3.0 "salt -I 'cinder:volume' state.sls cinder" -salt -I 'neutron:server' state.sls neutron -b 1 +salt -I 'neutron:server:role:primary' state.sls neutron +salt -I 'neutron:server:role:secondary' state.sls neutron salt -I 'neutron:gateway' state.sls neutron.gateway if salt 'cmp*' match.pillar 'neutron:compute:backend:engine:ovn' \ --out yaml --static | grep -q -e 'true' ; then salt -I 'neutron:compute' state.sls neutron.compute fi -salt -I 'nova:compute' state.sls nova -if salt -I 'nova:compute' match.grain 'cpuarch:aarch64' \ - --out yaml --static | grep -q -e 'true' ; then - salt -C 'G@cpuarch:aarch64 and I@nova:compute' state.sls armband -fi +salt -I 'nova:compute' state.sls nova,armband -salt -I 'barbican:server' state.sls barbican -b 1 +salt -I 'barbican:server:role:primary' state.sls barbican +salt -I 'barbican:server:role:secondary' state.sls barbican salt -I 'barbican:client' state.sls barbican +# remove config files coming from packages +for service in gnocchi panko; do + salt -I "${service}:server" pkg.install ${service}-api + salt -I "${service}:server" file.remove "/etc/apache2/sites-enabled/${service}-api.conf" +done + salt -I 'redis:cluster:role:master' state.sls redis salt -I 'redis:server' state.sls redis -salt -I 'gnocchi:server' state.sls gnocchi -b 1 -salt -I 'panko:server' state.sls panko -b 1 -salt -I 'aodh:server' state.sls aodh -b 1 +salt -I 'gnocchi:server:role:primary' state.sls gnocchi +salt -I 'gnocchi:server:role:secondary' state.sls gnocchi +salt -I 'panko:server:role:primary' state.sls panko +salt -I 'panko:server:role:secondary' state.sls panko +salt -I 'aodh:server:role:primary' state.sls aodh +salt -I 'aodh:server:role:secondary' state.sls aodh salt -I 'ceilometer:server' state.sls ceilometer salt -I 'ceilometer:agent' state.sls ceilometer -salt -I 'horizon:server' state.sls apache,horizon +wait_for 3.0 "salt -I 'horizon:server' state.sls apache,horizon" salt -I 'nginx:server' state.sls nginx +# Workaround Horizon missing CSS/JS, see FUEL-324 +if ! salt -C 'I@horizon:server and *01*' --out=yaml pkg.version openstack-dashboard | grep -qE ':.*mcp'; then + salt -I 'horizon:server' file.symlink \ + /var/lib/openstack-dashboard/static \ + /usr/share/openstack-dashboard/static + salt -I 'horizon:server' cmd.run "python3 /usr/share/openstack-dashboard/manage.py collectstatic --noinput" + salt -I 'horizon:server' cmd.run "python3 /usr/share/openstack-dashboard/manage.py compress --force" + salt -I 'horizon:server' service.reload apache2 +fi + cluster_public_host=$(salt -C 'I@nginx:server and *01*' --out=yaml \ pillar.get _param:cluster_public_host | awk '{print $2; exit}') dashboard_host=$(salt -C 'I@nginx:server and *01*' --out=yaml cp.push \ diff --git a/mcp/config/states/openstack_noha b/mcp/config/states/openstack_noha index 44360e5e9..6b503504b 100755 --- a/mcp/config/states/openstack_noha +++ b/mcp/config/states/openstack_noha @@ -23,17 +23,14 @@ salt -I 'mysql:server' state.sls mysql salt -I 'memcached:server' state.sls memcached salt -I 'haproxy:proxy' state.sls haproxy -set +e; salt -I 'keystone:server' state.sls keystone.server; set -e -salt -I 'keystone:server' service.restart apache2 salt -I 'keystone:server' state.sls keystone.server +salt -I 'keystone:server' service.restart apache2 salt -I 'keystone:server' state.sls keystone.client salt -I 'keystone:server' cmd.run ". /root/keystonercv3; openstack service list" salt -I 'glance:server' state.sls glance -# apply nova state twice to complete broken db sync -salt -I 'nova:controller' state.sls nova salt -I 'nova:controller' state.sls nova salt -I 'heat:server' state.sls heat @@ -41,18 +38,20 @@ salt -I 'heat:server' state.sls heat salt -I 'cinder:controller' state.sls cinder wait_for 3 "salt -I 'cinder:volume' state.sls cinder" -salt -I 'neutron:server' state.sls neutron +salt -I 'neutron:server' state.sls etcd,neutron salt -I 'neutron:compute' state.sls neutron -salt -I 'nova:compute' state.sls nova -if salt -I 'nova:compute' match.grain 'cpuarch:aarch64' \ - --out yaml --static | grep -q -e 'true' ; then - salt -C 'G@cpuarch:aarch64 and I@nova:compute' state.sls armband -fi +salt -I 'nova:compute' state.sls nova,armband salt -I 'barbican:server' state.sls barbican salt -I 'barbican:client' state.sls barbican +# remove config files coming from packages +for service in gnocchi panko; do + salt -I "${service}:server" pkg.install ${service}-api + salt -I "${service}:server" file.remove "/etc/apache2/sites-enabled/${service}-api.conf" +done + salt -I 'redis:server' state.sls redis salt -I 'gnocchi:server' state.sls gnocchi salt -I 'panko:server' state.sls panko @@ -60,4 +59,14 @@ salt -I 'aodh:server' state.sls aodh salt -I 'ceilometer:server' state.sls ceilometer salt -I 'ceilometer:agent' state.sls ceilometer -salt -I 'horizon:server' state.sls apache,horizon +salt -I 'horizon:server' state.sls apache,horizon,nginx + +# Workaround Horizon missing CSS/JS, see FUEL-324 +if ! salt -C 'I@horizon:server and *01*' --out=yaml pkg.version openstack-dashboard | grep -qE ':.*mcp'; then + salt -I 'horizon:server' file.symlink \ + /var/lib/openstack-dashboard/static \ + /usr/share/openstack-dashboard/static + salt -I 'horizon:server' cmd.run "python3 /usr/share/openstack-dashboard/manage.py collectstatic --noinput" + salt -I 'horizon:server' cmd.run "python3 /usr/share/openstack-dashboard/manage.py compress --force" + salt -I 'horizon:server' service.reload apache2 +fi diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane index ef6ce59c3..f2e861ac2 100755 --- a/mcp/config/states/virtual_control_plane +++ b/mcp/config/states/virtual_control_plane @@ -27,14 +27,10 @@ if [ "${ERASE_ENV}" -eq 1 ]; then fi # KVM libvirt first, VCP deployment -if salt -C 'kvm*' match.grain 'cpuarch:aarch64' \ - --out yaml --static | grep -q -e 'true' ; then - wait_for 5.0 "salt -C 'G@cpuarch:aarch64 and kvm*' state.sls armband" -fi -wait_for 5.0 "salt -C 'kvm*' state.sls libvirt" +wait_for 5.0 "salt -C 'kvm*' state.sls armband,libvirt" salt -C 'kvm* or cmp*' state.apply salt -wait_for 10.0 "salt -C 'kvm*' state.sls salt.control" +wait_for 10.0 "salt -C 'kvm*' state.sls salt.control,linux.system.kernel" vcp_nodes=$(salt --out yaml 'kvm01*' pillar.get salt:control:cluster:internal:node | \ awk '/\s+\w+[[:digit:]]+:$/ {gsub(/:$/, "*"); printf "%s ", $1}') @@ -52,13 +48,16 @@ cd /srv/salt/env/prd/maas/files && ln -sf \ salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' cp.get_file \ "salt://maas/files/$(basename "${APT_CONF_D_CURTIN}")" "${APT_CONF_D_CURTIN}" +salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' state.sls linux.system.repo +salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' pkg.install force_yes=true python-jinja2 +salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' service.restart salt-minion wait_for 10.0 "salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' state.apply salt" wait_for 10.0 "salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' state.apply linux,ntp" wait_for 10.0 "salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' ssh.set_auth_key ${SUDO_USER} \ $(awk 'NR==1{print $2}' "$(eval echo "~${SUDO_USER}/.ssh/authorized_keys")")" -salt -C 'prx*' system.reboot -wait_for 30.0 "salt -C 'prx*' test.ping" +salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' cmd.run 'reboot' +wait_for 30.0 "salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' test.ping" salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' pkg.upgrade refresh=False dist_upgrade=True diff --git a/mcp/config/states/virtual_init b/mcp/config/states/virtual_init index 46d880471..b5bb18955 100755 --- a/mcp/config/states/virtual_init +++ b/mcp/config/states/virtual_init @@ -17,7 +17,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/xdf_data.sh" CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x # shellcheck disable=SC2154,SC2086,SC2116 LOCAL_VIRT_NODES=$(echo ${virtual_nodes[*]}) # unquoted to filter space -[[ ! "${LOCAL_VIRT_NODES}" =~ mas01 ]] || LOCAL_VIRT_NODES='mas01' +[[ ! "${cluster_states[*]}" =~ maas ]] || LOCAL_VIRT_NODES='mas01' NODE_MASK="${LOCAL_VIRT_NODES// /|}" wait_for 5.0 "salt-call state.sls reclass,linux.network,salt.minion \ @@ -28,13 +28,16 @@ wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' saltutil.refresh_pillar" # Init specific to VMs on FN (all for virtual, mas for baremetal) wait_for 3.0 "(for n in ${LOCAL_VIRT_NODES}; do salt -C \${n}.* test.ping || exit; done)" +wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' saltutil.sync_all" +[[ ! "${NODE_MASK}" =~ mas01 ]] || exit 0 -wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.sls linux.system,linux.storage" -wait_for 2.0 "salt -C 'E@^(${NODE_MASK}).*' state.sls linux.network" -salt -C "E@^(${NODE_MASK}).*" system.reboot -wait_for 90.0 "salt -C 'E@^(${NODE_MASK}).*' test.ping" +if [[ "${base_image}" =~ centos ]]; then + # CentOS uses an older kernel, skip non-existing sysctl options + EXCLUDE_IDS="exclude='[{id: linux_kernel_net.core.netdev_budget_usecs}]'" +fi +wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.sls linux ${EXCLUDE_IDS}" wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' pkg.upgrade refresh=False dist_upgrade=True" -wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' saltutil.sync_all" -wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.apply salt" -wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.sls ntp" +salt -C "E@^(${NODE_MASK}).*" cmd.run 'reboot' +wait_for 90.0 "salt -C 'E@^(${NODE_MASK}).*' test.ping" +wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.apply salt,ntp" |