summaryrefslogtreecommitdiffstats
path: root/juju
diff options
context:
space:
mode:
Diffstat (limited to 'juju')
-rwxr-xr-xjuju/configure-juju-on-openstack16
-rwxr-xr-xjuju/get-cloud-images21
-rwxr-xr-xjuju/joid-configure-openstack33
3 files changed, 51 insertions, 19 deletions
diff --git a/juju/configure-juju-on-openstack b/juju/configure-juju-on-openstack
index 1d98fd08..6717ce53 100755
--- a/juju/configure-juju-on-openstack
+++ b/juju/configure-juju-on-openstack
@@ -70,8 +70,20 @@ T_IMAGE_ID=`openstack image list -f value | grep -i trusty | cut -f 1 -d " "`
#We can now use Juju to generate the metadata:
-juju metadata generate-image -d ~/simplestreams -i $X_IMAGE_ID -s xenial -r $OS_REGION_NAME -u $OS_AUTH_URL
-juju metadata generate-image -d ~/simplestreams -i $T_IMAGE_ID -s trusty -r $OS_REGION_NAME -u $OS_AUTH_URL
+#Upload images to glance
+## image name is used by script to generate metadata .. don't screw the series
+NODE_ARCTYPE=`arch`
+
+if [ "ppc64le" == "$NODE_ARCTYPE" ]; then
+ NODE_ARCHES="ppc64el"
+elif [ "aarch64" == "$NODE_ARCTYPE" ]; then
+ NODE_ARCHES="arm"
+else
+ NODE_ARCHES="amd64"
+fi
+
+juju metadata generate-image -d ~/simplestreams -i $X_IMAGE_ID -s xenial -r $OS_REGION_NAME -u $OS_AUTH_URL -a $NODE_ARCHES
+juju metadata generate-image -d ~/simplestreams -i $T_IMAGE_ID -s trusty -r $OS_REGION_NAME -u $OS_AUTH_URL -a $NODE_ARCHES
#To verify that the correct metadata files have been generated, you may run:
#You should see .json files containing the details we just added on the images.
diff --git a/juju/get-cloud-images b/juju/get-cloud-images
index 3711729c..9711b793 100755
--- a/juju/get-cloud-images
+++ b/juju/get-cloud-images
@@ -3,18 +3,29 @@
folder=/srv/data/
sudo mkdir $folder || true
+NODE_ARCTYPE=`arch`
+
+if [ "ppc64le" == "$NODE_ARCTYPE" ]; then
+ NODE_ARCHES="ppc64el"
+elif [ "aarch64" == "$NODE_ARCTYPE" ]; then
+ NODE_ARCHES="arm64"
+else
+ NODE_ARCHES="amd64"
+fi
+
+
if grep -q 'virt-type: lxd' bundles.yaml; then
URLS=" \
- http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-lxc.tar.gz \
- http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-root.tar.gz "
+ http://download.cirros-cloud.net/daily/20161201/cirros-dl161201-$NODE_ARCTYPE-lxc.tar.gz \
+ http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-$NODE_ARCHES-root.tar.gz "
else
URLS=" \
- http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img \
- http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img \
+ http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-$NODE_ARCHES-uefi1.img \
+ http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-$NODE_ARCHES-uefi1.img \
http://mirror.catn.com/pub/catn/images/qcow2/centos6.4-x86_64-gold-master.img \
http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 \
- http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img "
+ http://download.cirros-cloud.net/daily/20161201/cirros-dl161201-$NODE_ARCTYPE-disk.img "
fi
for URL in $URLS
diff --git a/juju/joid-configure-openstack b/juju/joid-configure-openstack
index ab4c1670..47db0893 100755
--- a/juju/joid-configure-openstack
+++ b/juju/joid-configure-openstack
@@ -39,18 +39,19 @@ EXTERNAL_NETWORK_ID=$(openstack network show ext-net | grep " id" | awk '{print
#Create private network for neutron for tenant VMs
openstack network show private > /dev/null 2>&1 || openstack network create private
-openstack subnet show private_subnet > /dev/null 2>&1 || neutron subnet-create private $NEUTRON_FIXED_NET_CIDR -- --name private_subnet --dns_nameservers list=true 8.8.8.8
+openstack subnet show private_subnet > /dev/null 2>&1 || openstack subnet create --network private --subnet-range $NEUTRON_FIXED_NET_CIDR --dns-nameserver 8.8.8.8 private_subnet
SUBNET_ID=$(openstack subnet show private_subnet | grep " id" | awk '{print $4}')
#Create router for external network and private network
openstack router show provider-router > /dev/null 2>&1 || openstack router create --project-domain=$OS_PROJECT_DOMAIN_NAME --project $OS_PROJECT_NAME provider-router
ROUTER_ID=$(openstack router show provider-router | grep " id" | awk '{print $4}')
-neutron router-gateway-clear provider-router || true
-neutron router-gateway-set $ROUTER_ID $EXTERNAL_NETWORK_ID
-## make it always ok to have it indempodent.
-neutron router-interface-add $ROUTER_ID $SUBNET_ID || true
+openstack router set --external-gateway $EXTERNAL_NETWORK_ID --enable $ROUTER_ID || true
+ ## make it always ok to have it indempodent.
+openstack router add subnet $ROUTER_ID $SUBNET_ID || true
+
+#neutron router-gateway-clear provider-router || true
echo "Configuring security groups for access to ICMP, SSH and RDP by default"
@@ -80,7 +81,6 @@ openstack flavor show m1.xlarge > /dev/null 2>&1 || openstack flavor create --ra
echo "modifying default quotas for admin user"
#Modify quotas for the tenant to allow large deployments
-PROJECT_ID=`openstack quota show -f value -c project`
openstack quota set --instances 400 --cores 800 --ram 404800 --secgroups 4000 --floating-ips -1 --secgroup-rules -1 $PROJECT_ID
### need to find how to change quota for the project not the tenant
@@ -92,13 +92,22 @@ echo "Uploading images to glance"
#Upload images to glance
## image name is used by script to generate metadata .. don't screw the series
+NODE_ARCTYPE=`arch`
+
+if [ "ppc64le" == "$NODE_ARCTYPE" ]; then
+ NODE_ARCHES="ppc64el"
+elif [ "aarch64" == "$NODE_ARCTYPE" ]; then
+ NODE_ARCHES="arm64"
+else
+ NODE_ARCHES="amd64"
+fi
if grep -q 'virt-type: lxd' bundles.yaml; then
- openstack image list | grep "Xenial LXC x86_64" > /dev/null 2>&1 || glance image-create --name="Xenial LXC x86_64" --visibility=public --container-format=bare --disk-format=root-tar --property architecture="x86_64" < /srv/data/xenial-server-cloudimg-amd64-root.tar.gz
- openstack image list | grep "Cirros LXC 0.3" > /dev/null 2>&1 || glance image-create --name="Cirros LXC 0.3" --visibility=public --container-format=bare --disk-format=root-tar --property architecture="x86_64" < /srv/data/cirros-0.3.4-x86_64-lxc.tar.gz
+ openstack image list | grep "Xenial LXC" > /dev/null 2>&1 || glance image-create --name="Xenial LXC" --visibility=public --container-format=bare --disk-format=root-tar --property architecture="$NODE_ARCTYPE" < /srv/data/xenial-server-cloudimg-$NODE_ARCHES-root.tar.gz
+ openstack image list | grep "Cirros LXC" > /dev/null 2>&1 || glance image-create --name="Cirros LXC" --visibility=public --container-format=bare --disk-format=root-tar --property architecture="$NODE_ARCTYPE" < /srv/data/cirros-dl161201-$NODE_ARCTYPE-lxc.tar.gz
else
- openstack image list | grep "Trusty x86_64" > /dev/null 2>&1 || openstack image create "Trusty x86_64" --public --container-format=ovf --disk-format=qcow2 < /srv/data/trusty-server-cloudimg-amd64-disk1.img
- openstack image list | grep "Xenial x86_64" > /dev/null 2>&1 || openstack image create "Xenial x86_64" --public --container-format=ovf --disk-format=qcow2 < /srv/data/xenial-server-cloudimg-amd64-disk1.img
- openstack image list | grep "CentOS 6.4" > /dev/null 2>&1 || openstack image create "CentOS 6.4" --public --container-format=bare --disk-format=qcow2 < /srv/data/centos6.4-x86_64-gold-master.img
- openstack image list | grep "Cirros 0.3" > /dev/null 2>&1 || openstack image create "Cirros 0.3" --public --container-format=bare --disk-format=qcow2 < /srv/data/cirros-0.3.4-x86_64-disk.img
+ openstack image list | grep "Trusty" > /dev/null 2>&1 || openstack image create "Trusty" --public --container-format=ovf --disk-format=qcow2 --property architecture="$NODE_ARCTYPE" < /srv/data/trusty-server-cloudimg-$NODE_ARCHES-uefi1.img
+ openstack image list | grep "Xenial" > /dev/null 2>&1 || openstack image create "Xenial" --public --container-format=ovf --disk-format=qcow2 --property architecture="$NODE_ARCTYPE" < /srv/data/xenial-server-cloudimg-$NODE_ARCHES-uefi1.img
+ openstack image list | grep "CentOS" > /dev/null 2>&1 || openstack image create "CentOS" --public --container-format=bare --disk-format=qcow2 < /srv/data/CentOS-7-x86_64-GenericCloud.qcow2
+ openstack image list | grep "Cirros" > /dev/null 2>&1 || openstack image create "Cirros" --public --container-format=bare --disk-format=qcow2 --property architecture="$NODE_ARCTYPE" < /srv/data/cirros-dl161201-$NODE_ARCTYPE-disk.img
fi