Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Open Stack compute-service-nova
1. Overview of OpenStack Compute
Service (Nova)
22th May 2014
Ghanshyam Mann, OpenStack Developer
NEC Technologies India Ltd
2. Open Source Software Developers
OpenStack Developer in Nova, Tempest
Core in Tempest, Active contributor in Nova.
Experience in various domain like Avionics, Storage,
Cloud computing, Virtualization etc.
Working in NEC Technologies India as Software
Developer.
IRC- gmann
- @ghanshyammann
Ghanshyam Mann 7/12/2015 2
3. Software code name is Nova, and it provides the software that can
control an Infrastructure as a Service (IaaS) cloud computing
platform.
OpenStack Compute gives you service to build cloud, including
running/managing instances, managing networks, and controlling
access to the cloud through users and projects.
It is similar in scope to Amazon EC2 and Rackspace Cloud Servers.
OpenStack Compute does not include any virtualization software;
rather it defines drivers that interact with underlying virtualization
mechanisms that run on your host operating system, and exposes
functionality over a web-based API.
Nova is accessible via APIs for developers to build their cloud
applications and via web interfaces/CLI for administrators and users.
Nova originated as a project out of NASAAmes Research Laboratory.
Ghanshyam Mann 7/12/2015 3
4. Sr.
No.
Process Name Description
1. nova-api
It supports OpenStack Compute API, Amazon's EC2 API and powerful Admin API.
It gets communicated over HTTP, converts the requests to commands further
contacting other components via message queue. It's a WSGI application which
routes and authenticates requests.
2. nova-compute
A worker daemon which takes orders from its message queue and perform virtual
machine create/delete tasks using Hypervisor's API. It also updates status of its tasks
in Database.
3. nova-scheduler
This daemon decides which Nova Compute Host to allot for virtual machine
request.
4. nova-network
A worker daemon which takes network related tasks from its message queue and
performing those. OpenStack's neutron component can be opted instead of nova-
network.
5. nova-conductor
server daemon that serves the Nova Conductor service, which provides coordination
and database query support for Nova.
6. nova-console is a console Proxy to set up multi-tenant VM console access (i.e. with xvp)
7. nova-cert
server daemon that serves the Nova Cert service for X509 certificates. Used to
generate certificates for euca-bundle-image. Only needed for EC2 API
8. nova-consoleauth Provides Authentication for nova consoles
Ghanshyam Mann 7/12/2015 4
5. Sr.
No.
Process Name Description
9. nova-novncproxy Websocket proxy that is compatible with OpenStack Nova noVNC consoles.
10. nova-serialproxy Websocket proxy that is compatible with OpenStack Nova serial ports.
11. nova-spicehtml5proxy Websocket proxy that is compatible with OpenStack Nova SPICE HTML5 consoles.
12. nova-rootwrap Filters which commands nova is allowed to run as another user.
13. nova-objectstore
Implementation of an S3-like storage server based on local files. Used for testing
when do not have OpenStack Swift installed.
14. nova-xvpvncproxy XVP VNC Console Proxy Server
15.
Message queue
All components of Nova communicate with each other in a non-blocking callback-
oriented manner using AMQP protocol well supported by RabbitMQ, Apache QPid.
There is also emerging support for ZeroMQ integration as Message Queue. It's like
central task list shared and updated by all Nova components.
Ghanshyam Mann 7/12/2015 5
6. process
4
LINUX (Ubuntu)
Hypervisor (KVM)
Based on native or
hosted hypervisor
type
VM VM VM
glance-api
glance-registry
Image Store
Glance DB
Proxy-server
account-
server
object-
server
container-
server
cinder-api
cinder-volume
cinder-
scheduler
Cinder DB
QUEUE
neutron-server
neutron-dhcp-
agent
neutron-l3-
agent
neutron-*-
plugin
agent
Keystone
2
3
1
User Authentication
&.
Get Token
Request
Authorization
QUEUE
16
nova-compute
nova-
objectstore
nova-networkNova DB
5
nova-compute
process pick
request sent
by scheduler
and start
processing
Update DB by own or
through nova-conductor
(based on configuration)
8
nova-
conductor
Call to hypervisor
driver
nova-
scheduler
Dashboard/CLI/SDK
nova-api
Response
Request
4
7
18
9
11
8
6
10
12
13
14
nova-sch
process pick
request from
queue and
schedule it to
nova-compute
process
nova-
rootwrap
1920
17
glance
swift
neutron
cinder
nova
Neutron DB
process to message
queue communication
process communication
to other process/DB etc
User
Ghanshyam Mann 7/12/2015 6
7. API Use
Case/Description
Return Code Outcome Process
Model
POST
/v2/{tenant_id}/servers
To boot VM
Success code – 202
Error Code – 400, 403, 409,
413
VM is created and in Active state. Nova Create
VM Slide#8
POST
/v2/{tenant_id}/servers/{server_id}/os-
volume_attachments
To attach volume to
specified VM to
increase block storage
of VM.
Success code – 202
Error Code –400, 404, 409
Requested volume is attached to VM. VM
state is Active, Volume state is In-use.
Nova Attach
Volume
Slide#9
DELETE
/v2/{tenant_id}/servers/{server_id}/os-
volume_attachments{attachment_id}
To detach volume from
specified VM.
Success code – 202
Error Code –400, 403, 404,
409
Requested volume is detached from VM. VM
state is Active, Volume state is Available.
Nova Detach
Volume –
Slide#10
PUT
/v2/{tenant_id}/servers/{server_id}
Update the editable
attributes of the
specified VM.
Success code – 200
Error Code – 400, 404
Requested attributes is updated. Can be created
later
POST
/v2/{tenant_id}/servers/{server_id}/ac
tion {reboot}
To reboot VM
Success code – 202
Error Code – 404, 409
VM is rebooted and in Active state. Can be created
later
POST
/v2/{tenant_id}/servers/{server_id}/acti
on {resize}
To resize VM with
higher flavor (ram, cpu
etc)
Success code – 202
Error Code – 400, 401, 403,
404, 409
VM is proceeded to resize to requested flavor
but waiting for another action to
confirm/revert the resize. VM state is
VERIFY_RESIZED
Can be created
later
POST
/v2/{tenant_id}/servers/{server_id}/acti
on {confirmResize}
Confirms a pending
resize action
Success code – 204
Error Code – 400, 404, 409
VM size is confirmed and VM state is Active Can be created
later
POST
/v2/{tenant_id}/servers/{server_id}/acti
on {revertResize}
Revert a pending resize
action
Success code – 202
Error Code – 400, 404, 409
VM size is reverted back and VM state is
Active
Can be created
later
▐ Some Nova APIs with their use case, return code & outcome.
Ghanshyam Mann 7/12/2015 7
8. API Use Case/Description Return Code Outcome Process
Model
POST
/v2/{tenant_id}/servers/{server_id}/acti
on {pause}
To pause VM for migrating purpose etc
Success code – 202
Error Code –404,
409, 501
VM is paused and in Paused state. Can be
created later
POST
/v2/{tenant_id}/servers/{server_id}/acti
on{unpause}
To un-pause a paused VM.
Success code – 202
Error Code –404,
409, 501
VM is un-paused and in Active state. Can be
created later
POST
/v2/{tenant_id}/servers/{server_id}/acti
on {os-migrateLive}
To Live-migrates a server to a new host
without rebooting.
Success code – 202
Error Code – 400,
404, 409
VM is migrated to new Host without
any downtime. VM state is Active.
Can be
created later
POST
/v2/{tenant_id}/servers/{server_id}/acti
on {addSecurityGroup}
To add new security group to VM for its
access permission.
Success code – 202
Error Code – 400,
404, 409
Security group is added to VM. Now
VM can be accessed according to
added security group.
Can be
created later
PUT
/v2/{tenant_id}/os-quota-
sets/{tenant_id}
To updates reqources quotas limit for a
tenant. For example- Max number of
Instance per tenant needs to be updated
from 10 to 20.
Success code – 200
Error Code – 400,
403
Quota for requested tenant is
updated. Now tenant can
request/create resources as per new
quota.
Can be
created later
POST
/v2/{tenant_id}/servers/{server_id}/acti
on
{createBackup}
To create VM backup. When VM is very
critical and needs to be snapshot
daily/weekly etc.
Success code – 202
Error Code – 400,
403, 404, 409
VM is backed up. VM remain in
Active state. Created snapshot can be
used to boot new VM.
Can be
created later
POST
/v2/{tenant_id}/flavors
When new private flavor needs to be
created which can be used fruther to boot
same type of VM.
Success code – 200
Error Code –400,
409, 500
Private Flavor is created. VM can be
boot with created flavor. Access type
of created flavor can be updated to
Public.
Can be
created later
Ghanshyam Mann 7/12/2015 8
9. Process Model of Nova Create server request
Ghanshyam Mann 7/12/2015 9
10. Process Model of Nova Attach Volume Request
Ghanshyam Mann 7/12/2015 10
11. Process Model of Nova Detach Volume Request
Ghanshyam Mann 7/12/2015 11
12. VM & Task State transition during create VM
Active
Building
Sched-
uling
VM
State
Task
State
Building None
Compute.api.create_db_entry_for_new_instance
Compute.manager._start_building
Create VM
Building
Net-
working
Compute.manager._allocate_network
Building
Block_
Device_
mapping
Compute.manager._prep_block_device
Building spawningCompute.manager._spawn
None
Ghanshyam Mann 7/12/2015 12
13. All possible VM State transition
Action
VM State
Create
RESIZED
SUSPENDED
SOFT_DELETED
ERROR
STOPPED
ACTIVE
BUILDING
RESCUED
DELETED
Revert_ResizeConfrm_resize
Resize
Suspend
Soft_delete
Set_admin_pass
Live_migrate
Pause
Un-pause
Restore
Resume
Rescue
Rebuild
Stop
Un-rescue Delete
Start
Reboot
PAUSED
From
STOPPED,
PAUSED,
SOFT_DELETE
D State
Each Line of same
color shows per
State transition
Ghanshyam Mann 7/12/2015 13