Lab Program:10
VM using TryStack
Aim: To find a procedure to launch virtual machine using trystack (online openstack demo
version).
PROCEDURE:
OpenStack is an open-source software cloud computing platform. OpenStack is primarily used
for deploying an infrastructure as a service (IaaS) solution like Amazon Web Service (AWS).
TryStack is the easiest and free way to do it.
Minimum requirements for OpenStack is listed below:
4 GB Of Ram. 4 CPU Units.
30 GB Disk Space
Step 1: Prepare the environment for installing OpenStack:
Run the following commands and you will be done with it tobring all your packages to the
latest version and install git so that we can clone OpenStack to our Linux machine.
Commands :
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist- upgrade
sudo apt-get install git -y
sudo reboot
Step 2: Download and Install OpenStack!
Note: If you already have a “stack” user on your virtual machine or laptop
(with sudo privileges), then you do not need to create an additional user.
After your virtual machine is done with a reboot, you are now ready to install OpenStack.
Normally OpenStack runs under non-root user with sudo privileges. We caneasily create
one to start with using:
Create the user named as “stack”
sudouseradd -s /bin/bash -d /opt/stack -m stack
Now let us give this user sudo privileges using:
echo"stack ALL=(ALL) NOPASSWD: ALL"|sudotee/etc/sudoers.d/stack
We now have to log in as user “stack” to proceed with our installation as
sudosu–stack
Start with the installation of openstackby downloading the required material.
git clone https://git.openstack.org/openstack-dev/devstack
# cd to the cloned directory
cddevstack
Normally during installing it will ask you to set various passwords, you can automate this process
by creating a file in your current directory named “local.conf”. Save and exit the following file, this
will automate the installation process.
# create the file
$nanolocal.conf
# Now paste following contents in the file
[[local|localrc]] ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
We are now ready to run the installation script. Installation script can be launched
using the command:
./stack.sh
Once installation is complete your screen should be :
OpenStack dashboard can now be accessed at : http://<IPAddress>/dashboard/
Step 3: Create Network!
Note: Please remember that without having a network, you cannot launch an instance/virtual machine.
After you are logged into the OpenStack Dashboard it will look something like this:
We need to create a network that virtual machine can use. For now, it will just be a dummy
network:
Steps :
1. Click the Project Drop Down.
2. Click the Network Drop Down.
3. From network Drop Down select Networks, and this window will open that you see onthe
right side.
4. Finally, click Create Network.
Once all these things are done, click “Next”.
Now everything is optional in this below window if you are interested in filling something up, you
can. Otherwise, leave everything as it is and click “Create”. You now have a network that you can
use to launch a virtual machine.
Now, there are 11 tabs to create an instance, we will go through each tab one by one.
Details Tab :
This is a general information tab for creating an instance,
You will have to assign a name to your virtual machine onthis tab. Select zone to launch a virtual
machine, and tell how many copies of virtual machine you want.
Source Tab
Normally when we create a virtual machine on Proxmox or VMWare we need to insert CD-ROM In
OpenStack this is done by Source Tab, you can use various ways to launch a new virtual machine,
OpenStack allows you to choose following as a source to create your instance.
Image
Snapshot of already created instance Volume or volume Snapshot
We are going to use “Cirros” image to create our instance.
1. Click on the icon where the first arrow is pointing, so that we can use “Cirros” to
launch our virtual machine.
2. After the image is selected, just click “Next” so that we can move to “Flavor” tab.
Flavor Tab
Flavor tab will allow you to allocate resource to your instance. Like:
Ram. CPU.
Disk Space.
It is similar to giving virtual resources to the virtual machine, but OpenStack gives fancy
names to everything
You can see that there are 11 available pre-configured templates to choose from. The one Ichoose gave
following resources to the instance:
1 virtual CPU.
512 MB Ram. 1 GB Disk.
After flavor is selected, just press “Next”.
Network Tab
Network tab allows us to define a network for our virtual machine, you might have remembered
that we’ve created a network above for this purpose.
Now by default, the network you have created above will be selected for this machine, as seen in the
image below:
Don’t change anything just click “Next”.
Network Ports Tab
For now, just leave the default settings on “Network Ports” tab and click next.
Security Groups Tab
Security groups define how a specific virtual machine is allowed to talk with the outer world. As for
now, we are just trying to create our first virtual machine; you can leave all the defaults.
Key-Pair Tab
Leave defaults and click Next.
Configuration Tab
Leave defaults and click Next.
Server Groups Tab
Leave defaults and click Next.
Scheduler Hints Tab
Leave defaults and click Next.
Metadata Tab
Leave defaults and click Next.
Launch Instance
After going through all the tabs, you are now ready to press that magic “Launch Instance” button.
Once you click “Launch Instance” button, OpenStack will start creating our virtual machine, and it is
going to look something like this:
Step 5: Access Virtual Machine Console!
Once you click “Launch Instance” it will take OpenStack few seconds to create your virtual
machine. Once ready you can access the console to see how the command line of your first virtual
machine looks like.
OUTPUT:
RESULT:
The procedure for find a procedure to launch virtual machine using trystack(online openstack demo
version) was learned and verified successfully.