Sign inSign up

farberg/edsc-openstack-studentnodes

By farberg

•Updated over 5 years ago

https://github.com/pfisterer/edsc-openstack-studentnodes

Image
0

218

farberg/edsc-openstack-studentnodes repository overview

⁠Ansible Playbook for Generating Virtual Machines in OpenStack for Students

Creates a number of virtual machines with

Provides remote access to

  • SSH (native or web interface)
  • a graphical desktop (VNC via web interface or RDP via client)

Original Github repo: https://github.com/pfisterer/edsc-openstack-studentnodes⁠

⁠Todos

⁠Usage (local installation of Ansible)

  1. Set the required environment variables (see table below) and run ansible-playbook
    • Set environent variables (e.g., using multiple export NAME="VALUE" statements on Linux)
  2. Run ansible-playbook deploy.yaml
  3. Open generated-server-list.txt for the IP adresses of the created machines
  4. Navigate to https://an-IP-address⁠ and ignore the security warning

Example

export OS_USERNAME="my-openstack-user-name"
export OS_PASSWORD="my-openstack-secret-pw"
export OS_DOMAIN_NAME="default"
export OS_AUTH_URL="http://openstack-controller-hostname:5000/v3"
export OS_PROJECT_NAME="my-project"

export ANSIBLE_HOST_KEY_CHECKING=False 

export NODE_COUNT=1
export NODE_PASSWORD="bla"
export IMAGE="Ubuntu Server 18.04 64bit (29.05.2018)"
export NODE_FLAVOR="m1.medium"
export NODE_SEC_GROUP="default"
export KEY="my-laptop-ssh-key"
export EXT_NET="ext-network"
export FLOATING_IP_POOL="ext-network"

ansible-playbook deploy.yaml

⁠Usage (Docker, image farberg/edsc-openstack-studentnodes⁠)

  1. Directory where to store the file with IP adresses of the created machines
  • Create directory on your local machine
  • Mount this diretory using -v /your/absolute/path/to/some/dir:/data
  1. Set the required environment variables (see table below)
    • Requires multiple --env "NAME=VALUE" parameters
    • Make sure to set GENERATED_SERVER_LIST to a file in /data/ (e.g., GENERATED_SERVER_LIST=/data/generated-server-list.txt)
  2. Make your ssh keys available
    • Requires mounting them as /root/.ssh/ using -v /your/absolute/path/to/.ssh/:/root/.ssh/
  3. Create a single command from the values above
  4. See /your/absolute/path/to/some/dir/generated-server-list.txt for the IP adresses of the created machines
  5. Open https://IP-address⁠ and ignore the security warning

Example

docker run --rm -ti \
  -v "/your/absolute/path/to/some/dir:/data" \
  -v "/your/absolute/path/to/.ssh/:/root/.ssh/" \
  --env "NAME=VALUE" \
  --env "GENERATED_SERVER_LIST=/data/generated-server-list.txt" \
  farberg/edsc-openstack-studentnodes

⁠Environment Variables

Specific to this project:

NameRequiredDescriptionExample
NODE_COUNTNumber of nodes to creates1
NODE_PASSWORDxPassword to set for user ubuntublablubb
NODE_NAMEPrefix for hostnamesdemo-lecture
IMAGExName of the OS image to use"Ubuntu Server 18.04 64bit (29.05.2018)"
NODE_FLAVORxName of the machine flavor to usem1.medium
NODE_SEC_GROUPxSecurity group to usedefault
KEYxName of the SSH key to usemy-laptop-ssh-key
EXT_NETxName of the external networkext-network
FLOATING_IP_POOLxName of the floating IP poolext-network
DNS_SERVER_1DNS server #1 (defaults to 8.8.8.8)8.8.8.8
DNS_SERVER_1DNS server #2 (defaults to 8.8.8.8)8.8.8.8
GENERATED_SERVER_LISTPath of the file to store the list of machine IPs/data/generated-server-list.txt

For default values, see group_vars/all.yaml⁠

Required by Openstack:

NameRequiredDescriptionExample
OS_AUTH_URLxhttp://openstack-controller-hostname:5000/v3
OS_USERNAMExmy-openstack-user-name
OS_PASSWORDxmy-openstack-secret-pw
OS_PROJECT_NAMExmy-project
OS_DOMAIN_NAMExdefault

⁠Build Docker image

Build the image

  • docker build -t farberg/edsc-openstack-studentnodes .

Run a container

  • docker run --rm -ti farberg/edsc-openstack-studentnodes

Tag summary

Content type

Image

Digest

Size

124.2 MB

Last updated

over 5 years ago

docker pull farberg/edsc-openstack-studentnodes