fix onos charms for xenial.
[joid.git] / ci / openstack.sh
index 75bf115..f945dd6 100755 (executable)
@@ -19,6 +19,7 @@ if [ -f ./deployconfig.yaml ];then
     EXTNET_GW=${EXTNET[2]}
     EXTNET_NET=${EXTNET[3]}
     EXTNET_PORT=`grep "ext-port" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //' | tr ',' ' '`
+    ADMNET_GW=`grep "admNetgway" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //' | tr ',' ' '`
 
 fi
 
@@ -28,7 +29,7 @@ launch_eth() {
     for node in $computer_list; do
         echo "node name is ${node}"
         juju ssh $node "sudo ifconfig $EXTNET_PORT up"
-        juju ssh $node "sudo route del default gw $EXTNET_GW"
+        #juju ssh $node "sudo route del default gw $ADMNET_GW"
     done
 }
 
@@ -75,10 +76,13 @@ create_openrc
 . ./cloud/admin-openrc
 
 wget -P /tmp/images http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img
-glance image-create --name "cirros-0.3.3-x86_64" --file /tmp/images/cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --progress
+openstack image create --file /tmp/images/cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare "cirros-0.3.3-x86_64"
 
 #wget -P /tmp/images http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img
-#glance image-create --name "ubuntu-trusty-daily" --file /tmp/images/trusty-server-cloudimg-amd64-disk1.img --disk-format qcow2 --container-format bare --progress
+#openstack image create --file /tmp/images/trusty-server-cloudimg-amd64-disk1.img --disk-format qcow2 --container-format bare "ubuntu-trusty-daily"
+#wget -P /tmp/images http://cloud-images.ubuntu.com/trusty/current/xenial-server-cloudimg-amd64.tar.gz
+#openstack image create --file /tmp/images/xenial-server-cloudimg-amd64.tar.gz --container-format bare --disk-format raw "xenial-server-cloudimg-amd64"
+
 rm -rf /tmp/images
 
 # adjust tiny image
@@ -87,10 +91,10 @@ rm -rf /tmp/images
 
 
 # import key pair
-keystone tenant-create --name demo --description "Demo Tenant"
-keystone user-create --name demo --tenant demo --pass demo --email demo@demo.demo
+openstack project create --description "Demo Tenant" demo
+openstack user create --project demo --password demo --email demo@demo.demo demo
 
-nova keypair-add --pub-key ~/.ssh/id_rsa.pub ubuntu-keypair
+openstack keypair create --public-key ~/.ssh/id_rsa.pub ubuntu-keypair
 
 # configure external network
 
@@ -108,8 +112,8 @@ else
        --allocation-pool start=$EXTNET_FIP,end=$EXTNET_LIP \
           --disable-dhcp --gateway $EXTNET_GW $EXTNET_NET
     # configure security groups
-    neutron security-group-rule-create --direction ingress --ethertype IPv4 --protocol icmp --remote-ip-prefix 0.0.0.0/0 default
-    neutron security-group-rule-create --direction ingress --ethertype IPv4 --protocol tcp --port-range-min 22 --port-range-max 22 --remote-ip-prefix 0.0.0.0/0 default
+#    neutron security-group-rule-create --direction ingress --ethertype IPv4 --protocol icmp --remote-ip-prefix 0.0.0.0/0 default
+#    neutron security-group-rule-create --direction ingress --ethertype IPv4 --protocol tcp --port-range-min 22 --port-range-max 22 --remote-ip-prefix 0.0.0.0/0 default
 fi