Giter VIP home page Giter VIP logo

openstack-application-orchestration-demo's Introduction

openstack-application-orchestration-demo

Automatic deployment of a custom application on an OpenStack scenario

Deployment instructions

  • On a DIT lab computer, create the OpenStack virtual environment as usual:
/mnt/vnx/repo/cnvr/bin/get-openstack-tutorial.sh
cd /mnt/tmp/openstack_lab-ocata_4n_classic_ovs-v04
sudo vnx -f openstack_lab.xml -t
sudo vnx -f openstack_lab.xml -x start-all,load-img
vnx_config_nat ExtNet <interfaz_externo>
  • Copy the files "admin-openrc.sh", "demo-openrc.sh" and the contents of the "deployment" folder to that computer. The deployment is intended to be run from the host (project requirement 1), as the "demo" user (project requirement 2).

  • Currently, the external network needs to be manually created (provider networks require "admin" privileges, because they connect to the physical infrastructure). We need to set the environment variables properly and create the network:

source admin-openrc.sh
openstack network create --share --external --provider-physical-network provider --provider-network-type flat ExtNet
openstack subnet create --network ExtNet --gateway 10.0.10.1 --dns-nameserver 10.0.10.1 --subnet-range 10.0.10.0/24 --allocation-pool start=10.0.10.100,end=10.0.10.200 ExtSubNet
  • Release the admin privileges and set environment to "demo" user:
source demo-openrc.sh
  • Finally, deploy the stack from the controller with the following command. Remember that you need to have the correct environment variables (you can reset them with "source bin/admin-openrc.sh"):
openstack stack create -t deployment.yaml -e deployment_parameters.yaml <nombre_stack>

Check HOT templates syntax: You can use the "--dry-run" option of the creation command or use:

openstack orchestration template validate -t <file.yaml>

Image creation

Deployment scripts require that pre-built images exist in the Glance image service. Image creation should be a one-time step to be performed independently from deployment, as per project requirement 3.

The "image_creation" folder contains the HOT templates and cloud-init files required for image creation. To create the images:

  • Start from an OpenStack scenario with ExtNet created by an admin user (see "Deployment instructions").

  • Copy the files from the "image_creation" folder and source the "demo-openrc.sh" script in the computer's lab (i.e. the host)

  • Run the desired stack(s). For instance:

openstack stack create -t install_zookeeper.yaml -e parameters.yaml <nombre_stack>
  • Log into the OpenStack web interface. Check the result of the stack creation in "orchestration -> stacks". Take into account that software installations may take some minutes. The templates should create running instances, wait until they are active and have installed all the software.

  • From the OpenStack "Compute -> Instances" menu, use the option "Create snapshot". Give the snapshot the same name that is used in the "deployment" files. When the process finishes, the image is ready to be used.

  • Delete the stack to release resources. The created image will not be erased, as it was not part of the HOT template. Deletion can be done from the web interface or by running:

openstack stack delete <nombre_stack>

We can also create an image from an instance through CLI:

  • Get instance name:
openstack server list
  • Stop the running instance:
openstack server stop <instanceName>
  • Wait until the instance shows status SHUTOFF:
openstack server list
  • Create the snapshot (aka image):
openstack server image create <intanceName> --name <imageName>
  • Verify that the new image status is ACTIVE:
openstack image list

Enabling/disabling SSH firewall rule

The SSH connection to the admin server needs to be enabled when needed. There is a script that manages the creation and deletion of FW rules to handle this. When executed, it deletes the rule if exists and creates it if not. Go to the project root directory and run:

./sshFwRule.sh

Note: rules are associated with the source IP.

openstack-application-orchestration-demo's People

Contributors

mikirockerful avatar chookly314 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.