[state] virtual_init: Limit to mas01 on baremetal 57/62657/4
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 20 Sep 2018 17:05:14 +0000 (19:05 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 20 Sep 2018 20:57:22 +0000 (22:57 +0200)
`virtual_init` state file tries to ping all FN VMs, but that won't
work on hybrid PODs since all FN VMs but mas01 require MaaS DHCP to
be already configured (i.e. FN VMs in question will be reset after
mas01 is fully configured).
Limit virtual node queries in `virtual_init` to mas01 VM, as the rest
of FN VMs will be handled via `baremetal_init` state.

While at it, move _param:apt_mk_version def to common reclass to
avoid an undef reference in NOHA hybrid deployments; set MCP_VCP to
0 for non-HA scenarios.

JIRA: FUEL-385

Change-Id: I582bca6864e9bfed23baf26f9b66e6e95e986c58
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
ci/deploy.sh
mcp/config/states/virtual_init
mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml.j2
mcp/reclass/classes/cluster/mcp-common-ha/infra/init.yml.j2
mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml.j2
mcp/scripts/docker-compose/docker-compose.yaml.j2
mcp/scripts/lib.sh

index 103f83b..8e9312d 100755 (executable)
@@ -278,6 +278,7 @@ generate_ssh_key
 export MAAS_SSH_KEY="$(cat "$(basename "${SSH_KEY}").pub")"
 
 # Expand jinja2 templates based on PDF data and env vars
+[[ "${DEPLOY_SCENARIO}" =~ -ha$ ]] || MCP_VCP=0
 export MCP_REPO_ROOT_PATH MCP_VCP MCP_STORAGE_DIR MCP_DOCKER_TAG MCP_CMP_SS \
        MCP_JUMP_ARCH=$(uname -i) MCP_DEPLOY_SCENARIO="${DEPLOY_SCENARIO}"
 do_templates_scenario "${MCP_STORAGE_DIR}" "${TARGET_LAB}" "${TARGET_POD}" \
index 47d69cd..46d8804 100755 (executable)
@@ -17,6 +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'
 NODE_MASK="${LOCAL_VIRT_NODES// /|}"
 
 wait_for 5.0 "salt-call state.sls reclass,linux.network,salt.minion \
index 15fbf28..eb0a538 100644 (file)
@@ -12,6 +12,8 @@ classes:
 parameters:
   _param:
     openstack_version: queens
+    apt_mk_version: nightly
+    mcp_repo_version: 1.1
 
     banner_company_name: OPNFV
 
index 59d75d4..05b96e4 100644 (file)
@@ -12,8 +12,6 @@ classes:
   # - cluster.mcp-common-ha.stacklight.client
 parameters:
   _param:
-    apt_mk_version: nightly
-    mcp_repo_version: 1.1
     salt_version: 2017.7
     cluster_domain: ${_param:cluster_name}.local
     # stacklight_environment: ${_param:cluster_domain}
index 875c760..5aae27c 100644 (file)
@@ -9,8 +9,6 @@
 ---
 parameters:
   _param:
-    apt_mk_version: nightly
-    mcp_repo_version: 1.1
     openstack_region: RegionOne
     admin_email: root@localhost
     cluster_public_protocol: http
index 7cd8455..a3119f9 100644 (file)
@@ -23,11 +23,13 @@ services:
        - {{ conf.MCP_REPO_ROOT_PATH }}:/root/fuel
        - {{ conf.MCP_REPO_ROOT_PATH }}/mcp/scripts/docker-compose/files/entrypoint.sh:/entrypoint.sh
        - {{ conf.MCP_STORAGE_DIR }}/pod_config.yml:/root/pod_config.yml
-       - {{ conf.MCP_STORAGE_DIR }}/base_image_opnfv_fuel_vcp.img:/srv/salt/env/prd/salt/files/control/images/base_image_opnfv_fuel_vcp.img
        - {{ conf.MCP_STORAGE_DIR }}/nodes:/srv/salt/reclass/nodes
        - {{ conf.MCP_STORAGE_DIR }}/pki:/etc/pki
        - {{ conf.MCP_STORAGE_DIR }}/salt:/etc/salt
        - {{ conf.MCP_STORAGE_DIR }}/hosts:/etc/hosts
+{%- if conf.MCP_VCP %}
+       - {{ conf.MCP_STORAGE_DIR }}/base_image_opnfv_fuel_vcp.img:/srv/salt/env/prd/salt/files/control/images/base_image_opnfv_fuel_vcp.img
+{%- endif %}
     hostname: cfg01
     domainname: {{ conf.cluster.domain }}
     privileged: true
index df35f37..3a99627 100644 (file)
@@ -270,7 +270,7 @@ function prepare_vms {
   if [ "${image_dir}/${_tmp}" -ef "${image_dir}/${image}" ]; then
     echo "[INFO] Patched base image found"
   else
-    rm -f "${image_dir}/${image%.*}"*
+    rm -rf "${image_dir}/${image%.*}"*
     if [[ ! "${repos_pkgs_str}" =~ ^\^+$ ]]; then
       echo "[INFO] Patching base image ..."
       cp "${image_dir}/${_o}" "${image_dir}/${_tmp}"