Introduction to OpenStack Nabil Abdennadher, HES-SO What is - - PowerPoint PPT Presentation
Introduction to OpenStack Nabil Abdennadher, HES-SO What is - - PowerPoint PPT Presentation
Introduction to OpenStack Nabil Abdennadher, HES-SO What is OpenStack ? Free and open-source cloud-computing software platform. Provides services for managing a Cloud environment on the fly. Consists of a group of interrelated
2
- Free and open-source cloud-computing software platform.
- Provides services for managing a Cloud environment on the fly.
- Consists of a group of interrelated projects that control pools of
processing, storage, networking resources, authentication, storage, etc.
- Initially designed to provide services for an IaaS
- Today, OpenStack provides “high level” services
What is OpenStack ?
3
- OpenStack (architecture, projects, services)
- A use-case: hepiaCloud. Learned lessons
- OpenStack client
- OpenStack SDK
Plan
A bit of OpenStack history
4
- 2005-2010: Rackspace develops their cloud solution
- March 2010 - decides to open source it
- May 2010 - NASA open sources its Nebula platform
- June 2010 - NASA and Rackspace join hands to create OpenStack
- July 2010 - Inaugural design summit in Austin convened with 25+
partners
- August 2011: Canonical backs OpenStack
- Oct 2011 - DELL adopts OpenStack
- 2012 - AT&T, HP, VMWare, Intel, NEC joins OpenStack
- Sep 2012 - OpenStack foundation formally launched
5
OpenStack releases
https://releases.openstack.org/
OpenStack forum
6
- OpenStack foundation serves more than 60,000 Individual Members
from over 180 countries around the world.
Cloud Infrastructures, based
- n OpenStack
7
8
Basic services
9
Identity service : Keystone
- Keystone: provides identity services for OpenStack.
- A
central list
- f
users/permissions mapped against OpenStack services.
- Keystone is organized as a group of internal services exposed on one
- r many endpoints.
- The Identity service generates authentication tokens that permit
access to the OpenStack services REST APIs.
10
Identity service : Keystone
- Clients obtain this token and the URL endpoints for other service APIs
by supplying their valid credentials to Keystone.
- Each time you make a REST API request to an OpenStack service,
you supply your authentication token in the X-Auth-Token request header.
11
- Glance: provides image services to OpenStack.
- "images" refers to images of hard disks. Used as templates for
deploying new VMs.
Image Service: Glance
- A client: any application that makes use of a Glance
server.
- REST API: Glance functionalities are exposed via
REST.
- Database Abstraction Layer (DAL): an application
programming interface (API) that unifies the communication between Glance and databases.
- Glance
Domain Controller: middleware that implements the main Glance functionalities such as authorization, notifications, policies, database connections.
- Glance Store: used to organise interactions between
Glance and various data stores.
- Registry Layer: optional layer that is used to organise
secure communication between the domain and the DAL by using a separate service.
Image Service: Glance
https://docs.openstack.org/glance/pi ke/contributor/architecture.html
13
- OpenStack compute (nova): Manages the lifecycle of compute
instances in an OpenStack environment. Responsibilities include spawning, scheduling and decommissioning of virtual machines on demand.
- Tools using nova:
- Horizon
- OpenStack Client: Official CLI for OpenStack Projects. It includes not just
nova commands but also commands for most
- f
the projects in OpenStack.
Compute service: OpenStack compute (nova)
14
- Networking service (Neutron): provides the networking capability
for OpenStack. Enables Network-Connectivity-as-a-Service for other OpenStack services.
- OpenStack Networking enables projects to create virtual network
topologies which may include services such firewalls, load balancers and Virtual Private Network (VPN).
- Networking provides networks, subnets, and routers as object
abstractions.
Networking service: Neutron
15
Networking service: Neutron
16
- Networking Option 1: Provider networks
- The provider networks option deploys the OpenStack Networking service in the simplest
way possible with primarily layer-2 (bridging/switching) services and VLAN segmentation of networks.
- It bridges virtual networks to physical networks and relies on physical network
infrastructure for layer-3 (routing) services.
- A DHCP service provides IP address information to instances.
- Networking Option 2: Self-service networks
- The self-service networks option augments the provider networks option with layer-3
(routing) services that enable self-service networks using
- verlay
segmentation methods such as VXLAN.
- Essentially, it routes virtual networks to physical networks using NAT.
- This option provides the foundation for advanced services such as LBaaS and FWaaS.
Networking service: Neutron
17
Dashboard: Horizon
- Horizon: The front
- ffice of OpenStack.
- The only native
graphical interface to OpenStack.
18
Storage services: Swift &Cinder
- Cinder: block storage component, analogous to the traditional access on
a disk drive.
- Swift: storage system for objects and files.
- Users refer to a unique file identifiers: OpenStack decides where to
store/back-up etc.
Object storage
19
- Data kept on object storage devices are accessed directly through APIs or
http/https.
- Data : photos, videos, and log files.
- The object store guarantees that the data will not be lost.
- Object storage data can be replicated across different data centers and
- ffer simple web services interfaces for access.
- … Anyone who’s stored a picture on FB has used object storage.
Object Data contains three things …
20
- The data itself: the data can be anything you want to store.
- Metadata: the metadata is defined by the user; it contains
contextual information: what data should be used for, its confidentiality, etc.
- A globally unique identifier: the identifier is an address
given to the object in order for the object to be found over a distributed system. This way, it’s possible to find the data without having to know the physical location of the data.
When to use the block storage (Cinder) ?
21
- When Strong consistency is needed:
- real-time systems such as transactional databases that are constantly
being written to.
- a read request must return the most updated version of the data.
- When scalability is no an issue
- When scalability becomes more difficult within a geographically distributed
system.
When to use Object storage (Swift) ?
22
- Solving the increasing problem of data growth
- Solving the provisioning management issues: Web content, data
backup, and archives are good use cases
- metadata functionality, facilitate this ease of use.
- Resiliency
- at least three copies of every file are stored
- The distributed storage design for high availability allows less-expensive
commodity hardware to be used
- àThe data protection is built into the object architecture
- The downside is that there is no guarantee that a read request returns the
most recent version of the data.
Swift resources
23
24
- Controller node runs:
- Identity service (Keystone)
- Compute management (nova)
- Networking (Neutron)
- Image Service (Glance)
- Dashboard (Horizon).
- Supporting services: SQL database, message queue, and Network Time
Protocol (NTP).
Controller Node
25
- Compute node(s)
- Runs the hypervisor portion of Compute that operates instances. By
default, Compute uses the KVM hypervisor.
- Runs a Networking service agent that connects instances to virtual
networks and provides firewalling services to instances via security groups.
Compute nodes
26
- Block Storage nodes
- The optional Block Storage node contains the disks that the Block Storage
and Shared File System services provision for instances.
- We can have more than one block storage node.
- Object Storage nodes
- Contain the disks that the Object Storage service uses for storing
accounts, containers, and objects.
- Object Storage requires two nodes. We can deploy more than two object
storage nodes.
Storage nodes (optional)
27
Hardware requirements
https://docs.openstack.org/neutron/lates t/install/overview.html
28
https://docs.openstack.org/newton/install-guide- ubuntu/overview.html
2019: There are 63 projects
29 https://governance.openstack.org/tc/reference/projects/
30
- Compute
- Hardware Lifecycle
- Storage
- Networking
- Shared Services
- Orchestration
- Workload Provisioning
- Application Lifecycle
- API Proxies
- Web Frontend
Additional services
https://www.openstack.org/software/project- navigator/openstack-components#openstack-services
31
- trove: database service: provides cloud provisioning functionality for
database engines.
- magnum: Container Infrastructure Management service. OpenStack
API service making container orchestration engines (COE) such as Docker Swarm, Kubernetes and Mesos available as first class resources in OpenStack
- Ironic: Bare metal service. Collection of components that provides
support to manage and provision physical machines.
Additional services
32
- heat: Orchestration service
- manila: Shared File Systems service (manila): provides coordinated
access to shared or distributed file systems.
- aodh: Telemetry Alarming services (aodh): trigger alarms when the
collected metering or event data break the defined rules.
- ceilometer: Telemetry data Collection service: provide the following
functions:
- Efficiently polls metering data related to OpenStack services.
- Collects event and metering data by monitoring notifications sent
from services.
- Publishes collected data to various targets including data stores and
message queues.
Additional services
Not all services are equally used or deployed!
33
34
35
- OpenStack
- A use-case: hepiaCloud. Learned lessons
- OpenStack client
- OpenStack API SDK
Plan
hepiaCloud
36
- Based on OpenStack (Newton)
- Hypervisor: Linux-KVM
- Heterogeneous resources
- 8 servers: 128 GB RAM, 24 vCPU
- 1 server : 504 GB RAM, 112 vCPU
- 1 server : 504 GB RAM, 128 vCPU
- 30 desktops: 32 GB RAM, 4 vCPU
- hepiaCloud provides
- 552 vCPU
- ~2.1 TB of RAM
- ~20 To of HDD
- Instances are in a private network
hepiaCloud
37
10 servers GbE network GbE network GbE network 15 desktops 15 desktops GbE network (a vlan through hepia’s network) BXXX (IT centre) A401 A425 Internet
hepiaCloud architecture
hepiacloud .hesge.ch
hepiaCloud architecture
40
- Network : 192.168.0.0/22
- 192.168.0.1 – 192.168.0.254 : hypervisors (physical servers)
- 192.168.1.0 – 192.168.3.254 : floating IP addresses
The network
41
Configuring floating IP addresses
42
- ssh –i key.pem –p 10XXX ubuntu hepiacloud@hesge.ch
To access hepiaCloud instances
43
- The hardware requirements announced by OpenStack for the controller
node are under-estimated.
- To build a stable IaaS based on OpenStack, we need more than six
- months. OpenStack is developed and released around 6-month cycles!
- OpenStack projects offer modularity, but make IaaS installation and
maintenance more complicated.
- With its 60 projects (services), OpenStack is more than an IaaS
Learned lessons
44
- OpenStack (architecture, projects, services)
- A use-case: hepiaCloud. Learned lessons
- OpenStack client
- OpenStack SDK
Plan
45
- Deploy the distributed Festival Search Engine
(FSE) on SwitchEngine and AWS
Exercise 1
OpenStack client
46
- OpenStackClient is a command-line client for OpenStack that brings the
command set for Compute, Identity, Image, Object Storage and Block Storage APIs together in a single shell with a uniform command structure.
OpenStack Client
47
- To install OpenStack Client: sudo pip install openstacksdk
- Syntax: openstack command-name option…
- penstack help
- penstack command-name - help
- Documentation is available on:
- https://docs.openstack.org/python-openstackclient/latest/index.html
Examples: Manage instances …
48
- penstack server list : shows the ID, name, status, private and public
IP addresses for all instances in the project to which you belong
- penstack server create
- -flavor m1.medium --image <IMAGE_ID>
- -key-name <KEYNAME>
- -user-data <USER_DATA_FILE>
- -security-group <SECGROUP_NAME>
- -nic net-id= NETWORK_ID
- -meta KEY= <VALUE>
- -availability-zone nova:<ZONE-NAME>
INSTANCE_NAME
Examples: Manage floating IP addresses
49
- penstack floating ip list : list of floating IP addresses
- penstack floating ip create ext-net: create a floating IP address
- ext-net: Network to allocate floating IP from
- penstack server add floating ip Instance-Name Floating-IP : assign a
floating IP to an instance
- penstack server remove floating ip Instance-Name Floating-IP:
remove (disassociate) a floating IP from an instance.
- penstack floating ip delete Floating-IP
50
- OpenStack (architecture, projects, services)
- A use-case: hepiaCloud. Learned lessons
- OpenStack client
- OpenStack SDK
Plan
51
- To install: sudo pip install openstacksdk
- Exercise 3 : Use OpenStack SDK to deploy the Festival Search
Engine application on SwitchEngine
OpenStack SDK
52
conn = connection.Connection(**{ 'auth_url':auth_url, 'project_name':project_name, 'username':username, 'password':password, 'user_domain_name': 'default', 'project_domain_name': 'default', 'region_name': region
OpenStack SDK – Connect to OpenStack
53
server = conn.compute.create_server ( name=name, image_id=image.id, flavor_id=flavor.id, networks=[{"uuid": network.id}], key_name=keypair.name, user_data=b64encode(userdata))
OpenStack SDK: Create an instance
54
server = conn.compute.create_server ( name=name, image_id=image.id, flavor_id=flavor.id, networks=[{"uuid": network.id}], key_name=keypair.name, user_data=b64encode(userdata))
OpenStack SDK: Create an instance
55
- network_id = conn.network.find_network(public_network).id
- floating_ip = conn.network.create_ip (floating_network_id=network_id)
- floating_ip = conn.network.get_ip (floating_ip)
- conn.network.add_ip_to_port(instance_port, floating_ip)
OpenStack SDK: Floating IP management
56
- conn.compute.delete_server(instance)