From 7f4c6c795a31add79ba5b2f32cea6c55c39ff03e Mon Sep 17 00:00:00 2001
From: Gulsum Atici <gulsum.atici@canonical.com>
Date: Tue, 6 Jun 2023 19:34:56 +0300
Subject: [PATCH] Setup scripts for Charmed OSM Hackfest 15

Signed-off-by: Gulsum Atici <gulsum.atici@canonical.com>
---
 .../OSM-MR13/Setup Scripts/README.md          |   8 +-
 .../Setup Scripts/admin-credentials.rc        |  13 --
 .../OSM-MR13/Setup Scripts/common-vars        |  19 +--
 .../create-openstack-user-and-project.sh      | 114 ------------------
 .../delete-openstack-user-and-project.sh      |  54 ---------
 ...redentials.rc => openstack_credentials.rc} |   7 +-
 .../Setup Scripts/osm-cloud-init.yaml         |   6 -
 .../OSM-MR13/Setup Scripts/pc-cacert.pem      |  21 ----
 .../run-create-openstack-user-and-project.sh  |  14 ---
 .../run-delete-openstack-user-and-project.sh  |  13 --
 .../OSM-MR13/Setup Scripts/run-full-setup.sh  |   1 -
 .../OSM-MR13/Setup Scripts/run-install-osm.sh |   2 +
 .../Setup Scripts/run-microk8s-setup.sh       |   2 +
 .../run-osm-vim-k8scluster-add.sh             |  18 ++-
 .../Setup Scripts/run-vm-initial-setup.sh     |   3 +-
 .../Setup Scripts/vm-initial-setup.sh         |  45 ++++---
 .../OSM-MR13/Setup Scripts/vm-install-osm.sh  |  20 +--
 .../Setup Scripts/vm-microk8s-setup.sh        |  13 +-
 .../OSM-MR13/Setup Scripts/vyos-userdata.vsh  |  25 ----
 19 files changed, 69 insertions(+), 329 deletions(-)
 delete mode 100644 Hackfest_Demos/OSM-MR13/Setup Scripts/admin-credentials.rc
 delete mode 100755 Hackfest_Demos/OSM-MR13/Setup Scripts/create-openstack-user-and-project.sh
 delete mode 100755 Hackfest_Demos/OSM-MR13/Setup Scripts/delete-openstack-user-and-project.sh
 rename Hackfest_Demos/OSM-MR13/Setup Scripts/{hackfest-credentials.rc => openstack_credentials.rc} (58%)
 delete mode 100644 Hackfest_Demos/OSM-MR13/Setup Scripts/pc-cacert.pem
 delete mode 100755 Hackfest_Demos/OSM-MR13/Setup Scripts/run-create-openstack-user-and-project.sh
 delete mode 100755 Hackfest_Demos/OSM-MR13/Setup Scripts/run-delete-openstack-user-and-project.sh
 delete mode 100644 Hackfest_Demos/OSM-MR13/Setup Scripts/vyos-userdata.vsh

diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/README.md b/Hackfest_Demos/OSM-MR13/Setup Scripts/README.md
index 80e2b8ec..8e0dd10b 100644
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/README.md	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/README.md	
@@ -14,18 +14,12 @@ FLAVOR: the flavour of the new VM to launch.  Must have at least 4 CPUs, 8 GB RA
 PROJECT: The project ID in which to launch the new VM
 SUBNET: the first three octets of the subnet to use.  IP addresses will be allocated from this subnet, starting with .101 - .199
 
-### Creating Openstack Tenants
-This script will create users and projects in Openstack for hackfest-1, -2, -3, etc.  These projects are for deploying workloads to, OSM itself will be installed under the admin tenant.  It also creates SGi, S1, Private and Management networks, and launches OSM, VyOS and Microk8s VMs in the tenant.
-
-```
-./run-create-openstack-user-and-project.sh
-```
 
 ### Initial Configuration
 This script updates apt, upgrades the system to the latest 20.04 and installs remote desktop software
 
 ```
-./run-vm-setup.sh
+./run-vm-initial-setup.sh
 ```
 
 ### Install Microk8s
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/admin-credentials.rc b/Hackfest_Demos/OSM-MR13/Setup Scripts/admin-credentials.rc
deleted file mode 100644
index 9d2543a1..00000000
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/admin-credentials.rc	
+++ /dev/null
@@ -1,13 +0,0 @@
-export OS_AUTH_TYPE=password
-export OS_AUTH_URL=https://keystone.pc1.canonical.com:5000/v3
-export OS_CACERT=/home/ubuntu/pc-cacert.pem
-export OS_DOMAIN_NAME=admin_domain
-export OS_IDENTITY_API_VERSION=3
-export OS_INTERFACE=public
-export OS_PASSWORD=`cat admin.password`
-export OS_PROJECT_DOMAIN_NAME=admin_domain
-export OS_PROJECT_NAME=admin
-export OS_REGION_NAME=PartnerCloud1
-export OS_TENANT_NAME=admin
-export OS_USER_DOMAIN_NAME=admin_domain
-export OS_USERNAME=admin
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/common-vars b/Hackfest_Demos/OSM-MR13/Setup Scripts/common-vars
index 9a4b6d54..7f30e84e 100644
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/common-vars	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/common-vars	
@@ -15,8 +15,8 @@ if [ ! -z ${DEBUG} ]; then
     set -x
 fi
 
-START=1
-MAX=1
+START=5
+MAX=10
 
 if [ ! -z $2 ] ; then
     START=$1
@@ -26,20 +26,13 @@ elif [ ! -z $1 ] ; then
     MAX=$1
 fi
 
-# ETSI VIM ADMIN_DOMAIN=default, Partner Cloud=admin_domain
-ADMIN_DOMAIN=admin_domain
-APT_PROXY=http://172.21.18.3:3142
-FLAVOR=hackfest
+# ETSI VIM ADMIN_DOMAIN=default
+APT_PROXY=http://172.21.1.1.3142
+FLAVOR=osm.sanity
 KEY_NAME=hackfest
 NETWORK=osm-ext
 SUBNET=172.21.19
 ZONE=hackfest
 
-MANAGEMENT_SUBNET=10.0.0
-SGi_SUBNET=192.168.2
-S1_SUBNET=192.168.0
+MANAGEMENT_SUBNET=10.1.0
 PRIVATE_SUBNET=192.168.239
-
-FOCAL="auto-sync/ubuntu-focal-20.04-amd64-server-20221010-disk1.img"
-JAMMY=""
-VyOS="vyos-1.1.7-cloudinit"
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/create-openstack-user-and-project.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/create-openstack-user-and-project.sh
deleted file mode 100755
index 99ac77e7..00000000
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/create-openstack-user-and-project.sh	
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/bin/bash
-echo $0 started at $(date)
-
-. ./common-vars
-. ./admin-credentials.rc
-
-PARTICIPANT=${1}
-
-OPENSTACK_USER=hackfest-${PARTICIPANT}
-PROJECT=hackfest-${PARTICIPANT}
-PASSWORD=hackfest
-
-echo "Creating OpenStack project: ${PROJECT}"
-openstack project create --domain ${ADMIN_DOMAIN} ${PROJECT}
-PROJECT_ID=`openstack project list | grep "${PROJECT} " | awk '{print $2}'`
-openstack quota set --cores 64 --ram 131072 --instances 12 ${PROJECT_ID} &
-
-echo "Creating OpenStack User"
-openstack user create --project ${PROJECT} --domain ${ADMIN_DOMAIN} --password $PASSWORD $OPENSTACK_USER
-openstack role add --user $OPENSTACK_USER --project ${PROJECT} member
-
-echo "Creating OpenStack Network RBAC policy access_as_external, for network $NETWORK and project ${PROJECT}"
-openstack network rbac create \
-    --target-project ${PROJECT} \
-    --type network \
-    --action access_as_external \
-    $NETWORK &
-
-echo "Creating OpenStack Network RBAC policy access_as_shared, for network $NETWORK and project ${PROJECT}"
-openstack network rbac create \
-    --target-project ${PROJECT} \
-    --type network \
-    --action access_as_shared \
-    $NETWORK &
-
-wait
-
-echo "Creating public port"
-
-IP=`expr ${PARTICIPANT} + 0`
-VYOSIP=`expr ${PARTICIPANT} + 100`
-# This port gets created as the admin
-openstack port create --disable-port-security --fixed-ip ip-address=${SUBNET}.${IP} --project=${PROJECT} --enable --network osm-ext hackfest-osm-${PARTICIPANT}
-openstack port create --disable-port-security --fixed-ip ip-address=${SUBNET}.${VYOSIP} --project=${PROJECT} --enable --network osm-ext VyOS-management-${PARTICIPANT} &
-wait
-
-# This is done as the tenant, and some form of bug makes it necessary to unset this variable
-unset OS_PROJECT_NAME
-export OS_USERNAME=${OPENSTACK_USER}
-export OS_PASSWORD=${PASSWORD}
-export OS_PROJECT_NAME=${PROJECT}
-
-NOT_READY=1
-while [ $NOT_READY -eq 1 ] ; do
-    openstack server list
-    NOT_READY=$?
-done
-
-echo "Adding security groups"
-for i in $(openstack security group list | awk '/default/{ print $2 }'); do
-    openstack security group rule create $i --protocol icmp --remote-ip 0.0.0.0/0 &
-    openstack security group rule create $i --protocol udp --remote-ip 0.0.0.0/0 &
-    openstack security group rule create $i --protocol tcp --remote-ip 0.0.0.0/0 &
-done
-wait
-
-echo "Creating networks"
-NETWORK=management
-echo "Creating ${NETWORK} network"
-openstack network create ${NETWORK} --enable --no-share
-openstack subnet create ${NETWORK}-subnet --network=${NETWORK} --subnet-range=${MANAGEMENT_SUBNET}.0/24 --gateway none --dns-nameserver 172.21.18.2 --dhcp --allocation-pool start=10.0.0.101,end=10.0.0.199 --host-route destination=0.0.0.0/0,gateway=10.0.0.10
-
-NETWORK=SGi
-echo "Creating ${NETWORK} network"
-openstack network create ${NETWORK} --enable --no-share
-openstack subnet create ${NETWORK}-subnet --network=${NETWORK} --subnet-range=${SGi_SUBNET}.0/24 --gateway none --host-route destination=0.0.0.0/0,gateway=10.0.0.10
-
-NETWORK=S1
-echo "Creating ${NETWORK} network"
-openstack network create ${NETWORK} --enable --no-share
-openstack subnet create ${NETWORK}-subnet --network=${NETWORK} --subnet-range=${S1_SUBNET}.0/24
-
-echo "Creating Private network"
-openstack network create private --enable --no-share
-openstack subnet create private-subnet --network=private --subnet-range=${PRIVATE_SUBNET}.0/24  --gateway none --host-route destination=0.0.0.0/0,gateway=192.168.239.250
-
-# Create as the project user
-echo "Creating Ports"
-openstack port create --disable-port-security --fixed-ip ip-address=192.168.239.250 --enable --disable-port-security --network private VyOS-private &
-openstack port create --disable-port-security --fixed-ip ip-address=10.0.0.10 --enable --network management OSM-management &
-openstack port create --disable-port-security --fixed-ip ip-address=10.0.0.11 --enable --network management MK8s-management &
-
-
-echo "Creating Keypair"
-openstack keypair create --public-key ./hackfest_rsa.pub ${KEY_NAME} &
-wait
-
-echo "Launching OSM VM"
-openstack server create --availability-zone ${ZONE} --key-name ${KEY_NAME} --flavor ${FLAVOR} --image ${FOCAL} --nic port-id=hackfest-osm-${PARTICIPANT} --nic port-id=OSM-management --user-data ./osm-cloud-init.yaml osm-${PARTICIPANT} &
-echo "Launching Microk8s VM"
-openstack server create --availability-zone ${ZONE} --key-name ${KEY_NAME} --flavor ${FLAVOR} --image ${FOCAL} --nic port-id=MK8s-management -- microk8s &
-echo "Launching VyOS Router"
-openstack server create --availability-zone ${ZONE} --flavor m1.small --image ${VyOS} --nic port-id=VyOS-management-${PARTICIPANT} --nic port-id=VyOS-private --config-drive True --user-data "`pwd`/vyos-userdata.vsh" vyos-pnf-router
-wait
-
-echo "Waiting for OSM VM to be ready"
-
-while [ 1 ] ; do
-    sleep 5
-    ALIVE=$(ssh -T -o ConnectTimeout=1 -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${SUBNET}.${IP} 'cloud-init status --wait | tail -1' 2> /dev/null)
-    if [ "${ALIVE}" == "status: done" ] ; then break ; fi
-done
-
-echo $0 $@ complete at $(date)
\ No newline at end of file
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/delete-openstack-user-and-project.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/delete-openstack-user-and-project.sh
deleted file mode 100755
index cb1a5480..00000000
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/delete-openstack-user-and-project.sh	
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-echo $0 started at $(date)
-
-. ./common-vars
-. ./admin-credentials.rc
-
-PARTICIPANT=${1}
-
-OPENSTACK_USER=hackfest-$1
-PROJECT=$OPENSTACK_USER
-PASSWORD=hackfest
-
-echo Cleaning up ${OPENSTACK_USER}
-
-PROJECT_ID=`openstack project list | grep "${PROJECT} " | awk '{print $2}'`
-if [ "${PROJECT_ID}" != "" ]; then
-
-    unset OS_PROJECT_NAME
-    echo "Removing Router Ports"
-    for ROUTER in $(openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID router list -f value -c ID); do
-        openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID router unset --external-gateway ${ROUTER}
-        PORT=$(openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID router show ${ROUTER} -f json -c interfaces_info | jq .interfaces_info[0].port_id -r)
-        while [ "${PORT}" != "null" -a "${PORT}" != "" ] ; do
-            openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID router remove port ${ROUTER} ${PORT}
-            PORT=$(openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID router show ${ROUTER} -f json -c interfaces_info | jq .interfaces_info[0].port_id -r)
-        done
-    done
-
-    echo "Removing VMs"
-    openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID server list -f value -c ID | xargs openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID server delete
-    echo "Removing Routers"
-    openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID router list -f value -c ID | xargs openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID router delete
-    echo "Removing Ports"
-    openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID port list -f value -c ID   | xargs openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID port delete
-    echo "Removing Networks"
-    openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID network list -f value -c ID| xargs openstack --os-username=$OPENSTACK_USER --os-password=$PASSWORD --os-project-id=$PROJECT_ID network delete
-
-    #for RBAC in `openstack network rbac list -f value -c ID`; do
-    #    openstack network rbac show $RBAC -f value | grep $PROJECT_ID 2> /dev/null
-    #    if [ $? -eq 0 ] ; then
-    #        echo "Deleting RBAC policy $RBAC"
-    #        openstack network rbac delete $RBAC &
-    #    fi
-    #done
-
-    echo "Deleting OpenStack project: $PROJECT"
-    . ./admin-credentials.rc
-    openstack project purge --project ${PROJECT_ID}
-fi
-
-echo "Deleting OpenStack User: $OPENSTACK_USER"
-openstack user delete --domain ${ADMIN_DOMAIN} ${OPENSTACK_USER}
-
-echo $0 $@ complete at $(date)
\ No newline at end of file
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/hackfest-credentials.rc b/Hackfest_Demos/OSM-MR13/Setup Scripts/openstack_credentials.rc
similarity index 58%
rename from Hackfest_Demos/OSM-MR13/Setup Scripts/hackfest-credentials.rc
rename to Hackfest_Demos/OSM-MR13/Setup Scripts/openstack_credentials.rc
index 63a02631..aebdce37 100644
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/hackfest-credentials.rc	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/openstack_credentials.rc	
@@ -1,10 +1,11 @@
 #OpenStack Credentials
+PARTICIPANT=$1
 export OS_AUTH_URL=http://172.21.247.1:5000/v3
-export OS_PROJECT_NAME=hackfest
+export OS_PROJECT_NAME=hackfest15group${PARTICIPANT}
 export OS_USER_DOMAIN_NAME='Default'
 export OS_PROJECT_DOMAIN_ID='default'
-export OS_USERNAME=hackfest
-export OS_PASSWORD=hackfest
+export OS_USERNAME=hackfest15group${PARTICIPANT}
+export OS_PASSWORD=hackfest15group-${PARTICIPANT}!
 export OS_REGION_NAME='RegionOne'
 export OS_INTERFACE=public
 export OS_IDENTITY_API_VERSION=3
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/osm-cloud-init.yaml b/Hackfest_Demos/OSM-MR13/Setup Scripts/osm-cloud-init.yaml
index ddafb92f..7384a541 100644
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/osm-cloud-init.yaml	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/osm-cloud-init.yaml	
@@ -13,11 +13,5 @@ write_files:
             ens4:
                 dhcp4-overrides:
                     use-routes: false
-            ens5:
-                dhcp4-overrides:
-                    use-routes: false
-            ens6:
-                dhcp4-overrides:
-                    use-routes: false
 runcmd:
 - reboot
\ No newline at end of file
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/pc-cacert.pem b/Hackfest_Demos/OSM-MR13/Setup Scripts/pc-cacert.pem
deleted file mode 100644
index d2579734..00000000
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/pc-cacert.pem	
+++ /dev/null
@@ -1,21 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDazCCAlOgAwIBAgIUamWIGAvUwJHZAOv9r4Aa3sI//SowDQYJKoZIhvcNAQEL
-BQAwPTE7MDkGA1UEAxMyVmF1bHQgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkg
-KGNoYXJtLXBraS1sb2NhbCkwHhcNMjIxMDA1MjM1NDEzWhcNMzIxMDAyMjI1NDQz
-WjA9MTswOQYDVQQDEzJWYXVsdCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAo
-Y2hhcm0tcGtpLWxvY2FsKTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
-ALbGiAa6r4jkMEDnVuw6DdTvRMxYh7ot6T9tkdWqJYGcmywZixeiOyCjn6Z4F5Bm
-945/iQqP7IVz9Ck8wyb+3c9Pd9lXCaaLSSR2Zi2JObmlMvg+I0JeoxxvtfqU/dD1
-UnDAccYcfBuHPQy7SUXqqIYwjFUIMJPbFzBTaWRxZlSJXz71Wj9BQY5hzs69aukq
-IylJFGzaZX9N33AT0kKLQCg1O6JGjIbyAmbpyswvzzYJk39xrv86njJgq8u0DAm7
-/jgAgmKeY9KYrymVWo8k8L01Q+oukggAL4lw6KGQL1Cen43W7yxGgKCYNukfFUXN
-ukpZeYFojk544/bxAbWbK2kCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud
-EwEB/wQFMAMBAf8wHQYDVR0OBBYEFI7WUsgGRmjqYRTPcpaaN0asDL7qMB8GA1Ud
-IwQYMBaAFI7WUsgGRmjqYRTPcpaaN0asDL7qMA0GCSqGSIb3DQEBCwUAA4IBAQAN
-LSmEiAyjT5NvRm/BRALXYbL8lae48H5E3sNjQJJD/ghKR3UNsSKqd61X30WgochQ
-YVVeFbtRifOChhM9D+TFDKMsb0ZS8zfpJxfIUPF4q4dNR2DCAAmC964f+2H86nKX
-WaCvkBGmpXexpZdJcQt7Hx+MuFydhv4qUBHHLIRJqj3EfPCoMj+rtJ1/3hp/WPNJ
-K0sq9F+50oyCG2BUc08xF3Je90y7ukY3ZJF7whSTCR38T6dvVTjnNRup0+Msvn49
-DBFYnDIRC2NiHRr/6jaQgfaQ+WelxitO31auQzA7rVhlq02gHzAU7WfUKXJehLlv
-YNBsjiiusMse18zDxhi0
------END CERTIFICATE-----
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-create-openstack-user-and-project.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-create-openstack-user-and-project.sh
deleted file mode 100755
index 12236637..00000000
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-create-openstack-user-and-project.sh	
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-echo $0 started at $(date)
-
-. ./common-vars
-. ./admin-credentials.rc
-mkdir -p logs/
-
-for PARTICIPANT in `seq ${START} ${MAX}` ; do
-    ./create-openstack-user-and-project.sh ${PARTICIPANT} 2>&1 | tee -a logs/create-openstack-user-and-project-${PARTICIPANT}.log &
-sleep 60
-done
-wait
-
-echo $0 $@ complete at $(date)
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-delete-openstack-user-and-project.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-delete-openstack-user-and-project.sh
deleted file mode 100755
index b52f3636..00000000
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-delete-openstack-user-and-project.sh	
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-echo $0 started at $(date)
-
-. ./common-vars
-. ./admin-credentials.rc
-mkdir -p logs/
-
-for PARTICIPANT in `seq ${START} ${MAX}` ; do
-    ./delete-openstack-user-and-project.sh ${PARTICIPANT} 2>&1 | tee -a logs/delete-openstack-user-and-project-${PARTICIPANT}.log &
-done
-wait
-
-echo $0 $@ complete at $(date)
\ No newline at end of file
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-full-setup.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-full-setup.sh
index a5cead4d..ab57d1aa 100755
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-full-setup.sh	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-full-setup.sh	
@@ -3,7 +3,6 @@ echo $0 started at $(date)
 
 . common-vars
 
-./run-create-openstack-user-and-project.sh $@
 ./run-vm-initial-setup.sh $@
 ./run-microk8s-setup.sh $@ &
 ./run-install-osm.sh $@
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-install-osm.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-install-osm.sh
index 7ee94d42..426dcb85 100755
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-install-osm.sh	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-install-osm.sh	
@@ -5,11 +5,13 @@ echo $0 started at $(date)
 
 for PARTICIPANT in `seq ${START} ${MAX}` ; do
   IP=`expr ${PARTICIPANT} + 0`
+  source ./openstack_credentials.rc PARTICIPANT
   scp -o StrictHostKeyChecking=no -i hackfest_rsa ./vm-install-osm.sh ubuntu@${SUBNET}.${IP}: &
 done
 wait
 
 for PARTICIPANT in `seq ${START} ${MAX}` ; do
+  source ./openstack_credentials.rc PARTICIPANT
   IP=`expr ${PARTICIPANT} + 0`
   ssh -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${SUBNET}.${IP} ./vm-install-osm.sh 2>&1 | tee -a logs/vm-install-osm-${PARTICIPANT}.log&
 done
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-microk8s-setup.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-microk8s-setup.sh
index e0dd4b26..b9c59f21 100755
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-microk8s-setup.sh	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-microk8s-setup.sh	
@@ -4,6 +4,7 @@ echo $0 started at $(date)
 . ./common-vars $@
 
 for PARTICIPANT in `seq ${START} ${MAX}` ; do
+  source ./openstack_credentials.rc PARTICIPANT
   IP=`expr ${PARTICIPANT} + 0`
   scp -o StrictHostKeyChecking=no -i hackfest_rsa ./hackfest_rsa ./hackfest_rsa.pub ubuntu@${SUBNET}.${IP}:.ssh/ &
   scp -o StrictHostKeyChecking=no -i hackfest_rsa vm-microk8s-setup.sh ubuntu@${SUBNET}.${IP}: &
@@ -11,6 +12,7 @@ done
 wait
 
 for PARTICIPANT in `seq ${START} ${MAX}` ; do
+  source ./openstack_credentials.rc PARTICIPANT
   IP=`expr ${PARTICIPANT} + 0`
   ssh -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${SUBNET}.${IP} "scp -o StrictHostKeyChecking=no -i .ssh/hackfest_rsa vm-microk8s-setup.sh 10.0.0.11:; ssh -o StrictHostKeyChecking=no -i .ssh/hackfest_rsa 10.0.0.11 ./vm-microk8s-setup.sh"  2>&1 | tee -a logs/vm-microk8s-setup-${PARTICIPANT}.log&
 done
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-osm-vim-k8scluster-add.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-osm-vim-k8scluster-add.sh
index 1dab81db..a60b110b 100755
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-osm-vim-k8scluster-add.sh	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-osm-vim-k8scluster-add.sh	
@@ -2,20 +2,26 @@
 echo $0 started at $(date)
 
 . ./common-vars $@
-. ./admin-credentials.rc
 
 for PARTICIPANT in `seq ${START} ${MAX}` ; do
-
+    export OS_AUTH_URL=http://172.21.247.1:5000/v3
+    export OS_PROJECT_NAME=hackfest15group${PARTICIPANT}
+    export OS_USER_DOMAIN_NAME='Default'
+    export OS_PROJECT_DOMAIN_ID='default'
+    export OS_USERNAME=hackfest15group${PARTICIPANT}
+    export OS_PASSWORD=hackfest15group-${PARTICIPANT}!
+    export OS_REGION_NAME='RegionOne'
+    export OS_INTERFACE=public
+    export OS_IDENTITY_API_VERSION=3
     IP=`expr ${PARTICIPANT} + 0`
 
-    OS_USERNAME=hackfest-${PARTICIPANT}
-    OS_PASSWORD=hackfest
-    OS_PROJECT_NAME=hackfest-${PARTICIPANT}
+    OS_USERNAME=hackfest15group${PARTICIPANT}
+    OS_PASSWORD=hackfest15group-${PARTICIPANT}!
+    OS_PROJECT_NAME=hackfest15group${PARTICIPANT}
 
     cat << EOF > ${OS_USERNAME}.rc
 export OS_AUTH_TYPE=password
 export OS_AUTH_URL=${OS_AUTH_URL}
-export OS_CACERT=/home/ubuntu/pc-cacert.pem
 export OS_DOMAIN_NAME=${OS_DOMAIN_NAME}
 export OS_IDENTITY_API_VERSION=3
 export OS_INTERFACE=public
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-vm-initial-setup.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-vm-initial-setup.sh
index f338f5da..bc82bb2e 100755
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/run-vm-initial-setup.sh	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/run-vm-initial-setup.sh	
@@ -5,7 +5,7 @@ echo $0 started at $(date)
 
 for PARTICIPANT in `seq ${START} ${MAX}` ; do
   IP=`expr ${PARTICIPANT} + 0`
-
+  source ./openstack_credentials.rc PARTICIPANT
   scp -o StrictHostKeyChecking=no -i hackfest_rsa vm-initial-setup.sh ubuntu@${SUBNET}.${IP}: &
   scp -o StrictHostKeyChecking=no -i hackfest_rsa ./hackfest_rsa ubuntu@${SUBNET}.${IP}:.ssh/id_rsa &
   scp -o StrictHostKeyChecking=no -i hackfest_rsa ./hackfest_rsa.pub ubuntu@${SUBNET}.${IP}:.ssh/id_rsa.pub &
@@ -16,6 +16,7 @@ wait
 
 for PARTICIPANT in `seq ${START} ${MAX}` ; do
   IP=`expr ${PARTICIPANT} + 0`
+  source ./openstack_credentials.rc PARTICIPANT
   ssh -o StrictHostKeyChecking=no -i hackfest_rsa ubuntu@${SUBNET}.${IP} "./vm-initial-setup.sh" 2>&1 | tee -a logs/vm-initial-setup-${PARTICIPANT}.log &
 done
 wait
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-initial-setup.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-initial-setup.sh
index fdb5fac8..26fe2e03 100755
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-initial-setup.sh	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-initial-setup.sh	
@@ -5,31 +5,15 @@ sudo sed -i "s/127.0.0.1 /127.0.0.1 $HOSTNAME /" /etc/hosts
 echo 'ubuntu:hackfest'| sudo chpasswd
 sudo sed -i "s/^PasswordAuthentication.*/PasswordAuthentication yes/" /etc/ssh/sshd_config
 sudo service ssh restart
-echo "Acquire::http::Proxy \"http://172.21.18.3:3142\";" | sudo tee /etc/apt/apt.conf.d/proxy.conf
-echo "Acquire::https::Proxy \"http://172.21.18.3:3142\";" | sudo tee -a /etc/apt/apt.conf.d/proxy.conf
+echo "Acquire::http::Proxy \"http://172.21.1.1:3142\";" | sudo tee /etc/apt/apt.conf.d/proxy.conf
+echo "Acquire::https::Proxy \"http://172.21.1.1:3142\";" | sudo tee -a /etc/apt/apt.conf.d/proxy.conf
 
 sudo apt update
 sudo apt full-upgrade -y
 
-sudo apt install -y firefox gnome-session xrdp
 sudo snap install code --classic
 sudo snap install openstackclients yq jq
 
-# Update so buttons show up
-gsettings set org.gnome.desktop.wm.preferences button-layout :minimize,maximize,close
-gsettings set org.gnome.desktop.interface enable-animations false
-# Prevent VM from going to sleep
-sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
-
-cat << EOF | sudo tee /etc/polkit-1/localauthority/50-local.d/color.pkla
-[Allow colord for all users]
-Identity=unix-user:*
-Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
-ResultAny=yes
-ResultInactive=yes
-ResultActive=yes
-EOF
-
 echo net.ipv4.ip_forward=1 | sudo tee -a /etc/sysctl.conf
 sudo sysctl net.ipv4.ip_forward=1
 sudo iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE
@@ -41,4 +25,29 @@ sudo chmod +x /etc/rc.local
 
 git clone --recurse-submodules -j8 https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages.git
 
+# Clone OSM code
+mkdir $HOME/OSM/
+pushd $HOME/OSM
+BRANCH=master
+for MDG in common devops IM LCM MON N2VC NBI NG-SA NG-UI osmclient PLA POL RO tests; do
+ git clone https://osm.etsi.org/gerrit/osm/${MDG}
+ git -C ${MDG} checkout ${BRANCH}
+done
+popd
+
+# Export Module paths
+cat << 'EOF' > $HOME/osm-vars.sh
+export GIT_PATH=$HOME/OSM
+export COMMON_LOCAL_PATH="$GIT_PATH/common"
+export LCM_LOCAL_PATH="$GIT_PATH/LCM"
+export MON_LOCAL_PATH="$GIT_PATH/MON"
+export N2VC_LOCAL_PATH="$GIT_PATH/N2VC"
+export NBI_LOCAL_PATH="$GIT_PATH/NBI"
+export POL_LOCAL_PATH="$GIT_PATH/POL"
+export RO_LOCAL_PATH="$GIT_PATH/RO"
+EOF
+
+echo ". $HOME/osm-vars.sh" >> $HOME/.bashrc
+. $HOME/osm-vars.sh
+
 echo $0 $@ complete at $(date)
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-install-osm.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-install-osm.sh
index c4e4b211..eba4e370 100755
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-install-osm.sh	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-install-osm.sh	
@@ -1,14 +1,14 @@
 #!/bin/bash
 echo $0 started at $(date)
 
-sudo snap install microk8s --classic --channel=1.23/stable
+sudo snap install microk8s --classic --channel=1.26/stable
 sudo snap install jq
 
 sudo mkdir -p /var/snap/microk8s/current/args/certs.d/docker.io
 cat << EOF | sudo tee /var/snap/microk8s/current/args/certs.d/docker.io/hosts.toml
-server = "http://172.21.18.3:5000"
+server = "http://172.21.1.1:5000"
 
-[host."http://172.21.18.3:5000"]
+[host."http://172.21.1.1:5000"]
 capabilities = ["pull", "resolve"]
 skip_verify = true
 plain-http = true
@@ -16,29 +16,21 @@ EOF
 
 sudo systemctl restart snap.microk8s.daemon-containerd.service
 sudo microk8s.enable storage
-sudo microk8s enable dns:172.21.18.2
 
 sudo snap alias microk8s.kubectl kubectl
 
-wget https://osm-download.etsi.org/ftp/osm-12.0-twelve/install_osm.sh
+wget https://osm-download.etsi.org/ftp/osm-13.0-thirteen/install_osm.sh
 chmod +x ./install_osm.sh
-./install_osm.sh -R testing-daily -r testing  -y --charmed --tag testing-daily 2>&1 | tee install_osm.log
+./install_osm.sh --charmed -R testing-daily -t testing-daily -r testing -y 2>&1 | tee charmed_install_log.txt
 
 # Set our environment to talk to the new OSM
-$(grep "export OSM_PASSWORD" install_osm.log|head -1)
-$(grep "export OSM_HOSTNAME" install_osm.log|head -1)
+grep '^export OSM' ~/charmed_install_log.txt >> ~/.bashrc
 
 while [ 1 ] ; do
     osm version
     if [ $? -eq 0 ]; then break ; fi
 done
 
-# Change the password
-osm user-update admin --password hackfest
-juju config -m osm mon grafana-password=hackfest
-
-POD=`sudo microk8s.kubectl -n osm get po | grep -v operator | grep grafana- | awk '{print $1}'`
-sudo microk8s.kubectl exec -n osm -it $POD -- grafana-cli admin reset-admin-password hackfest
 
 # Expose our services
 sudo sed -i "s/127.0.0.1 /127.0.0.1 nbi.osm ui.osm grafana.osm prometheus.osm /" /etc/hosts
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-microk8s-setup.sh b/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-microk8s-setup.sh
index 7bfe8b1d..25a311f3 100755
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-microk8s-setup.sh	
+++ b/Hackfest_Demos/OSM-MR13/Setup Scripts/vm-microk8s-setup.sh	
@@ -5,24 +5,25 @@ sudo sed -i "s/127.0.0.1 /127.0.0.1 $HOSTNAME /" /etc/hosts
 echo 'ubuntu:hackfest'| sudo chpasswd
 sudo sed -i "s/^PasswordAuthentication.*/PasswordAuthentication yes/" /etc/ssh/sshd_config
 sudo service ssh restart
-echo "Acquire::http::Proxy \"http://172.21.18.3:3142\";" | sudo tee /etc/apt/apt.conf.d/proxy.conf
-echo "Acquire::https::Proxy \"http://172.21.18.3:3142\";" | sudo tee -a /etc/apt/apt.conf.d/proxy.conf
+echo "Acquire::http::Proxy \"http://172.21.1.1:3142\";" | sudo tee /etc/apt/apt.conf.d/proxy.conf
+echo "Acquire::https::Proxy \"http://172.21.1.1:3142\";" | sudo tee -a /etc/apt/apt.conf.d/proxy.conf
 
 sudo apt update
 sudo apt full-upgrade -y
 
-sudo snap install microk8s --classic --channel=1.23/stable
+sudo snap install microk8s --classic --channel=1.26/stable
 sudo mkdir -p /var/snap/microk8s/current/args/certs.d/docker.io
 cat << EOF | sudo tee /var/snap/microk8s/current/args/certs.d/docker.io/hosts.toml
-server = "http://172.21.18.3:5000"
+server = "http://172.21.1.1:5000"
 
-[host."http://172.21.18.3:5000"]
+[host."http://172.21.1.1:5000"]
 capabilities = ["pull", "resolve"]
 skip_verify = true
 plain-http = true
 EOF
 
-sudo systemctl restart snap.microk8s.daemon-containerd.service
+sudo microk8s stop
+sudo microk8s start
 sudo microk8s.enable storage
 
 HOST_IP=10.0.0.11
diff --git a/Hackfest_Demos/OSM-MR13/Setup Scripts/vyos-userdata.vsh b/Hackfest_Demos/OSM-MR13/Setup Scripts/vyos-userdata.vsh
deleted file mode 100644
index 4b17c45b..00000000
--- a/Hackfest_Demos/OSM-MR13/Setup Scripts/vyos-userdata.vsh	
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/vbash
-source /opt/vyatta/etc/functions/script-template
-# Interface Config eth0
-set interfaces ethernet eth0 address dhcp
-set interfaces ethernet eth0 description VyOS-public
-# Interface Config eth1
-set interfaces ethernet eth1 address dhcp
-set interfaces ethernet eth1 description VyOS-private
-# System config
-set system gateway-address 10.0.0.1
-set system host-name vyos-firewall
-set service ssh listen-address 0.0.0.0
-set service ssh port 22
-set system login user osm authentication plaintext-password osm2021
-# Enable masquerading
-set nat source rule 100 outbound-interface 'eth0'
-set nat source rule 100 source address '192.168.239.0/24'
-set nat source rule 100 translation address masquerade
-# SNMP
-set service snmp community public authorization ro
-set service snmp location "OSM Labs"
-set service snmp contact "osmsupport@etsi.org"
-# Save
-commit
-save
\ No newline at end of file
-- 
GitLab