Some updates to fix build
fix typo for bridge_type fix network definitions for VMs remove the second disk from definition for asrock01
This commit is contained in:
parent
577be01157
commit
d2074bf788
@ -13,4 +13,4 @@ compute="as1-maas-node"
|
||||
disk_name=()
|
||||
disk_names+=(sda)
|
||||
disk_names+=(nvme0n1)
|
||||
disk_names+=(nvme1n1)
|
||||
#disk_names+=(nvme1n1)
|
||||
|
@ -50,7 +50,7 @@ maas_assign_networks()
|
||||
fi
|
||||
# Check to see if the bridge interface already exists, otherwise create it
|
||||
bridge_int=$(maas ${maas_profile} interfaces read ${system_id} | jq --argjson vlan ${vlan} '.[] | select(.vlan.vid == $vlan) | select(.type == "bridge")')
|
||||
[[ -z "${bridge_int}" ]] && bridge_int=$(maas ${maas_profile} interfaces create-bridge ${system_id} name=${bridges[$i]} vlan=$maas_vlan_id mac_address=${hypervisor_mac} parent=$vlan_int_id bridge_tyepe=${bridge_type})
|
||||
[[ -z "${bridge_int}" ]] && bridge_int=$(maas ${maas_profile} interfaces create-bridge ${system_id} name=${bridges[$i]} vlan=$maas_vlan_id mac_address=${hypervisor_mac} parent=$vlan_int_id bridge_type=${bridge_type})
|
||||
bridge_int_id=$(echo $bridge_int | jq -r .id)
|
||||
cur_mode=$(echo $bridge_int | jq -r ".links[].mode")
|
||||
# If the mode is already set correctly, then move on
|
||||
|
@ -350,13 +350,6 @@ build_vms() {
|
||||
net_type=(${networks[@]})
|
||||
fi
|
||||
|
||||
# Now define the network definition
|
||||
for ((net=0;net<${#net_type[@]};net++)); do
|
||||
network_spec+=" --network=$net_prefix="${net_type[$net]}",model=$nic_model"
|
||||
if [[ "${bridge_type}" == "ovs" ]] ; then
|
||||
network_spec+=",virtualport_type=openvswitch"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $juju_total -le $juju_count ]] ; then
|
||||
printf -v virt_node %s-%02d "$hypervisor_name-juju" "$juju_total"
|
||||
@ -365,7 +358,11 @@ build_vms() {
|
||||
vcpus="$juju_cpus"
|
||||
node_type="juju"
|
||||
|
||||
# Now define the network definition
|
||||
network_spec="--network=$net_prefix="${net_type[0]}",model=$nic_model"
|
||||
if [[ "${bridge_type}" == "ovs" ]] ; then
|
||||
network_spec+=",virtualport_type=openvswitch"
|
||||
fi
|
||||
|
||||
disk_spec="--disk path=$storage_path/$virt_node/$virt_node.img"
|
||||
disk_spec+=",format=$storage_format,size=${juju_disk},bus=$stg_bus,io=native,cache=directsync"
|
||||
@ -391,6 +388,14 @@ build_vms() {
|
||||
disk_count=1
|
||||
fi
|
||||
|
||||
# Now define the network definition
|
||||
for ((net=0;net<${#net_type[@]};net++)); do
|
||||
network_spec+=" --network=$net_prefix="${net_type[$net]}",model=$nic_model"
|
||||
if [[ "${bridge_type}" == "ovs" ]] ; then
|
||||
network_spec+=",virtualport_type=openvswitch"
|
||||
fi
|
||||
done
|
||||
|
||||
# Based on the disks array, it will create a definition to add these
|
||||
# disks to the VM
|
||||
disk_spec=""
|
||||
|
Loading…
x
Reference in New Issue
Block a user