do_sysctl_cfg
do_udev_cfg
create_vms "${MCP_STORAGE_DIR}" "${virtual_nodes_data}" "${OPNFV_BRIDGES[@]}"
- update_mcpcontrol_network
start_vms "${virtual_nodes[@]}"
fi
mcp.rsa*
-user-data.*.sh
+user-data.sh
xdf_data.sh
config:
- subnet: {{ net_mcpcontrol }}
gateway: {{ net_mcpcontrol | ipnet_hostaddr(1) }}
- ip_range: {{ [net_mcpcontrol | ipnet_hostaddr(2), conf.MCPCONTROL_PREFIX] | join("/") }}
+ ip_range: {{ [conf.SALT_MASTER, conf.MCPCONTROL_PREFIX] | join("/") }}
pxebr:
driver: macvlan
driver_opts:
#!/bin/bash -e
##############################################################################
-# Copyright (c) 2017 Ericsson AB, Mirantis Inc., Enea AB and others.
+# 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
# Derived from INSTALLER_IP
export MCPCONTROL_NET=${MCPCONTROL_NET:-${SALT_MASTER%.*}.0}
export MCPCONTROL_PREFIX=${MCPCONTROL_PREFIX:-24}
-export MAAS_IP=${MAAS_IP:-${SALT_MASTER%.*}.3}
# Derived from above global vars, not overideable
export SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${SSH_KEY}"
# Create config ISO and resize OS disk image for each foundation node VM
for node in "${vnodes[@]}"; do
- if [[ "${node}" =~ ^(cfg01|mas01) ]]; then
- user_data='user-data.mcp.sh'
- else
- user_data='user-data.admin.sh'
- fi
./create-config-drive.sh -k "$(basename "${SSH_KEY}").pub" \
- -u "${user_data}" -h "${node}" "${image_dir}/mcp_${node}.iso"
+ -u 'user-data.sh' -h "${node}" "${image_dir}/mcp_${node}.iso"
cp "${image_dir}/${image}" "${image_dir}/mcp_${node}.qcow2"
qemu-img resize "${image_dir}/mcp_${node}.qcow2" 100G
# Prepare dedicated drive for cinder on cmp nodes
done
}
-function update_mcpcontrol_network {
- # set static ip address for salt master node, MaaS node
- local amac=$(virsh domiflist mas01 2>&1| awk '/mcpcontrol/ {print $5; exit}')
- [ -z "${amac}" ] || virsh net-update "mcpcontrol" add ip-dhcp-host \
- "<host mac='${amac}' name='mas01' ip='${MAAS_IP}'/>" --live --config
-}
-
function reset_vms {
local vnodes=("$@")
local cmd_str="ssh ${SSH_OPTS} ${SSH_SALT}"
+++ /dev/null
-#!/bin/bash
-##############################################################################
-# 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
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-rm /etc/salt/minion_id
-rm -f /etc/salt/pki/minion/minion_master.pub
-echo "id: $(hostname).{{ conf.cluster.domain }}" > /etc/salt/minion
-echo "master: {{ conf.SALT_MASTER }}" >> /etc/salt/minion
-service salt-minion restart
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
{%- import 'net_map.j2' as nm with context %}
+{%- set infra_nodes = conf[conf.MCP_JUMP_ARCH].default.virtual.nodes.infra %}
rm /etc/salt/minion_id
rm -f /etc/salt/pki/minion/minion_master.pub
echo "id: $(hostname).{{ conf.cluster.domain }}" > /etc/salt/minion
-echo "master: {{ nm.net_admin | ipnet_hostaddr(nm.start_ip[nm.net_admin] + nm.net_admin_hosts.index('opnfv_infra_config_pxe_admin_address') +1) }}" >> /etc/salt/minion
+if [[ "{{ infra_nodes or [] | join(' ') }}" =~ $(hostname) ]]; then
+ echo "master: {{ conf.SALT_MASTER }}" >> /etc/salt/minion
+else
+ echo "master: {{ nm.net_admin | ipnet_hostaddr(nm.start_ip[nm.net_admin] + nm.net_admin_hosts.index('opnfv_infra_config_pxe_admin_address') +1) }}" >> /etc/salt/minion
+fi
service salt-minion restart
<forward mode="nat"/>
<ip address="{{ net_mcpcontrol | ipnet_hostaddr(1) }}" netmask="{{ net_mcpcontrol | ipnet_netmask }}">
<dhcp>
- <range start="{{ net_mcpcontrol | ipnet_hostaddr(2) }}" end="{{ net_mcpcontrol | ipnet_hostmax }}"/>
+ <range start="{{ net_mcpcontrol | ipnet_hostaddr(3) }}" end="{{ net_mcpcontrol | ipnet_hostmax }}"/>
</dhcp>
</ip>
</network>