summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorRyota MIBU <r-mibu@cq.jp.nec.com>2017-01-25 08:18:09 +0000
committerRyota MIBU <r-mibu@cq.jp.nec.com>2017-01-25 10:41:29 +0000
commit5cb0ea7a1b2473a1969e48eff41ff50d540c53bd (patch)
tree05352557d23d4d688319800f3970cefb9eedacf2 /ci
parent719d8dcd66ddb05c0845276a1a2b8c03683def90 (diff)
bug fixes in 03-maasdeploy.sh
This patch includes the following fixes: - make the script pick the first 'system_id' from output of `maas machines create` - add missing parameter name in bootstrap machine creation - change file owner of ssh key files, so that maas user can access qemu via ssh - execute 'enablesubnetanddhcp()' Change-Id: Idf889425548760ec1d9a25458916d7c0d485d683 Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/03-maasdeploy.sh33
1 files changed, 24 insertions, 9 deletions
diff --git a/ci/03-maasdeploy.sh b/ci/03-maasdeploy.sh
index f84f5d6f..63d637a3 100755
--- a/ci/03-maasdeploy.sh
+++ b/ci/03-maasdeploy.sh
@@ -170,6 +170,8 @@ if [ ! -e ~maas/.ssh/id_rsa.pub ]; then
sudo -u maas mkdir ~maas/.ssh/ || true
sudo cp $HOME/id_rsa_maas ~maas/.ssh/id_rsa
sudo cp $HOME/id_rsa_maas.pub ~maas/.ssh/id_rsa.pub
+ sudo chown maas:maas ~maas/.ssh/id_rsa
+ sudo chown maas:maas ~maas/.ssh/id_rsa.pub
fi
# Ensure virsh can connect without ssh auth
@@ -301,6 +303,12 @@ addnodes(){
API_KEY=`sudo maas-region apikey --username=ubuntu`
maas login $PROFILE $API_SERVERMAAS $API_KEY
+ # make sure there is no machine entry in maas
+ for m in `maas $PROFILE machines read | grep system_id | cut -d '"' -f4 | sort | uniq`
+ do
+ maas ubuntu machine delete $m
+ done
+
if [ "$virtinstall" -eq 1 ]; then
ntew=virbr0
else
@@ -331,10 +339,11 @@ addnodes(){
fi
sudo virsh -c qemu:///system define --file bootstrap
- bootstrapid=`maas $PROFILE machines create autodetect_nodegroup='yes' name='bootstrap' \
- tags='bootstrap' hostname='bootstrap' power_type='virsh' $bootstrapmac \
+ bootstrap=`maas $PROFILE machines create autodetect_nodegroup='yes' name='bootstrap' \
+ tags='bootstrap' hostname='bootstrap' power_type='virsh' mac_addresses=$bootstrapmac \
power_parameters_power_address='qemu+ssh://'$USER'@'$MAAS_IP'/system' \
- architecture='amd64/generic' power_parameters_power_id='bootstrap' | grep system_id | cut -d '"' -f 4 `
+ architecture='amd64/generic' power_parameters_power_id='bootstrap'`
+ bootstrapid=`echo "$bootstrap" | grep -m1 'system_id' | cut -d '"' -f 4`
maas $PROFILE tag update-nodes bootstrap add=$bootstrapid
@@ -365,18 +374,21 @@ addnodes(){
sudo virsh -c qemu:///system define --file node5-compute
- controlnodeid=`maas $PROFILE machines create autodetect_nodegroup='yes' name='node1-control' \
+ controlnode=`maas $PROFILE machines create autodetect_nodegroup='yes' name='node1-control' \
tags='control' hostname='node1-control' power_type='virsh' mac_addresses=$node1controlmac \
power_parameters_power_address='qemu+ssh://'$USER'@'$MAAS_IP'/system' \
- architecture='amd64/generic' power_parameters_power_id='node1-control' | grep system_id | cut -d '"' -f 4 `
- computenode2id=`maas $PROFILE machines create autodetect_nodegroup='yes' name='node2-compute' \
+ architecture='amd64/generic' power_parameters_power_id='node1-control'`
+ controlnodeid=`echo "$controlnode" | grep -m1 'system_id' | cut -d '"' -f 4`
+ computenode2=`maas $PROFILE machines create autodetect_nodegroup='yes' name='node2-compute' \
tags='compute' hostname='node2-compute' power_type='virsh' mac_addresses=$node2computemac \
power_parameters_power_address='qemu+ssh://'$USER'@'$MAAS_IP'/system' \
- architecture='amd64/generic' power_parameters_power_id='node2-compute' | grep system_id | cut -d '"' -f 4 `
- computenode5id=`maas $PROFILE machines create autodetect_nodegroup='yes' name='node5-compute' \
+ architecture='amd64/generic' power_parameters_power_id='node2-compute'`
+ computenode2id=`echo "$computenode2" | grep -m1 'system_id' | cut -d '"' -f 4`
+ computenode5=`maas $PROFILE machines create autodetect_nodegroup='yes' name='node5-compute' \
tags='compute' hostname='node5-compute' power_type='virsh' mac_addresses=$node5computemac \
power_parameters_power_address='qemu+ssh://'$USER'@'$MAAS_IP'/system' \
- architecture='amd64/generic' power_parameters_power_id='node5-compute' | grep system_id | cut -d '"' -f 4 `
+ architecture='amd64/generic' power_parameters_power_id='node5-compute'`
+ computenode5id=`echo "$computenode5" | grep -m1 'system_id' | cut -d '"' -f 4`
maas $PROFILE tag update-nodes control add=$controlnodeid || true
maas $PROFILE tag update-nodes compute add=$compute2nodeid || true
@@ -385,6 +397,9 @@ addnodes(){
}
configuremaas
+if [ "$virtinstall" -eq 1 ]; then
+ enablesubnetanddhcp
+fi
addnodes
#sudo chown $USER:$USER environments.yaml