How openstack/ironic works
Main Components
• API Server – The “ironic/api” layer that exposes REST endpoints, handles client requests, and performs input validation/reply formatting.
• Conductor Service – The “ironic/conductor” layer that receives tasks from the API and orchestrates long-running operations (e.g. cleaning, deployment, inspection) against bare metal nodes.
• Drivers / Plug-ins – A set of modules located under “ironic/drivers” (including vendor-specific subdirectories) which provide the actual hooks to interact with hardware management protocols (IPMI, PXE, DRAC, iLO, Redfish, etc.).
• Database Layer – The persistence layer (likely interfaced using SQLAlchemy, as seen in the “ironic/db/sqlalchemy” directories) that stores state and metadata for nodes, deployments, and configuration.
• Auxiliary Tools & Scripts – CLI commands, test scripts, and development utilities (e.g. “tools” and “devstack”) which are used for configuration, testing, or automated deployments.
• Integration Components – Components for interacting with external services such as Nova (for hypervisor integration), Neutron (for networking), Swift or Glance (for images), and Keystone for authentication/authorization.
Relationships and Interactions
• Client Interaction: End users or Nova make requests to the API server. These requests are parsed and passed internally toward the conductor.
• Orchestration: The conductor service schedules tasks and dispatches operations to the various hardware drivers. There are clear directional flows from the API to the conductor and then from the conductor to the drivers.
• Database Access: All components that require persistence (API, conductor, and sometimes drivers for logging or state recovery) interact with a central database.
Architectural Patterns & Design Principles
• Separation of Concerns: Different directories (API, conductor, drivers, and database) indicate a clean separation between request management, orchestration, hardware interaction, and state persistence.
• Plugin Architecture: Driver modules are implemented as plug-ins that can be extended for various hardware types and vendor-specific protocols.
• Resilience and Fault Tolerance: The design is meant to be security-aware and fault tolerant; include indications of error handling, logging (see “ironic/common/faults” and “ironic/common/utils”), and retry mechanisms (for IPMI, PXE, etc.).
• Modular & Extensible: With its multiple directories for different aspects, the architecture encourages modularity which simplifies testing (as seen in “ironic/tests”) and development.
Relevant Technologies & Frameworks
• Python (the entire project is implemented in Python).
• SQLAlchemy ORM for database models and migrations.
• WSGI components (e.g., “ironic/api/wsgi.py”) for serving the API.
• Middleware (as seen in “ironic/api/middleware”) for request parsing and error handling.
• Devstack integration for deployment testing, likely leveraging configuration templates and plugin hooks.
• Various vendor-specific libraries for hardware interaction (e.g., drac, ipmi, redfish).