Commit 91da27e9 authored by aticig's avatar aticig
Browse files

Changing scripts to use hackfest15main project for OSM instances installation

parent a4e47e53
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ if [ ! -z ${DEBUG} ]; then
fi

START=5
MAX=10
MAX=5

if [ ! -z $2 ] ; then
    START=$1
+2 −11
Original line number Diff line number Diff line
@@ -3,23 +3,14 @@ echo $0 started at $(date)

PARTICIPANT=${1}
. ./common-vars
. ./openstack_credentials.rc $PARTICIPANT
. ./main_credentials.rc

VM_NAME=`expr charmedosm-${PARTICIPANT}`
echo "Creating public port"
# This port gets created as the admin
openstack port create --security-group default --network $NETWORK $VM_NAME
openstack port create --disable-port-security --enable --network $NETWORK $VM_NAME
wait



NOT_READY=1
while [ $NOT_READY -eq 1 ] ; do
    openstack server list
    NOT_READY=$?
done


echo "Creating Keypair"
openstack keypair create --public-key ./hackfest_rsa.pub ${KEY_NAME} &
wait
+9 −16
Original line number Diff line number Diff line
#!/bin/bash
echo $0 started at $(date)

PARTICIPANT=${1}
. ./common-vars
. ./openstack_credentials.rc PARTICIPANT
. ./main_credentials.rc

OPENSTACK_USER=hackfest15group${PARTICIPANT}
PROJECT=hackfest15group${PARTICIPANT}
PASSWORD=hackfest15group-${PARTICIPANT}!
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)
    for ROUTER in $(openstack router list -f value -c ID); do
        openstack router unset --external-gateway ${ROUTER}
        PORT=$(openstack 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)
            openstack router remove port ${ROUTER} ${PORT}
            PORT=$(openstack 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
    openstack server list -f value -c ID | xargs openstack 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
    openstack router list -f value -c ID | xargs openstack 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
    openstack port list -f value -c ID   | xargs openstack port delete
fi


+143 −0
Original line number Diff line number Diff line
./create-openstack-vm.sh started at Çrş 07 Haz 2023 11:35:59 +03
Creating public port
The option [tenant_id] has been deprecated. Please avoid using it.
+-------------------------+------------------------------------------------------------------------------+
| Field                   | Value                                                                        |
+-------------------------+------------------------------------------------------------------------------+
| admin_state_up          | UP                                                                           |
| allowed_address_pairs   |                                                                              |
| binding_host_id         |                                                                              |
| binding_profile         |                                                                              |
| binding_vif_details     |                                                                              |
| binding_vif_type        | unbound                                                                      |
| binding_vnic_type       | normal                                                                       |
| created_at              | 2023-06-07T08:36:02Z                                                         |
| data_plane_status       | None                                                                         |
| description             |                                                                              |
| device_id               |                                                                              |
| device_owner            |                                                                              |
| device_profile          | None                                                                         |
| dns_assignment          | None                                                                         |
| dns_domain              | None                                                                         |
| dns_name                | None                                                                         |
| extra_dhcp_opts         |                                                                              |
| fixed_ips               | ip_address='172.21.248.95', subnet_id='d14f68b7-8287-41fe-b533-dafb2240680a' |
| id                      | 3015e793-2ec3-4427-b070-07a3d52d7196                                         |
| ip_allocation           | None                                                                         |
| mac_address             | fa:16:3e:ea:1e:8e                                                            |
| name                    | charmedosm-5                                                                 |
| network_id              | 21ea5d92-24f1-40ab-8d28-83230e277a49                                         |
| numa_affinity_policy    | None                                                                         |
| port_security_enabled   | False                                                                        |
| project_id              | f3ba6235ec7b4e9fbe6002992d60a207                                             |
| propagate_uplink_status | None                                                                         |
| qos_network_policy_id   | None                                                                         |
| qos_policy_id           | None                                                                         |
| resource_request        | None                                                                         |
| revision_number         | 1                                                                            |
| security_group_ids      |                                                                              |
| status                  | DOWN                                                                         |
| tags                    |                                                                              |
| tenant_id               | f3ba6235ec7b4e9fbe6002992d60a207                                             |
| trunk_details           | None                                                                         |
| updated_at              | 2023-06-07T08:36:02Z                                                         |
+-------------------------+------------------------------------------------------------------------------+
Creating Keypair
+-------------+-------------------------------------------------+
| Field       | Value                                           |
+-------------+-------------------------------------------------+
| created_at  | None                                            |
| fingerprint | fe:af:ae:27:b9:9d:73:6e:a2:00:c8:10:03:21:89:fe |
| id          | hackfest                                        |
| is_deleted  | None                                            |
| name        | hackfest                                        |
| type        | ssh                                             |
| user_id     | 5fcfab909583499e8af7ed632709dc2e                |
+-------------+-------------------------------------------------+
Launching OSM VM
The option [tenant_id] has been deprecated. Please avoid using it.
More than one Port exists with the name 'charmedosm-5'.
Waiting for OSM VM to be ready
./create-openstack-vm.sh started at Çrş 07 Haz 2023 11:40:01 +03
Creating public port
The option [tenant_id] has been deprecated. Please avoid using it.
+-------------------------+-------------------------------------------------------------------------------+
| Field                   | Value                                                                         |
+-------------------------+-------------------------------------------------------------------------------+
| admin_state_up          | UP                                                                            |
| allowed_address_pairs   |                                                                               |
| binding_host_id         |                                                                               |
| binding_profile         |                                                                               |
| binding_vif_details     |                                                                               |
| binding_vif_type        | unbound                                                                       |
| binding_vnic_type       | normal                                                                        |
| created_at              | 2023-06-07T08:40:04Z                                                          |
| data_plane_status       | None                                                                          |
| description             |                                                                               |
| device_id               |                                                                               |
| device_owner            |                                                                               |
| device_profile          | None                                                                          |
| dns_assignment          | None                                                                          |
| dns_domain              | None                                                                          |
| dns_name                | None                                                                          |
| extra_dhcp_opts         |                                                                               |
| fixed_ips               | ip_address='172.21.249.248', subnet_id='d14f68b7-8287-41fe-b533-dafb2240680a' |
| id                      | dea3d03e-5876-43b3-b27c-340d05706508                                          |
| ip_allocation           | None                                                                          |
| mac_address             | fa:16:3e:ef:31:40                                                             |
| name                    | charmedosm-5                                                                  |
| network_id              | 21ea5d92-24f1-40ab-8d28-83230e277a49                                          |
| numa_affinity_policy    | None                                                                          |
| port_security_enabled   | False                                                                         |
| project_id              | f3ba6235ec7b4e9fbe6002992d60a207                                              |
| propagate_uplink_status | None                                                                          |
| qos_network_policy_id   | None                                                                          |
| qos_policy_id           | None                                                                          |
| resource_request        | None                                                                          |
| revision_number         | 1                                                                             |
| security_group_ids      |                                                                               |
| status                  | DOWN                                                                          |
| tags                    |                                                                               |
| tenant_id               | f3ba6235ec7b4e9fbe6002992d60a207                                              |
| trunk_details           | None                                                                          |
| updated_at              | 2023-06-07T08:40:04Z                                                          |
+-------------------------+-------------------------------------------------------------------------------+
Creating Keypair
ConflictException: 409: Client Error for url: http://172.21.247.1:8774/v2.1/os-keypairs, Key pair 'hackfest' already exists.
Launching OSM VM
The option [tenant_id] has been deprecated. Please avoid using it.
+-------------------------------------+----------------------------------------------------+
| Field                               | Value                                              |
+-------------------------------------+----------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                             |
| OS-EXT-AZ:availability_zone         |                                                    |
| OS-EXT-SRV-ATTR:host                | None                                               |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                               |
| OS-EXT-SRV-ATTR:instance_name       |                                                    |
| OS-EXT-STS:power_state              | NOSTATE                                            |
| OS-EXT-STS:task_state               | scheduling                                         |
| OS-EXT-STS:vm_state                 | building                                           |
| OS-SRV-USG:launched_at              | None                                               |
| OS-SRV-USG:terminated_at            | None                                               |
| accessIPv4                          |                                                    |
| accessIPv6                          |                                                    |
| addresses                           |                                                    |
| adminPass                           | 955KMZsruLpb                                       |
| config_drive                        |                                                    |
| created                             | 2023-06-07T08:40:12Z                               |
| flavor                              | osm.sanity (7d3c99d5-b597-4228-88e0-f67a81be6a64)  |
| hostId                              |                                                    |
| id                                  | 0992ad21-03e7-4401-b19d-25932d81e4a4               |
| image                               | ubuntu20.04 (d3cd2290-5813-4f77-90f8-7a1e8c21d9c6) |
| key_name                            | hackfest                                           |
| name                                | charmedosm-5                                       |
| progress                            | 0                                                  |
| project_id                          | f3ba6235ec7b4e9fbe6002992d60a207                   |
| properties                          |                                                    |
| security_groups                     | name='default'                                     |
| status                              | BUILD                                              |
| updated                             | 2023-06-07T08:40:12Z                               |
| user_id                             | 5fcfab909583499e8af7ed632709dc2e                   |
| volumes_attached                    |                                                    |
+-------------------------------------+----------------------------------------------------+
Waiting for OSM VM to be ready
+1286 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading