Programmatic Deployment of Infrastructures

Programmatic Deployment of Infrastructures


1. Deploy OpenStack on CloudLab

Find CloudLab profile for OpenStack
  • Log into CloudLab
  • Under Experiments drop down box, select Start Experiment.
Start Experiment
  • Click Change Profile.
Change Profile
  • Type OpenStack in the search box, and select the profile OpenStack as shown in the figure below.
    • Created By: johnsond
    • Last Updated: 2017-12-20 10:05:21
    • Click Select Profile when done.
OpenStack profile created by johnsond
  • Click Next.
Setup parameters and selecting sites
OpenStack select profile
  • Select the options similar to the figure below.
  • If the Parameterize tab does not look like this, click Previous to go back one step, and then click Next again.
Patameterization options
  • Only Utah, Wisconsin, and Clemson have been known to work with this profile.
  • I will use Utah for the remaining steps.
Resource selections
  • Do not change anything on the Schedule step and click Finish.
Provisioning resources
  • The startup scripts of this profile will take sometimes to run, approximately thirty minutes to one hour.
  • You will receive an email from CloudLab (to the registered) to inform you when the experiment is ready.
Waiting for email confirmations
  • Go to the experiment, and open the blue *Profile Instructions** box.
Profile Instructions
  • Follow the instructions to login to OpenStack dashboard. Your passwords will be randomly generated and unique to each experiment.
Domain, User Name, Password
  • You will see a Dashboard on a successful deployment as follows.
Administrative Dashboard

2. Deployment on OpenStack

Hands-on: Download Linux distribution
  • We will use Alpine Linux, a light-weight distribution that was created for containerization/cloud deployment.
  • From Alpine Download Page, select the x86_64 Virtual version.
Select correct x86_64 download
Create cloud image
  • Go to your CloudLab Dashboard.
  • Go to Compute/Images, then click on Create Image.
List of compute images
  • Click Browse and find and select the downloaded ISO file from the the previous slide.
  • Set the other parameters as shown in the figure below.
  • Click Create Image when done.
Create image
  • The image will show up in the Images tab.
Newly added image
Create volumes
  • Go to your CloudLab Dashboard.
  • Go to Volumes/Volumes, then click on Create Volume.
Create Volumes
  • Set the other parameters as shown in the figure below.
  • Alpine takes up a small amount of storage, so 2GB is more than enough for a simple installation.
  • Click Create Volume when done.
Options to create a new volume
  • The volume will show up in the Volumes tab.
New volume is added
Launching a compute instance
  • Go to your CloudLab Dashboard.
  • Go to Compute/Instances and click on Launch Instance.
Create Instances
  • Set the instance name and other parameters, then click Next
Selecting source with instance
  • Use the up arrow to select the alpine image as the allocated image. Click Next.
Selecting image to boot from
  • Select m1.tiny as the compute flavor. Click Next.
Selecting compute resource
  • Select flat-lan-1-net as the connected network. Click Launch Instance.
Selecting network resource
  • It should take a few minute for the instance to become ready.
Active compute resource
Volume attachment and Linux installation
  • Go to your CloudLab Dashboard.
  • Go to Compute/Instances
  • Click on the drop-down arrow under Actions for the alpine instance, then click Attach Volume.
Attach volume actions
  • Select your sda_**** volume ID created earlier, then click Attach Volume
Attach volume
  • Click on the drop-down arrow under Actions for the alpine instance.
  • Select Console.
Provisioning resources
  • Right click on Click here to show only console and select Open link in new tab.
  • This helps with navigating back and forth.
Launch a console
  • A new console tab appears!
  • You are now booting from the Alpine distro.
Login to the instance
  • Type root into thelocalhost login: prompt and hit Enter to log in.
Logged into the system as root
  • A quick review of Alpine installation process can be found on their wiki
  • Type setup-alpine and hit Enter to start the installation process.
  • Use the following options:
    • Select keyboard layout: us
    • Select variant: us
    • Enter system hostname ...: Hit Enter to accept default.
    • Which one do you want to initialize?: Hit Enter to accept eth0 as the default interface.
    • Ip address for eth0: Hit Enter to accept dhcp as the default value.
    • Do you want to do any manual network configuration?: Hit Enter to accept n as the default value.
    • Enter a complex password for root. DO NOT MAKE AN EASY PASSWORD. If your cloud instance got hacked and used for malicious purposes, you will be banned from CloudLab. Retype the password.
    • Which timezone are you in?: Type EST and hit Enter.
    • HTTP/FTP proxy URL?: Hit Enter to accept none as the default value.
    • For the mirror question, type 30 (the one from princeton), then hit Enter.
    • Which SSH server?: Hit Enter to accept openssh as the default value.
    • Which disk(s) would you like to use?: Review the lines above, and select the listed disk. There should be one as we already attached a volume to this instance. For me, it is vdb, so I type in vda and hit Enter.
    • How would you like to use it?: Type sys and hit Enter.
    • WARNING: Erase the above disk(s) and continue?: Type y and hit Enter.
Finish setting up different options
  • Once the installation process is completed, Leave this console running and return to the Dashboard.
  • Go to Compute/Instances
  • Click on the drop-down arrow under Actions for the alpine instance.
  • Select the sda_**** volume ID selected earlier, then click Detach Volume
Option to detach volume
  • Select the sda_**** volume ID created earlier, then click Detach Volume
Detaching for volumes
  • Go to your CloudLab Dashboard.
  • Go to Volumes/Volumes.
  • In the Actions box of sda_****, click the drop-down arrow and select Upload to Image.
Volume options
  • Set Image Name to alpine-disk and Disk Format as Raw, then click Upload.
Upload volumes to image
  • Successful upload:
Image appeared in list

3. Challenge

Setup new instance
  • Launch another compute instance using the newly created alpine-disk image.
    • Pay attention to the flavor.
  • Log into the console and confirm that you can use the root password created earlier to log in
New launched instance with working image
Setup Apache webserver on the previous new instance
  • You should be inside the console after log in as root and have the root password.
  • Run the following commands to install Apache webserver
1
2
3
$ apk update
$ apk add apache2
$ rc-service apache2 start
Update and install apache2
Setup public IP address
  • To expose the webserver, we need a public IP address.
  • Go to your CloudLab Dashboard.
  • Go to Compute/Instances
  • Click on the drop-down arrow under Actions for the alpine instance, then click Associate Floating IP.
Associating floating IPs
  • Click on the + sign to allocate IP address.
Allocating public IP addresses
  • Click on Allocate IP.
Associate public IP address with the running instance
  • Click on Associate.
Associating IP to instance
  • You should see the public IP address with your instance
IP address on instance
  • Try visiting this IP address now, anything?

4. Cloud Security Basic

Cloud security basic
  • In the cloud, egress means traffic that’s leaving from inside the private network out to the public internet (similar to standard network definition).
Egress traffic generated from inside the cloud
  • In the cloud, ingress refers to unsolicited traffic sent from an address in public internet to the private network – it is not a response to a request initiated by an inside system. In this case, firewalls are designed to decline this request unless there are specific policy and configuration that allows ingress connections.
Ingress traffic generated from inside the cloud
Handle security
  • Go to your CloudLab Dashboard.
  • Go to Network/Security Group
  • Click on Manage Rules.
Security groups
  • Click Add Rules
Security group rule lists
  • In the Rule drop down box, select HTTP, then click Add.
HTTP port
  • You can see the new Ingress rule for HTTP.
Security rules for HTTP is added
  • The apache webserver is now visible
Apache2 webserver