Monday, October 30, 2017

Creating and launching instances in Horizon

Here i am providing the steps to create and launch instances and tenant using horizon dash board in open stack



  • As per the architecture given below we have configured the horizon dash board using the ip 192.168.2.14

















  • We have to type http://192.168.2.14/dashboard to get the horozon as below and we need to login as per the credentials mentioned in /root/keystonrc file . In this case it is admin/password
























  • In the dashboard menu go to Identity/projects/create project and type the project name , i am going  to give the sample as tuxfixer here .














  • Create a new user and assign him a the new tenant ( here tuxfixer) . Go to : Identity/users/create user assign user as a member to the newly created tenant tuxfixer 













  • Logout from the admin and login as a new user (tuxfixer) here and create new networks and routes go to Project/networks/create network 











below details need to be given to create the private & public network


Create following net:
Network Name: priv_net
Admin State: UP

Create following subnet:
Subnet Name: priv_subnet
Network Address: 192.168.20.0/24
IP Version: IPv4
Gateway IP: 192.168.20.1
DHCP: Enable

Now let’s create public network. Click the Create Network button once again:

Create following net:
Network Name: pub_net
Admin State: UP

Create following subnet:
Subnet Name: pub_subnet
Network Address: 192.168.2.0/24
IP Version: IPv4
Gateway IP: 192.168.2.1
DHCP: Disable
Allocation Pools: 192.168.2.6 – 192.168.2.10

  • So we should have 2 networks in our dash board priv_net and pub_net 







  • Now we have to update the pub_net to public network which can be performed only as admin. So again we need to logout from tuxfixer and login as admin . Then go to dashboard of Admin/networks/ edit the network of pub_net and select the external network check box and save the changes 








Logout from the admin and login as tuxfixer again and now we need to create the router for internal to external connectivity part

Go to Project/network/routers/create router

router name:  router0
Click Set Gateway for router0:
External Network: pub_net
In the dashboard we should see now our router0 with external Network set for pub_net








Click on the router then Add Interface
Subnet: priv_net: 192.168.20.0/24 (priv_subnet)
IP Address: 192.168.20.1










We will get the below diagram while we check the network topology












Now we need to create flavors as per our requirement , which allows user's to select different templates of instances with predefined resources . Flavors are defined as per below criteria
– Virtual CPUs
– RAM
– disk size
– swap size

Open stack comes with many predefined flavors which can be accessed from Admin/System/Flavors


 











  • Upload image - Open stack uses different types of images as per the requirement like VDI,QCOW2,ISO,VMDK etc .  I am using cirros_mage due to its small size which is good for cloud environments.

Current Cirros Image (cirros-0.3.4-x86_64-disk.img) available at: http://download.cirros-cloud.net.

Image details:
Name: cirros
Description: cirros image
Image Source: Image File
Image File: cirros-0.3.4-x86_64-disk.img
Architecture: (leave blank)
Minimum Disk: (leave blank)
Minimum RAM: (leave blank)
Public: No
Protected: No















  • Create security groups - The basic functionality of the security group is to control the network access inside the tenant . 

Go to: Project / Compute / Access & Security / Create Security Group.

Security Group details:
Name: tuxfixer_sec_group
Description: tuxfixer security group













In the tuxfixer security group row click on manage rules and add the following rules 

Egress IPv4 ICMP – 0.0.0.0/0 (CIDR)
Ingress IPv4 ICMP – 0.0.0.0/0 (CIDR)
Ingress IPv4 TCP 1 – 65535 0.0.0.0/0 (CIDR)
Egress IPv4 TCP 1 – 65535 0.0.0.0/0 (CIDR)











Assign floating IP's to the tenant . Floating IP's are used to access the instances from public network 


To assign new IPs to the Project Tanant go to: Project -> Compute -> Access & Security -> Floating IPs -> Allocate IP to The Project

Allocate 2 Floating IPs:
Pool: pub_net











  • Create instances - 

Now when we have all the need components, we can create Instances (virtual machines running inside cloud).
Let’s create 2 Instances, go to: Project -> Compute -> Instances -> Launch Instance

Details Tab:
Availability Zone: nova
Instance Name: cirros_instance
Flavor: m1.tiny
Instance Count: 2
Instance Boot Source: Boot from image
Image Name: cirros

Access & Security Tab:
Key Pair: No key pairs available
Security Groups: tuxfixer_sec_group

Networking Tab:
Selected networks: priv_net

Post-Creation Tab: leave as it is

Advanced Options Tab: leave as it is

Note: Process of creating Instances may take couple of minutes.

View of created instances:









  • We have running instances and floating IP's assined to the project . We can assign the floating IP to a particular instance by selecting the Actions column choose Associate Floating IP from drop down menu.


  • We can access the console by clicking the console tab 
Login to instance console:
instance login: cirros
instance password: cubswin:)
















  • Also test the connectivity from controller and compute node using the ssh login 
[trl ~]# ping 192.168.2.6
PING 192.168.2.6 (192.168.2.6) 56(84) bytes of data.
64 bytes from 192.168.2.6: icmp_seq=1 ttl=63 time=17.0 ms
64 bytes from 192.168.2.6: icmp_seq=2 ttl=63 time=1.08 ms
64 bytes from 192.168.2.6: icmp_seq=3 ttl=63 time=0.707 ms
64 bytes from 192.168.2.6: icmp_seq=4 ttl=63 time=0.666 ms
^C
--- 192.168.2.6 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 0.666/4.872/17.030/7.021 ms
[trl ~]# ping 192.168.2.7
PING 192.168.2.7 (192.168.2.7) 56(84) bytes of data.
64 bytes from 192.168.2.7: icmp_seq=1 ttl=63 time=14.8 ms
64 bytes from 192.168.2.7: icmp_seq=2 ttl=63 time=1.08 ms
64 bytes from 192.168.2.7: icmp_seq=3 ttl=63 time=0.730 ms
64 bytes from 192.168.2.7: icmp_seq=4 ttl=63 time=0.943 ms
^C
--- 192.168.2.7 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 0.730/4.411/14.886/6.049 ms


No comments:

Post a Comment