ch2 Openstack Compute
ch2 Openstack Compute
Foreword
2 Huawei Confidential
Objectives
3 Huawei Confidential
Contents
1. Nova Overview
2. Nova Architecture
4 Huawei Confidential
Compute Service: Nova
5 Huawei Confidential
• Nova provides compute, storage, and network services in the initial OpenStack
releases.
Nova
• Nova is a core module of
OpenStack and provisions
compute resources.
• Nova does not include
virtualization software.
Instead, it defines drivers
that interact with
underlying virtualization
mechanisms that run on
your host operating system,
and exposes functionality
over a web-based API.
6 Huawei Confidential
• As shown in the figure, Nova belongs to the compute service layer. Users can use
Horizon, Nova clients, APIs, or CLIs to create and manage compute instances.
Mission and Functions of Nova
Mission: Implement services and associated libraries to provide massively scalable, on demand, self-
service access to compute resources.
7 Huawei Confidential
▫ It provides the most complex functions and has the largest code size among
OpenStack projects.
8 Huawei Confidential
Contents
1. Nova Overview
2. Nova Architecture
9 Huawei Confidential
Nova System Architecture
10 Huawei Confidential
• The API servers process REST requests, which typically involve database
reads/writes, optionally sending RPC messages to other Nova services, and
generating responses to the REST calls.
11 Huawei Confidential
Nova Service Architecture
Nova-API
API Layer
Nova-API Nova-API-Cell Nova-API-EC2
vCenter
12 Huawei Confidential
Region VM m VM m
VM 1 VM n VM x VM 1 VM n VM x
13 Huawei Confidential
Request
WSGI WSGI
Client WSGI Server
Middleware Application
Response
WSGI WSGI
Middleware Application
14 Huawei Confidential
Database operations
AMQP Queue
Database Service
⚫ Nova-Conductor:
Provides database operations and decouples Nova-Compute and the database.
Provides complex process control, such as creation, cold migration, live migration, VM flavor
adjustment, and VM rebuilding.
Provides dependencies of other components. For example, Nova-Compute can be started only after
Nova-Conductor is successfully started.
Periodically writes the heartbeats of other components.
15 Huawei Confidential
Host 1 Host 1
Filters physical machines and
The memory is
weighed by default. then selects where the VM
Host 2 Host 2 Host 5
instance will be deployed.
Filtering Weighting Assigning a VM instance
Host 3 Host 3 Host 3
Host 6 Host 6
◼ Select the best node based on
Hosts chosen after
filtering and sorted after the weight.
weighting (here the best
variant is Host 5)
16 Huawei Confidential
17 Huawei Confidential
• Built-in periodic tasks are used to update resources and synchronize the VM
status.
1. Nova Overview
2. Nova Architecture
18 Huawei Confidential
VM States
20 Huawei Confidential
VM State Transitions
VM state transitions allowed by OpenStack
21 Huawei Confidential
• For details about the VM states and task states for various commands issued by
users, see [Link]
[Link]?highlight=vm.
Nova VM Creation Process
1
Horizon/CLI 2
Keystone
keystone db
3 4 21
5
Glance
Nova nova-api
glance-api glance-registry
6 20
10
Image store db
7 8 11
9 22
nova-
db MQ scheduler
15 Neutron neutron-server
12 24
17 16 18
13 14/19 MQ
23 neutron-plugins neutron-agent
nova-conductor
25 db
nova-compute
Cinder cinder-api
29 27
26 28
Hypervisor cinder-volume MQ cinder-scheduler
volume-backend db
22 Huawei Confidential
• Step 1: The Horizon Dashboard or OpenStack CLI gets user credentials and
authenticates with Keystone via the RESTful API.
• Step 2: Keystone authenticates the user with the user credentials and then
generates and sends back an auth-token.
• Step 3: The Horizon or CLI sends a boot instance request, which carries the auth-
token, to nova-api over the RESTful API.
• Step 4: nova-api gets the request and sends that request to Keystone for
validation of the auth-token and access permission.
• Step 5: Keystone validates the token and sends the updated authentication
headers with roles along with the permissions. (Note: Some operations require
role permissions.)
• Step 6: After getting the response from Keystone, nova-api interacts with nova-
database.
• Step 7: nova-api creates initial database entry for the new instance or VM.
• Step 8: nova-api sends the [Link] request to nova-scheduler expecting to get
updated instance entry with Host ID specified.
• Step 9: nova-scheduler picks the request from the queue.
• Step 10: nova-scheduler talks to nova-database to locate an appropriate host
using the filtering and weighting mechanism.
• Step 11: nova-scheduler returns the updated instance entry with the appropriate
host ID after filtering and weighting.
• Step 12: nova-scheduler sends the [Link] request to nova-compute for
launching an instance on the appropriate host.
• Step 14: nova-compute sends the [Link] request to nova-conductor to get the
VM or instance information.
• Step 19: nova-compute picks the instance information from the queue.
• Step 20: nova-compute sends an HTTP request using the auth-token obtained
from the Keystone RESTful API to glance-api to get the image required for
creating the VM.
• Step 22: After the token is verified, nova-compute gets the image URL.
• Step 23: nova-compute sends an HTTP request using the auth-token obtained
from the Keystone RESTful API to neutron-server to get the network required for
creating the VM.
• Step 24: neutron-server validates the auth-token with Keystone.
• Step 25: After the token is verified, nova-compute gets the network information.
• Step 26: nova-compute sends an HTTP request using the auth-token obtained
from the Keystone RESTful API to cinder-api to get the persistent storage
required for creating the VM.
• Step 28: After the token is verified, nova-compute gets the block storage
information.
• Step 29: nova-compute generates data for the hypervisor driver and executes the
request on the hypervisor.
Nova Scheduling Process
Submit RequestSpec to Submit resource requirements Query which RPs will represent compute
scheduler to placement nodes to satisfy requirements
25 Huawei Confidential
Nova Filter Scheduler
26 Huawei Confidential
Live Migration Principles
Conductor Source Destination
call
check can live migrate destination
call
check can live migrate source
cast
live migrate
call
pre live migration (set up dest)
driver.live_migration (success)
post live migration (clean up source)
call post live migration at destination
(finish dest)
driver.live_migration (failure)
rollback live migration remove volume connections
call
cast rollback live migration at destination
27 Huawei Confidential
• After the migration is successful, information about the source node will be
deleted.
• If the migration fails, a rollback is performed and the information about the
destination node is cleared.
Contents
1. Nova Overview
2. Nova Architecture
28 Huawei Confidential
Nova Typical Operations
Category Description
VM creation, deletion, startup, shutdown, restart, rebuilding, flavor change, pause, pause
VM lifecycle cancellation, suspension, resume, migration, online migration, locking, unlocking,
management evacuation, rescue, unrescue, shelving, shelving deletion, shelving restoration, backup, VM
image export, as well as list, details, and information query and password change.
Volume and snapshot These operations are essentially the encapsulations of Cinder APIs and include creating or
management deleting a volume or snapshot, listing volumes or snapshots, and querying their details.
Attaching or detaching a volume to or from a VM, and querying VM the volume list and
Operations on volumes
details.
Operations on These operations are essentially the encapsulations of Neutron APIs and include creating
networks or deleting a virtual network, and querying the virtual network list and details.
Operations on NICs Attaching or detaching a NIC to or from a VM, and querying the VM NIC list.
These operations are essentially the encapsulations of Glance APIs, and include creating or
Operations on images
deleting an image, as well as querying the image list and details.
Operations on other
Operations on flavors, host aggregates, key pairs, and quotas.
resources
29 Huawei Confidential
Major Operation Objects of Nova (1)
Name Description Remarks
30 Huawei Confidential
Major Operation Objects of Nova (2)
31 Huawei Confidential
Quiz
B. Nova-Compute
C. Nova-Conductor
D. Nova-Scheduler
32 Huawei Confidential
• 1. B
Summary
33 Huawei Confidential
More Information
⚫ OpenStack Community
[Link]
34 Huawei Confidential
Acronyms
⚫ API: Application Programming Interface (API) is a particular set of rules and specifications
that are used for communication between software programs.
⚫ CLI: Command-Line Interface (CLI) is a means of communication between a program and its
user, based solely on textual input and output. Commands are input with the help of a
keyboard or similar device and are interpreted and executed by applications. Results are
output as text or graphics to the interface.
⚫ EC2: Elastic Compute Cloud (EC2) is a web service system developed by Amazon, which
allows users to rent applications to run their own VMs.
⚫ HTTP: Hypertext Transfer Protocol (HTTP) is an application-layer protocol used for
communication between web servers and browsers or other programs.
35 Huawei Confidential
Acronyms
⚫ KVM: Kernel-based Virtual Machine (KVM) is an open-source virtualization technology built
in Linux. Specifically, KVM helps users turn Linux into a hypervisor that enables a host
computer to run multiple isolated virtual environments, that is virtual clients or VMs.
⚫ MQ: A distributed message queue (MQ) is used for message transmission for each service
and service management. The MQ service can transmit messages inside a zone or across
zones and must be scaled up horizontally to support large-capacity concurrent message
requests and provide software development kits (SDKs) for other services.
⚫ QEMU: The Quick Emulator (QEMU) is an emulation processor, written by Fabrice Bellard,
that distributes source code under a general public license (GPL).
⚫ Web: World Wide Web (Web) is a global, interactive, dynamic, cross-platform, distributed,
graphical information system based on the hypertext and HTTP.
36 Huawei Confidential
Acronyms
⚫ WSGI: Web Server Gateway Interface (WSGI) is an interface that specifies how web
servers should forward requests to Python applications or frameworks.
⚫ Xen: A Xen hypervisor is an open source VMM that adopts the paravirtualization
technology and implements CPU scheduling and memory allocation among VMs.
The Xen hypervisor virtualizes a hardware layer and controls VM operations, but
does not deal with the network, storage device, video, and other input/output (I/O).
37 Huawei Confidential
Thank you. 把数字世界带入每个人、每个家庭、
每个组织,构建万物互联的智能世界。
Bring digital to every person, home, and
organization for a fully connected,
intelligent world.