Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (16 sloc) 0.898 kb
#!/bin/bash
set -e
. @INVENTORY@
names=$(xe pif-list host-uuid="$INSTALLATION_UUID" management=false params=device VLAN=-1 --minimal | sed -e 's/,/+/g')
pifs=$(xe pif-list host-uuid="$INSTALLATION_UUID" management=false VLAN=-1 --minimal)
echo "Creating network associated with $names"
BOND_NET=$(xe network-create name-label="Pool-wide network associated with $names")
BOND=$(xe bond-create network-uuid=$BOND_NET pif-uuids="$pifs")
PIF=$(xe bond-list params=master uuid=$BOND --minimal)
xe pif-list host-uuid="$INSTALLATION_UUID" management=false VLAN=-1 --minimal | sed -e 's/,/\n/g' | while read PIF ; do
name=$(xe pif-param-get uuid=$PIF param-name=network-name-label)
VLAN_NR=$(( $RANDOM % 255 ))
echo "Creating $name vlan $VLAN_NR"
NET=$(xe network-create name-label="$name vlan $VLAN_NR")
VLAN=$(xe vlan-create network-uuid=$NET pif-uuid=$PIF vlan=$VLAN_NR)
done
Jump to Line
Something went wrong with that request. Please try again.