- virt-install --name ${node} \
- --ram ${vnodes_ram[$node]} --vcpus ${vnodes_vcpus[$node]} \
- --cpu host-passthrough --accelerate \
- --network network:pxe,model=virtio \
- --network network:mgmt,model=virtio \
- --network network:internal,model=virtio \
- --network network:public,model=virtio \
- --disk path=$(pwd)/images/mcp_${node}.qcow2,format=qcow2,bus=virtio,cache=none,io=native \
+ # prepare network args
+ net_args=" --network network=mcpcontrol,model=virtio"
+ if [ "${node}" = "mas01" ]; then
+ # MaaS node's 3rd interface gets connected to PXE/Admin Bridge
+ vnode_networks[2]="${vnode_networks[0]}"
+ fi
+ for net in "${vnode_networks[@]:1}"; do
+ net_type="network"
+ # in case of custom network, host should already have the bridge in place
+ if [ ! -f "net_${net}.xml" ]; then
+ net_type="bridge"
+ fi
+ net_args="${net_args} --network ${net_type}=${net},model=virtio"
+ done
+
+ # shellcheck disable=SC2086
+ virt-install --name "${node}" \
+ --ram "${vnodes_ram[$node]}" --vcpus "${vnodes_vcpus[$node]}" \
+ --cpu host-passthrough --accelerate ${net_args} \
+ --disk path="${image_dir}/mcp_${node}.qcow2",format=qcow2,bus=virtio,cache=none,io=native \