Deep Dive into OpenStack Nova

Understanding OpenStack's Compute Service Architecture and Components

Featured image

Image Reference link



Understanding OpenStack Nova

Nova is the primary compute service of OpenStack and serves as the core controller of the cloud computing fabric. It manages the lifecycle of compute instances (virtual machines, bare metal servers, and containers) across a distributed infrastructure, providing on-demand access to compute resources through a clean, feature-rich API.

What is Nova?

The Heart of OpenStack's Compute Infrastructure

Nova provides the backbone for the most essential cloud computing capability: creating and managing instances of virtual servers. As a core component of OpenStack, Nova:

  • Manages Resources: Orchestrates compute, network, and storage resources for virtual machines
  • Provides Flexibility: Supports multiple hypervisors, allowing technology choice
  • Enables Scaling: Designed for horizontal scaling across data centers
  • Offers API Control: Exposes a RESTful API for automation and integration

Nova translates user requirements into infrastructure resources, bridging the gap between raw hardware and consumable cloud computing capabilities.

graph LR A[OpenStack Nova] A --> B[Instance Management] A --> C[Hypervisor Support] A --> D[Resource Scheduling] A --> E[API Services] B --> B1[Virtual Machines] B --> B2[Bare Metal Servers] B --> B3[Containers] C --> C1[KVM] C --> C2[VMware] C --> C3[Hyper-V] C --> C4[Xen] D --> D1[Filtering] D --> D2[Weighting] D --> D3[Resource Allocation] E --> E1[REST API] E --> E2[CLI Interface] E --> E3[Web Dashboard] %% 스타일 정의 style A stroke:#333,stroke-width:1px,fill:#f5f5f5 style B stroke:#333,stroke-width:1px,fill:#a5d6a7 style C stroke:#333,stroke-width:1px,fill:#64b5f6 style D stroke:#333,stroke-width:1px,fill:#ffcc80 style E stroke:#333,stroke-width:1px,fill:#ce93d8



Nova Architecture and Components

Nova's distributed architecture comprises several specialized components that work together to provide scalable, reliable compute services. Each component has a specific role in the provisioning and management of compute resources.

Core Services and Daemons

Service Role Description
nova-api API Endpoint
  • Receives and processes HTTP requests
  • Validates authentication tokens with Keystone
  • Transforms API requests into internal commands
  • Supports multiple API versions
nova-scheduler Resource Allocation
  • Determines optimal host for new instances
  • Implements filtering and weighting algorithms
  • Considers resource availability and constraints
  • Supports custom scheduling algorithms
nova-compute Hypervisor Management
  • Communicates with hypervisors via drivers
  • Creates and terminates VM instances
  • Manages instance state and lifecycle
  • Attaches volumes and configures networking
nova-conductor Database Proxy
  • Mediates interactions between compute nodes and database
  • Improves security by isolating DB access
  • Handles object conversions and calculations
  • Offloads tasks from compute nodes
nova-novncproxy Console Access
  • Provides browser-based access to VM consoles
  • Acts as a secure proxy for VNC connections
  • Enables remote troubleshooting of instances
  • Works with nova-console-auth for security

Nova Architectural Flow

graph LR A[User/Client] --> B[nova-api] B --> C[Message Queue] C --> D[nova-scheduler] D --> C C --> E[nova-conductor] E --> F[Database] E --> C C --> G[nova-compute] G --> H[Hypervisor] G --> C I[nova-novncproxy] --> G A --> I style A stroke:#333,stroke-width:1px,fill:#f5f5f5 style B stroke:#333,stroke-width:1px,fill:#a5d6a7 style C stroke:#333,stroke-width:1px,fill:#64b5f6 style D stroke:#333,stroke-width:1px,fill:#ffcc80 style E stroke:#333,stroke-width:1px,fill:#ce93d8 style F stroke:#333,stroke-width:1px,fill:#ef9a9a style G stroke:#333,stroke-width:1px,fill:#81c784 style H stroke:#333,stroke-width:1px,fill:#9fa8da style I stroke:#333,stroke-width:1px,fill:#80deea

Service Communication

Component Interaction Model

Nova components communicate through several key mechanisms:

  • Message Queue (RabbitMQ/Oslo): Asynchronous communication between components
  • RESTful API: External interface for user and service requests
  • Database: Persistent state storage shared between components
  • Driver Interfaces: Standardized communication with hypervisors and hardware

This distributed architecture ensures scalability and fault tolerance, allowing Nova to manage thousands of compute nodes across multiple data centers.



Compute Instance Management

Nova manages various types of compute instances, each with distinct characteristics and use cases. Understanding these differences is crucial for selecting the appropriate compute model for specific workloads.

Instance Types

Type Characteristics Best For
Virtual Machines
  • Complete virtualized environment with dedicated OS
  • Hardware-assisted virtualization for performance
  • Strong isolation between instances
  • Resource allocation at VM level
  • General-purpose workloads
  • Applications requiring OS-level customization
  • Legacy applications
  • Multi-tenant environments needing strong isolation
Bare Metal Servers
  • Direct access to physical hardware
  • No virtualization overhead
  • Provisioned via Ironic integration
  • 100% of hardware resources available
  • High-performance computing (HPC)
  • Database servers with I/O intensive workloads
  • Applications sensitive to virtualization latency
  • GPU/FPGA workloads (AI/ML)
Containers
  • Lightweight virtualization sharing OS kernel
  • Fast startup and lower resource overhead
  • Limited support via Zun integration
  • Simplified application packaging
  • Microservices architectures
  • DevOps CI/CD pipelines
  • Stateless application components
  • Environments requiring rapid scaling

Hypervisor Support

Multi-Hypervisor Architecture

Nova supports multiple hypervisors through its driver architecture:

  • KVM: The most widely deployed and mature hypervisor in OpenStack
  • VMware vSphere: Enterprise-grade commercial hypervisor
  • Hyper-V: Microsoft's hypervisor for Windows environments
  • Xen: Open-source hypervisor with strong isolation properties
  • QEMU: Software virtualization for development and testing

This flexibility allows organizations to leverage existing investments in virtualization technology while providing a consistent management interface.



Resource Scheduling and Allocation

Nova's scheduler is responsible for determining where new instances should be created. It implements sophisticated algorithms to match instance requirements with available resources across the compute infrastructure.

Scheduling Process

sequenceDiagram participant User participant API as nova-api participant Scheduler as nova-scheduler participant Conductor as nova-conductor participant Compute as nova-compute User->>API: Create instance request API->>Scheduler: Find suitable host Scheduler->>Conductor: Get compute node information Conductor->>Scheduler: Return resource data Note over Scheduler: Apply filter algorithms Note over Scheduler: Apply weighing algorithms Scheduler->>API: Return selected host API->>Compute: Schedule instance on host Compute->>User: Instance created

Scheduling Filters

Filter Type Description
ComputeFilter Ensures host is enabled and capable of servicing requests
AvailabilityZoneFilter Filters hosts by requested availability zone
RamFilter Checks if host has sufficient RAM for requested instance
DiskFilter Ensures host has enough disk space for instance
CoreFilter Verifies host has enough CPU cores for instance
ImagePropertiesFilter Matches image properties (architecture, hypervisor type) with host capabilities
ServerGroupAntiAffinityFilter Places instances on different hosts for redundancy
ServerGroupAffinityFilter Places instances on the same host for performance
Scheduling Optimization Tips

To improve the efficiency of Nova's scheduling decisions:

  • Define appropriate instance flavors to standardize resource allocation
  • Use host aggregates to group similar compute nodes
  • Configure weighing to prefer hosts with more available resources
  • Implement custom filters for specialized requirements
  • Monitor scheduler decisions to identify bottlenecks

Proper scheduling configuration is critical for optimizing resource utilization and maintaining performance as the cloud environment grows.



Integration with Other OpenStack Services

Nova integrates with numerous other OpenStack services to provide a complete compute solution. These integrations enable features such as image management, networking, block storage, and identity management.

Service Integrations

Service Integration Purpose Functionality
Keystone Identity Management
  • Authentication and authorization for API requests
  • Role-based access control for Nova operations
  • Service catalog for endpoint discovery
  • Token validation for secure operations
Glance Image Management
  • Provides VM images for instance creation
  • Stores and retrieves instance snapshots
  • Manages image metadata for compatibility
  • Supports various image formats (QCOW2, RAW, VMDK)
Neutron Networking
  • Configures instance network connectivity
  • Manages virtual interfaces and security groups
  • Provides floating IPs for public access
  • Sets up private networks for tenant isolation
Cinder Block Storage
  • Attaches persistent volumes to instances
  • Manages volume connections and device mapping
  • Enables data persistence across instance lifecycles
  • Provides storage migration capabilities
Placement Resource Inventory
  • Tracks inventory of resources across compute nodes
  • Provides resource usage information to scheduler
  • Manages allocation of resources to instances
  • Supports resource constraints and custom attributes

Service Communication Flow

graph LR A[Nova] --> B[Keystone] A --> C[Glance] A --> D[Neutron] A --> E[Cinder] A --> F[Placement] B --> B1[Authentication] B --> B2[Authorization] C --> C1[Image Retrieval] C --> C2[Snapshot Storage] D --> D1[Network Setup] D --> D2[Security Groups] E --> E1[Volume Attachment] E --> E2[Block Storage] F --> F1[Resource Tracking] F --> F2[Allocation Management] style A stroke:#333,stroke-width:1px,fill:#f5f5f5 style B stroke:#333,stroke-width:1px,fill:#a5d6a7 style C stroke:#333,stroke-width:1px,fill:#64b5f6 style D stroke:#333,stroke-width:1px,fill:#ffcc80 style E stroke:#333,stroke-width:1px,fill:#ce93d8 style F stroke:#333,stroke-width:1px,fill:#ef9a9a



Working with Nova’s API

Nova provides a comprehensive RESTful API that allows programmatic control over all aspects of compute resource management. The API follows versioning conventions to ensure compatibility across releases.

API Versioning

API Evolution Strategy

Nova uses microversioning to manage API changes:

  • Format: X.Y where X is the major version and Y is the microversion
  • Backward Compatibility: Guaranteed within major versions
  • Version Discovery: Clients can query for supported versions
  • Version Negotiation: Clients specify desired version in request headers

This approach allows for API evolution while maintaining compatibility with existing clients and scripts.

Common API Operations

# List instances (servers)
openstack server list

# Get detailed information about an instance
openstack server show <server_id>

# Create a new instance
openstack server create --flavor m1.small --image ubuntu-20.04 \
  --network private-net my-new-server

# Stop an instance
openstack server stop <server_id>

# Start an instance
openstack server start <server_id>

# Resize an instance
openstack server resize --flavor m1.large <server_id>

# Create a snapshot of an instance
openstack server image create --name my-snapshot <server_id>

# Delete an instance
openstack server delete <server_id>



Advanced Features and Capabilities

Beyond basic instance management, Nova provides numerous advanced features that enable sophisticated cloud operations, high availability, and performance optimization.

Instance Features

Feature Description
Live Migration Move running instances between compute hosts with minimal downtime, useful for maintenance and load balancing
Resize Change the flavor (resource allocation) of an existing instance to scale up or down
Snapshots Create point-in-time copies of instances that can be used to create new instances
Shelving Temporarily offload instances to free up resources while preserving instance data
Rescue Mode Boot an instance from a special rescue image to recover from boot failures
Server Groups Define affinity or anti-affinity policies to control instance placement
Host Aggregates Group hosts with similar characteristics for specialized workloads
Quotas Set resource usage limits per tenant to prevent resource exhaustion

Block Device Mapping

Storage Configuration Options

Nova's Block Device Mapping (BDM) provides flexible options for configuring storage for instances:

  • Root Disk: Boot device containing the operating system (typically vda)
  • Ephemeral Disks: Temporary storage that exists only during instance lifetime
  • Persistent Volumes: Cinder volumes that persist beyond instance lifecycle
  • Config Drive: Special device for passing instance metadata and configuration

BDM allows precise control over how storage is configured, including boot options, device naming, and size specifications.

# Example Block Device Mapping (in YAML format)
block_device_mapping_v2:
  - device_name: vda
    source_type: image
    destination_type: volume
    uuid: 6d39447b-2bd9-4f68-8f4d-59aa304a5444  # Image UUID
    volume_size: 20
    boot_index: 0
    delete_on_termination: true
  
  - device_name: vdb
    source_type: blank
    destination_type: volume
    volume_size: 100
    boot_index: -1
    delete_on_termination: false



Key Points

💡 Nova Essentials
  • Core Functionality
    - Manages the lifecycle of compute instances
    - Supports multiple hypervisors for technology flexibility
    - Provides robust API for automation and integration
    - Scales horizontally for large deployments
  • Architecture
    - Distributed, service-oriented design
    - Specialized components with distinct responsibilities
    - Message-based communication for scalability
    - Integration with multiple OpenStack services
  • Advanced Capabilities
    - Sophisticated scheduling for optimal resource utilization
    - Live migration for maintenance without downtime
    - Multi-tenant isolation for security
    - Flexible storage configuration options
    - Support for bare metal and container workloads



References