summaryrefslogtreecommitdiffstats
path: root/mcp/scripts
AgeCommit message (Collapse)AuthorFilesLines
2018-02-27[submodule] Bump Pharos git repo for IDF updatesAlexandru Avadanii1-0/+0
Change-Id: I8d526d51a3e18652c59bad9d7c3c384aa6583566 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-26[patch] cleanup: Drop LVM filter disableAlexandru Avadanii1-0/+0
Now we explicitly add a LVM PV on /dev/sda{1,2} for Cinder storage, so we can safely drop the patch disabling LVM volume filtering. If we later move the PV to a different disk, we can just add the VG and LV definitions to linux:storage via reclass, and Salt will skip setting them up (as they're already created by MaaS), yet keep the filtering sane. While at it, fix 'nova_cpu_pinning' param expr; constructs based on reclass interpolation (e.g. '${_param:x}') do not work when parameters are passed via reclass.storage templating, so change reclass interpolation syntax with classic YAML anchors. Fixes: 672ae12 Change-Id: Ieb41635ddeb630543d7e4d1079f45d636d9a43af Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-25[ovs/dpdk] Parameterize node-specific compute argsCristina Pauna1-0/+0
- node-specific parameters (nova pinning, hugepages, dpdk) should be configurable via IDF, on a per-node basis; - keep default settings for lf-pod2, with and without DPDK, override them for virtual deploys via local-virtual1 IDF; - leave neutron_tenant_* vars hardcoded for now, as they are required on both ctl and cmp nodes - this way we'll deal stricly with cmp params, so we can nicely pass them via config.yml to reclass per-node (and not per-role), allowing mixed computes later; - add compute params for ovs/odl-noha, preparing them for deployment on baremetal later. JIRA: ARMBAND-343 Change-Id: I89a58b9565679ab3882d85f07ae817690ae85c67 Signed-off-by: Cristina Pauna <cristina.pauna@enea.com>
2018-02-25[salt.sh] Add explicit apt-get updateAlexandru Avadanii1-0/+1
Change-Id: I17e66457f90818bad4d746300bb49e9d5179c239 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-22[noHA] Add dedicated cinder volume for virtual cmpAlexandru Avadanii1-0/+11
Replace loop device LVM-backed cinder volume with a dedicated /dev/vdb drive. This is another small step towards bringing noHA to baremetal. Change-Id: I80f9c2bee42e933a36ab7a8f9b4c5247d1652b42 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-22[HA] [cinder] Fix rootfs part name for sda > 2TBAlexandru Avadanii1-0/+0
On systems with more than 2TB on /dev/sda, MaaS automatically creates a 1MB partition with bios_grub label as /dev/sda1. Account for this and expect rootfs to reside on /dev/sda2 (assume all compute nodes have the same behavior wrt this issue). Ideally, later we will switch to explicit partitioning via MaaS, or to a new baremetal provisioner like Ironic. Requires bumping Pharos git submodule to pick up the new j2 filter. Fixes: f6f8a56 JIRA: FUEL-330 Change-Id: I12f5046cf69bf2f52c8b8dc331b90048df643646 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-20[salt.sh] Armband extra repo for forked reclassAlexandru Avadanii1-0/+5
- add Armband nightly/extra DEB repository; - install forked and updated reclass 1.5.2 which includes: * better error reporting; * support for deleting existing keys during list interpolation; * various other improvements and optimizations; While at it, update copyright year for patches. JIRA: FUEL-345 Change-Id: I00d8b625fe191648e7ea34b3dd4c8375691384e6 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-13Merge "[centos jump] Add more missing required packages"Alexandru Avadanii1-0/+2
2018-02-09[centos jump] Add more missing required packagesAlexandru Avadanii1-0/+2
- gcc is required for NBD kernel module build; - gdisk is required for resizing rootfs in nbd-mounted chroot; Change-Id: I8863c126b75ce3a15998c03d2d159f53f5006f5d Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-09Merge "[jump] Add simple check for required Linux bridges"Alexandru Avadanii1-3/+39
2018-02-09salt.sh: Fix one more broken online checkAlexandru Avadanii1-1/+1
Fixes: 5f95f52 Change-Id: I53e08a89b2e873829a78ff75c0f3532329ef87a3 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-07[virsh net] Fix virtual node check for public netAlexandru Avadanii1-4/+5
Jinja variables set inside loops do not live outside current iteration, so use a dictionary.update to work around that. Fixes: 3d2c66e Change-Id: I2bef64dddab080486a71952465edc4e528ae9e17 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-07[jump] Add simple check for required Linux bridgesAlexandru Avadanii1-3/+39
- MaaS requires PXE/admin to be a Linux bridge; - if virtual nodes are present, they should be hooked to a proper Linux bridge for the Public network, but only throw a warning if not (and create a mock public virsh network instead); - if both virtual and baremetal nodes are present, Public bridge is indirectly mandatory (we can't mock it); JIRA: FUEL-339 Change-Id: Idfe99d66c49eadc56cb3d94ca4db3467fb76d388 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-06[hybrid] Merge config/scenario/{baremetal,virtual}Alexandru Avadanii2-4/+0
Instead of classifying scenarios by underlying machine type, switch to HA/NOHA differentiantion only. This allows us to add support for hybrid scenarios (with some virtual and some baremetal nodes in the same cluster). To facilitate this, we will template the scenario files, which is a small step towards SDF (Scenario Descriptor File) definition and adoption later. JIRA: FUEL-338 Change-Id: If5787991869a3105d82c27ffa0a86ac79b4b08ba Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-06Add NOVCP HA OVS scenario (baremetal, virtual)Alexandru Avadanii2-6/+5
Add a new class of scenarios, based on existing baremetal HA scenarios, but instead of having a virtualized control plane (VCP), all Openstack controller services will run directly on the cluster nodes. This change adds the common scaffolding, as well as the OVS scenario. The new scenario(s) can be used on full-baremetal clusters, soon on full-virtual clusters and later on hybrid (virt + bare) clusters. This change defines old (current) style scenario definitions for both baremetal and virtual, both named: - os-nosdn-nofeature-novcp-ha; Prerequisites: 1. Merge-able by name reclass.storage.node definitions Each cluster (e.g. database, telemetry) adds its own set of reclass storage node defitions, which for novcp scenarios should be merged into a single node (kvm) based on the 'name' property. This is not currently supported by upstream reclass 'node.sls' high state, so add support for it via an early patch (required before salt-master-init.sh tries to handle reclass.storage). 2. common reclass classes for novcp Some of the classes in `baremetal-...-common-ha` are not fit for novcp as they define VCP-specific config/inheritance, so add new versions of said classes with novcp in mind or adapt old classes: - parameterize ctl hostname in `openstack_compute.yml`; - new `openstack_control_novcp.yml`; - new `openstack_init_novcp.yml`; 3. Handle hard set names in state files for baremetal nodes Some of our state files (e.g. maas) hardcodes baremetal node names to 'kvm', 'cmp', so we need to align the names in novcp scenario with these values to re-use the maas state. As a future improvement we should parameterize these names in all state files. As a consequence, our baremetal controller nodes will also use 'kvm*' hostnames (instead of 'ctl*'). 4. Add 'noifupdown' to all interfaces on kvm nodes to prevent duplicate IPs/routes created at *any* ifup due to /etc/network/route-br-ex. Patch salt-formula-linux to skip network restart on 'noifupdown', also when routes are present on that interface. JIRA: FUEL-310 Change-Id: Ic67778f63e5ee0334dbfe9547c7109ec1a938d61 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-06[virtual] Add missing ODL dhcp_intAlexandru Avadanii3-4/+9
- add missing network definitions for ODL node's 1st interface; - add missing comments for `notify` global functions; - fix or silence shellcheck issues; JIRA: FUEL-322 Change-Id: Ie3341d29ab12ddf432db603ad865259afb54714e Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-06[virsh net] public: rm addr cfg for pure baremetalAlexandru Avadanii1-0/+10
To prevent adding a gratuitous requirement on public being a real Linux bridge on the jumpserver when baremetal nodes are present, stop configuring any IP address information for the public virsh network, allowing us to keep mocking it like we did before L3 information was read from IDF. JIRA: FUEL-339 Change-Id: Id09ecac14825a80a0770c5969afad79b0235e08e Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-06Merge "[apt-mk] Switch back to nightly"Alexandru Avadanii1-1/+1
2018-02-06[apt-mk] Switch back to nightlyAlexandru Avadanii1-1/+1
Revert "salt: Use apt-mk 'stable' distribution" Revert "reclass: apt_mk_version: stable" This reverts commit d1b6119e288a31e015573363ce77790fec8684df. This reverts commit 4563ea7d62238e8273d840a8d9c6c1e179ca584e. Change-Id: I383db1f78a087045086096cbc674260b985fd913 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-06lib.sh: modprobe br_netfilter, don't bail on errAlexandru Avadanii1-4/+7
Some sysadmins or distro defaults might blacklist br_netfilter, or it might not be loaded at deploy start, account for these corner cases too. JIRA: FUEL-334 Change-Id: I3ca6cb3848df8d2af1625ff4e3816efe8b320886 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-05[virtual] PDF-based network defs for cluster nodesAlexandru Avadanii1-0/+3
Decouple virtual cluster nodes (ctl, gtw etc.) from opnfv_fn_* vars in favor of parsing PDF/IDF. This is the first step towards unifying baremetal and virtual network definition templates, as well as allowing virtual nodes to run on a remote hypervisor (and eventually with a different arch). opnfv_fn_* vars will still be used for infra VMs spawned on FN (cfg01 and optionally mas01). Adopt new 'net_map.j2' from Pharos submodule for new templates (virt), as well as old ones (baremetal). JIRA: FUEL-322 Change-Id: I150c2416566bbe42ea11cd00f12a8a7bf96776c2 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-05[virtual] Split 'pxebr' from 'mcpcontrol' netAlexandru Avadanii5-9/+55
- add new virsh managed network 'pxebr' (to mimic baremetal behavior on virtual PODs, this will be the equivalent of PXE/admin network); - connect 'pxebr' to 3rd interface for cfg01, mas01 for all deploys (used to be baremetal-specific), replacing 'internal'; - keep 'mcpcontrol' connected only to 'cfg01' (+ 'mas01' if present) for initial infrastructure bring-up (1st interface); - switch all virtual cluster nodes to 'pxebr' (1st interface); - use 'pxebr' for all Salt cluster nodes traffic, 'mcpcontrol' only for mas01<=>cfg01 Salt traffic; - convert <user-data.template> to jinja2 and expand it based on PDF instead of using `envsubst`; - split <user-data.sh.j2> into two versions, one for each network used for Salt traffic; - ci/deploy.sh: Read scenario data before template parsing for cluster domain variable, needed in virsh network def; - leave docs diagram refresh to later after all possible deploy types have settled; - limit keyserver proxy usage to nodes where the configured http proxy matches the first nameserver (true for all MaaS-provisioned nodes), so we can re-use the same pillar for FN VMs and baremetal nodes; - add PXE/admin IP on cfg01's 3rd interface and switch other vnodes `salt_master_host` to point to it; JIRA: FUEL-322 Change-Id: Ie4f7aedddf2ef81046f1127b377d88dce79f0fda Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-05[FN VM] Reboot VMs on jump, wait for all onlineAlexandru Avadanii1-10/+17
- apply `linux` state on cfg01 first, so PXE/admin IP is added and FN VM minions are available; - add barrier and wait for all FN VMs to register with cfg01; - use batch-mode execution while applying `linux.network` on FN VMs; - retry all states executed via <salt.sh> on FN VMs; JIRA: FUEL-310 Change-Id: I72e1c565370072500df1d486fe76e6315f583c75 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-05[PDF] Switch to generate_config, unify templatesAlexandru Avadanii6-8/+77
- move bash template handling (previously expanded via `envsubst`) to lib.sh; - move j2 template handling to lib.sh; - move virsh network templates to 'mcp/scripts/virsh_net' subdir; - switch virsh network templates from `envsubst` expansion to j2 and leverage generate_config.py, similar to PDF Fuel installer adapter; - add relevant runtime env vars (e.g. SALT_MASTER, MAAS_IP) on the fly to PDF, to consume them in templates like params coming from PDF; - parameterize virsh network definitions based on PDF (mgmt, public); JIRA: FUEL-322 Change-Id: Ib94e78fc4f25797b9354a0552e884104da5d0003 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-05deploy.sh: Move notify() to globals.shAlexandru Avadanii1-0/+28
Extend `notify` to 4 variants: - notify_i = inline (no newline) colored output; - notify = `notify_i` + trailing '\n'; - notify_n = `notify` + extra '\n' before and after; - notify_e = `notify` + stderr output + exit; This allows us to remove '\n' and cleanup the code a bit. While at it, fix some 'NOTE' messages going to stderr instead of stdout. Change-Id: I682e3344ae9e307c4a68ab31c7766bc91b12ee58 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-05[vPDF] Use local-virtual1, unify pkg requirementsAlexandru Avadanii2-16/+16
Until PDF/IDF land in Pharos for all our virtual PODs, use a common vPDF we already provide as an example to mimic the old hardcoded behavior while leveraging PDF/IDF parameterization. As a consequence, python requirements previously only needed for baremetal should now also be installed for virtual deploys too. JIRA: FUEL-322 Change-Id: Ied1c907275285a9086450a15491ae516a0db1be2 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-02Merge "deploy.sh: Disable net.bridge.bridge-nf-call"Michael Polenchuk1-0/+9
2018-02-02Revert "[FN VMs] remove graphics"Alexandru Avadanii1-2/+10
RHEL family virtualization tools reserve 02:00 PCI slot for VGA, even if 'nographics' is specified when creating the VM (in case the user wants to later hook a video card, which usually *requires* PCI slot2). Debian systems do not follow this rule (tested with libvirt 1.x, 2.x, 3.x), hence 1st NIC lands on PCI slot 2 (and get eth name 'ens2'). To align the behavior across all possible jumpserver distros, bring back the virtio video. This reverts commit 738f6c3b68d1179de1ff790f9e72c25f10874da4. Change-Id: Ifd855c12e04aec1ff0ab047b13f8081365741889 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-01deploy.sh: Disable net.bridge.bridge-nf-callAlexandru Avadanii1-0/+9
JIRA: FUEL-334 Change-Id: I6d2499053dcfb7f99593fcd5c948b569bdcb9c9b Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-02-01[baremetal] Allow MaaS timeouts to be set via IDFAlexandru Avadanii1-0/+0
Bump Pharos git submodule to pick up support for MaaS timeout parameterization, as well as new IDF for lf-pod2. Drop arch-specific MaaS timeouts, as they are now configurable on a per-POD basis. Sample usage (via IDF): idf: fuel: maas: # MaaS timeouts (in minutes) timeout_comissioning: 10 timeout_deploying: 15 Change-Id: I8fafa336b0bc64d705f6c2e40fc3dfb85672fb15 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-30[patch] Group APT calls for salt formula installAlexandru Avadanii1-2/+3
When installing salt-formula-* on cfg01, we used to call APT for each package. Instead, handle them all at once. While at it, stop using colored output on terminals that don't support it (e.g. 'vt220' used by OPNFV Jenkins). Change-Id: Ib8f2cee9638c43cdf648487bf05b07cd49802d3e Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-29Merge "[FN VMs] remove graphics"Alexandru Avadanii1-10/+2
2018-01-29Merge "[cfg01] apt.conf.d: Dpkg::Use-Pty: 0"Michael Polenchuk1-0/+1
2018-01-29[FN VMs] remove graphicsAlexandru Avadanii1-10/+2
Since VCP VMs (created via salt formula) do not have a video controller defined in their domain XMLs, network devices end on different PCI slots and hence have different names assigned (ens2+ vs foundation node VMs, which start with ens3). To align network interface names for VMs on jumpserver vs kvm nodes, and reduce confusion, remove the video controller from FN VMs. This allows some cleanup: - drop extra AArch64 args from virt-install; - unify 'opnfv_vcp_vm_*' and 'opnfv_fn_vm_*' variables; Change-Id: I0d108b00914b3eaaa03b67c652174f8ed4573118 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-28[cfg01] apt.conf.d: Dpkg::Use-Pty: 0Alexandru Avadanii1-0/+1
This will silence all 'Reading database ...' noise during Salt formula installation. Change-Id: I734d727194e276443db1e1581f40ec494562196e Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-25lib.sh: Reduce useless wget dot reportingAlexandru Avadanii1-1/+1
Downloading the base image (usually a few hundred MB) outputs a lot of useless dots to show progress. Switch to 1M per dot (from 1K). Change-Id: I8c525cad0b46e8ba3a7f6da4dd7f8277a49df91f Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-25Merge "Add support for different public network netmask"Alexandru Avadanii1-0/+7
2018-01-25Merge "[lab-config] Use Pharos submodule by default"Alexandru Avadanii1-0/+0
2018-01-24[lab-config] Use Pharos submodule by defaultAlexandru Avadanii1-0/+0
- switch from securedlab to pharos as lab-config structure; - accomodate the move net_config from PDF to IDF in j2 templates; Change-Id: Ib04e4fb384568a6efd9e78a080857b663521ae88 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-22Add support for different public network netmaskGuillermo Herrero1-0/+7
- Remove hardcoded /24 mask - Use PDF as source for public network, with reclass params: opnfv_net_public, _mask, _gw, _pool_start, _pool_end JIRA: FUEL-315 Change-Id: Idf3a4ed8f63f58fa90d9c1dcb7751ef3b1c9bd36 Signed-off-by: Guillermo Herrero <guillermo.herrero@enea.com>
2018-01-21reclass: apt_mk_version: stableAlexandru Avadanii1-1/+1
Although previous commit d1b6119 changed the first reference of apt-mk repos to 'stable' from 'nightly', it missed the cluster model. This fixes redeploys with `-f`, which fail due to conflicts between already installed 'stable' packages and 'nightly' ones. Fixes: d1b6119 Change-Id: I854bac86feaaa61da0b68d158e270eec1ee0ccb7 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-08Merge "[centos jump] Add missing dependency for nbd build"Alexandru Avadanii1-0/+1
2018-01-08[centos jump] Add missing dependency for nbd buildAlexandru Avadanii1-0/+1
Change-Id: Icb23d2e6d3bb6e49b54e2d51cc8a35cb03702fcd Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-08lib.sh: base image: Prevent using incomplete imgAlexandru Avadanii1-4/+4
In case the previous deploy attempt already copied the base image as the VCP image in order to perform offline operations and failed, leaving an incomplete image in place, current code might try to use it instead of building it from scratch. Use the hash-agnostic link names as checkpoints for successful image handling. Change-Id: I1e99e515e18ba1dec534c520811c127b2b528afe Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-08lib.sh: Fix `modprobe -f` on UbuntuAlexandru Avadanii1-3/+4
For some reason, `modprobe -f` for a clean nbd module (from vanilla Ubuntu) fails with exec format error randomly, while a simple `modprobe` works. Change-Id: I79785e510cab757e2482baf442054be984c24019 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-07lib.sh: Fix stop condition in wait_forAlexandru Avadanii1-5/+5
Change-Id: Ida693b6dd328db283d6992ac33500f4dd1a73eb8 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-07salt.sh: Fix linux state apply on cfg01Alexandru Avadanii1-4/+4
cfg01 does not repond or is not connected while trying to apply linux state via salt.sh, use wait_for macro to account for this. JIRA: ARMBAND-315 Change-Id: I2d4c63d43f806b65f9ce327f4a00a6334be88750 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-07lib.sh: Extend wait_for function to catch no respAlexandru Avadanii1-3/+11
wait_for function should be able to also check for minions that did not return or not respond, in addition to the return code. To keep it backwards compatible, condition the new check on the max attempt number being specified in decimal format (e.g. '10.0' unlike old '10'). Change-Id: If2512cf9121cdd795638efe7362ef0485d4e8d91 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-07user-data.template: Remove salt-minion installAlexandru Avadanii2-12/+1
salt-minion is now pre-provisioned inside the image using qemu-nbd. Revert "lib.sh: Limit envsubst to certain variables" This reverts commit 3a76d07dbd409b781abdb8520f55a1b20edf07db. Change-Id: Icceb8bcf439e28ab01c7731c3602c1113290454d Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2018-01-07lib.sh: Cache base image(s) between deploysAlexandru Avadanii1-13/+36
Fingerprint and re-use base image artifacts. Change-Id: Ic7a73c04e27d25addd50e4e9880619a0028956d3 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>