sudo apt-add-repository ppa:maas/stable -y
fi
if [ "bionic" != "$opnfvdistro" ]; then
- sudo apt-add-repository cloud-archive:pike -y
+ sudo apt-add-repository cloud-archive:queens -y
if [ "aarch64" == "$NODE_ARCTYPE" ]; then
- sudo add-apt-repository ppa:ubuntu-cloud-archive/pike-staging -y
+ sudo add-apt-repository ppa:ubuntu-cloud-archive/queens-staging -y
fi
fi
sudo virsh pool-start default || true
sudo virsh pool-autostart default || true
-# As we use kvm so setup network on admin network
-ADMIN_BR=`cat labconfig.json | jq '.opnfv.spaces[] | select(.type=="admin")'.bridge | cut -d \" -f 2 `
-sed -i "s@brAdm@$ADMIN_BR@" net.xml
-sudo virsh net-destroy default
-sudo virsh net-define net.xml
-sudo virsh net-start default
+if [ "$virtinstall" -eq 1 ]; then
+ sudo virsh net-dumpxml default > default-net-org.xml
+ sed -i '/dhcp/d' default-net-org.xml
+ sed -i '/range/d' default-net-org.xml
+ sudo virsh net-destroy default
+ sudo virsh net-define default-net-org.xml
+ sudo virsh net-start default
+ sudo virsh net-autostart default || true
+ rm -f default-net-org.xml
+else
+ # As we use kvm so setup network on admin network
+ ADMIN_BR=`cat labconfig.json | jq '.opnfv.spaces[] | select(.type=="admin")'.bridge | cut -d \" -f 2 `
+ sed -i "s@brAdm@$ADMIN_BR@" net.xml
+ sudo virsh net-destroy default || true
+ sudo virsh net-undefine default || true
+ sudo virsh net-define net.xml || true
+ sudo virsh net-autostart default || true
+ sudo virsh net-start default || true
+ sudo virsh net-autostart default || true
+fi
#
# Cleanup, juju init and config backup
maas $PROFILE maas set-config name=upstream_dns value=$MY_UPSTREAM_DNS || true
maas $PROFILE maas set-config name='maas_name' value=$MAAS_NAME || true
maas $PROFILE maas set-config name='ntp_server' value='ntp.ubuntu.com' || true
+ maas $PROFILE domain update 0 name=$MAAS_NAME || true
maas $PROFILE sshkeys create "key=$SSH_KEY" || true
for tag in bootstrap compute control storage
maas $PROFILE tags create name='opnfv-dpdk' comment='OPNFV DPDK enablement' \
kernel_opts='hugepagesz=2M hugepages=1024 hugepagesz=1G hugepages=20 default_hugepagesz=1G intel_iommu=on' || true
- maas $PROFILE package-repositories create name="Ubuntu Proposed new" \
- url="http://archive.ubuntu.com/ubuntu" components="main" \
- distributions="xenial-proposed" arches=amd64,i386
+ #maas $PROFILE package-repositories create name="Ubuntu Proposed new" \
+ # url="http://archive.ubuntu.com/ubuntu" components="main" \
+ # distributions="xenial-proposed" arches=amd64,i386
#create the required spaces.
maas $PROFILE space update 0 name=default || true
maas $PROFILE boot-source update $SOURCE_ID \
url=$URL keyring_filename=$KEYRING_FILE || true
+ maas $PROFILE boot-source-selections create 1 \
+ os="ubuntu" release="xenial" arches="amd64" \
+ labels="*" || true
+ maas $PROFILE boot-source-selections create 1 \
+ os="ubuntu" release="bionic" arches="amd64" \
+ labels="*" || true
+
if [ $NODE_ARCTYPE != "x86_64" ] ; then
- maas $PROFILE boot-source-selection update 1 1 arches="$NODE_ARCHES"
+ maas $PROFILE boot-source-selection update 1 1 arches="$NODE_ARCHES" || true
+ maas $PROFILE boot-source-selection update 1 2 arches="$NODE_ARCHES" || true
fi
if [ "$snapinstall" -eq "0" ]; then
done
fi
- maas $PROFILE pods create type=virsh power_address="$VIRSHURL" power_user=$USER
+ # Iterate to avoid "Conflict error" issue
+ for ii in 1 2 3 4 5 6 7 8 9 10
+ do
+ echo "Try $ii"
+ maas $PROFILE pods create type=virsh power_address="$VIRSHURL" power_user=$USER > /tmp/deploy.out 2>&1 || true
+ cat /tmp/deploy.out
+ if ! fgrep -q 'Conflict' /tmp/deploy.out
+ then
+ break
+ else
+ continue
+ fi
+ done
+
# Make sure nodes are added into MAAS and none of them is in commissioning state
i=0