Open Stack compute-service-nova

14
Overview of OpenStack Compute Service (Nova) 22 th May 2014 Ghanshyam Mann, OpenStack Developer NEC Technologies India Ltd

Transcript of Open Stack compute-service-nova

Page 1: Open Stack compute-service-nova

Overview of OpenStack Compute Service (Nova)

22th May 2014

Ghanshyam Mann, OpenStack Developer

NEC Technologies India Ltd

Page 2: Open Stack compute-service-nova

Ghanshyam Mann 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

About me

7/12/2015

Page 3: Open Stack compute-service-nova

Ghanshyam Mann 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 NASA Ames Research Laboratory.

OpenStack Compute Service (Nova)

7/12/2015

Page 4: Open Stack compute-service-nova

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-computeA 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-networkA 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

Nova Processes

Ghanshyam Mann 7/12/2015

Page 5: Open Stack compute-service-nova

Ghanshyam Mann 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.

Nova Processes…

7/12/2015

Page 6: Open Stack compute-service-nova

Ghanshyam Mann 6

OpenStack (Nova) Process Modelprocess

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-*-pluginagent

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

Resp

on

se

Req

uest 4

7

18

9

11

8

6

101

2

13

14

nova-sch process pick request from queue and schedule it to nova-compute process

nova-rootwrap

19

20

17

glance

swift neutron

cinder

nova

Neutron DB

process to message queue communication

process communication to other process/DB etc

User

7/12/2015

Page 7: Open Stack compute-service-nova

Ghanshyam Mann 7

API Use Case/Description

Return Code Outcome Process Model

POST/v2/ {tenant_id} /servers

To boot VMSuccess code – 202Error 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 – 202Error 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 – 202Error 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 – 200Error Code – 400, 404

Requested attributes is updated. Can be created later

POST/v2/ {tenant_id} /servers/ {server_id} /action {reboot}

To reboot VM Success code – 202Error Code – 404, 409

VM is rebooted and in Active state. Can be created later

POST/v2/ {tenant_id} /servers/ {server_id} /action {resize}

To resize VM with higher flavor (ram, cpu etc)

Success code – 202Error 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} /action {confirmResize}

Confirms a pending resize action

Success code – 204Error Code – 400, 404, 409

VM size is confirmed and VM state is Active Can be created later

POST/v2/ {tenant_id} /servers/ {server_id} /action {revertResize}

Revert a pending resize action

Success code – 202Error Code – 400, 404, 409

VM size is reverted back and VM state is Active

Can be created later

Nova APIs▐ Some Nova APIs with their use case, return code &

outcome.

7/12/2015

Page 8: Open Stack compute-service-nova

Ghanshyam Mann 8

API Use Case/Description Return Code Outcome Process Model

POST/v2/ {tenant_id} /servers/ {server_id} /action {pause}

To pause VM for migrating purpose etcSuccess code – 202Error Code –404, 409, 501

VM is paused and in Paused state. Can be created later

POST/v2/ {tenant_id} /servers/ {server_id} /action{unpause}

To un-pause a paused VM.Success code – 202Error Code –404, 409, 501

VM is un-paused and in Active state. Can be created later

POST/v2/ {tenant_id} /servers/ {server_id} /action {os-migrateLive}

To Live-migrates a server to a new host without rebooting.

Success code – 202Error 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} /action {addSecurityGroup}

To add new security group to VM for its access permission.

Success code – 202Error 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 – 200Error 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} /action{createBackup}

To create VM backup. When VM is very critical and needs to be snapshot daily/weekly etc.

Success code – 202Error 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 – 200Error 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

Nova APIs…

7/12/2015

Page 9: Open Stack compute-service-nova

Ghanshyam Mann 9

Process Model of Nova Create server request

Nova Process Model

7/12/2015

Page 10: Open Stack compute-service-nova

Ghanshyam Mann 10

Process Model of Nova Attach Volume Request

Nova Process Model…

7/12/2015

Page 11: Open Stack compute-service-nova

Ghanshyam Mann 11

Process Model of Nova Detach Volume RequestNova Process Model…

7/12/2015

Page 12: Open Stack compute-service-nova

Ghanshyam Mann 12

VM & Task State transition during create VMNova VM & Task states

Active

BuildingSched-uling

VMState

TaskState

Building None

Compute.api.create_db_entry_for_new_instance

Compute.manager._start_building

Create VM

BuildingNet-

workingCompute.manager._allocate_network

BuildingBlock_Device_mapping

Compute.manager._prep_block_device

Building spawningCompute.manager._spawn

None

7/12/2015

Page 13: Open Stack compute-service-nova

Ghanshyam Mann 13

All possible VM State transitionNova VM & Task states…

Action

VM State

Create

RESIZED

SUSPENDED

SOFT_DELETED

ERROR

STOPPED

ACTIVE

BUILDING

RESCUED

DELETED

Revert_ResizeConfrm_resize

Resize

Suspend

Soft_delete

Set_admin_passLive_migrate

Pause

Un-pause

Restore

ResumeRescue

Rebuild

Stop

Un-rescue Delete

Start

Reboot

PAUSED

From STOPPED, PAUSED, SOFT_DELETED State

Each Line of same color shows per State transition

7/12/2015

Page 14: Open Stack compute-service-nova

Ghanshyam Mann 14

Thanks

7/12/2015