Understanding the Relationships Between OpenStack Components: A Nova‑Client Perspective
This article explains the architecture and inter‑service communication of OpenStack, detailing each core component, the REST and RPC interactions, and demonstrates practical request flows for creating and shelving instances using nova‑client with debug output and relevant code excerpts.
OpenStack is an open‑source cloud‑management suite that provides compute, storage, networking, and identity services, enabling the rapid deployment of public or private clouds. The platform consists of many interrelated projects, each offering a specific service.
OpenStack Compute (Nova) – compute service
OpenStack Networking (Neutron) – networking service
OpenStack Object Storage (Swift) – object storage service
OpenStack Block Storage (Cinder) – block storage service
OpenStack Identity (Keystone) – authentication service
OpenStack Image Service (Glance) – image management service
OpenStack Dashboard (Horizon) – web UI service
OpenStack Telemetry (Ceilometer) – metering and alarming service
OpenStack Orchestration (Heat) – workflow service
OpenStack Database (Trove) – database service
All services expose a uniform REST‑style API, allowing loose coupling between components. Client‑side API calls are shown as solid lines, while internal RPC communication between services appears as dashed lines. This architecture lets developers focus on their own service, but also requires operators to understand the full interaction map.
Starting with nova‑client
nova‑client is a command‑line tool that sends API requests to nova‑api, which can forward calls to other services such as Cinder or Neutron. Adding the --debug flag prints detailed request/response traces, revealing the full set of service interactions required for a business operation.
Example: booting a new instance
[tagett@stack-01 devstack]$ nova --debug boot t3 --flavor m1.nano --image 44c37b90-0ec3-460a-bdf2-bd8bb98c9fdf --nic net-id=b745b2c6-db16-40ab-8ad7-af6da0e5e699
…
REQ: curl -i 'http://cloudcontroller:5000/v2.0/tokens'
REQ: curl -i 'http://cloudcontroller:8774/v2/d7beb7f28e0b4f41901215000339361d/images/44c37b90-0ec3-460a-bdf2-bd8bb98c9fdf'
REQ: curl -i 'http://cloudcontroller:8774/v2/d7beb7f28e0b4f41901215000339361d/flavors/m1.nano'
REQ: curl -i 'http://cloudcontroller:8774/v2/d7beb7f28e0b4f41901215000339361d/servers' -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: python-novaclient" -H "X-Auth-Project-Id: admin" -H "X-Auth-Token: {SHA1}15d9e554b7456f1043732bb8df72d1521c5f6aa1" -d '{"server": {"name": "t3", "imageRef": "44c37b90-0ec3-460a-bdf2-bd8bb98c9fdf", "flavorRef": "42", "max_count": 1, "min_count": 1, "networks": [{"uuid": "b745b2c6-db16-40ab-8ad7-af6da0e5e699"}]}}'The debug output shows four essential API calls:
Request a token from Keystone for the tenant.
Validate the image via nova‑api.
Validate the flavor via nova‑api.
Send the server‑creation request (the only call that must be reproduced when using raw REST).
Inside nova‑api, the request flows through several internal components:
def create(self, req, body):
"""Creates a new server for a given user."""
...
(instances, resv_id) = self.compute_api.create(context, ...)After parameter validation, the compute API’s create method (in nova/compute/api.py ) is invoked:
@hooks.add_hook("create_instance")
def create(self, context, instance_type, ...):
return self._create_instance(...)The instance object is built, and _create_instance calls the compute‑task API’s build_instances method:
self.compute_task_api.build_instances(context, ...)The compute‑task API runs in the nova-conductor service (RPC API defined in nova/conductor/manager.py ) which selects a host via the scheduler and finally invokes nova-compute to launch the VM:
def build_instances(self, context, instances, image, filter_properties, ...):
hosts = self.scheduler_rpcapi.select_destinations(context, ...)
self.compute_rpcapi.build_and_run_instance(context, ...)The final build step calls the hypervisor configured in the compute node, completing the instance creation.
Service responsibilities
nova-api – receives and validates HTTP requests.
nova-conductor – mediates database access securely.
nova-scheduler – decides on which host the instance will run.
nova-compute – interacts with the hypervisor to create and run the VM.
Example: shelving an instance
[tagett@stack-01 devstack]$ nova --debug shelve t2
REQ: curl -i 'http://cloudcontroller:5000/v2.0/tokens' …
REQ: curl -i 'http://cloudcontroller:8774/v2/d7beb7f28e0b4f41901215000339361d/servers' …
REQ: curl -i 'http://cloudcontroller:8774/v2/d7beb7f28e0b4f41901215000339361d/servers/r' …
…
REQ: curl -i 'http://cloudcontroller:8774/v2/d7beb7f28e0b4f41901215000339361d/servers/00be783d-bef5-46b1-bfdc-316618c76e92/action' -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: python-novaclient" -H "X-Auth-Project-Id: admin" -H "X-Auth-Token: {SHA1}0634ea0ef1c3994e1f496c5d8890d32610cf11e9" -d '{"shelve": null}' …The shelving flow also involves four API calls: token acquisition, instance list retrieval, instance detail query, and the shelve action request, which returns HTTP 202 to indicate asynchronous processing.
The shelve action is implemented in nova/api/openstack/compute/contrib/shelve.py :
@wsgi.action('shelve')
def _shelve(self, req, id, body):
context = req.environ["nova.context"]
auth_shelve(context)
instance = self._get_instance(context, id)
try:
self.compute_api.shelve(context, instance)
except exception.InstanceIsLocked as e:
raise exc.HTTPConflict(explanation=e.format_message())The compute API then decides whether to create a snapshot and call the RPC API shelve_instance or shelve_offload_instance , which ultimately sends a message to the nova-compute service.
Conclusion
This article presented all major OpenStack components and their interaction patterns, using nova‑client debug output and source‑code analysis to illustrate how a complete business request traverses multiple REST and RPC calls. Understanding these flows is essential for both developers extending a service and operators troubleshooting the cloud.
Author
Qiao Liyong , senior systems software engineer at IBM, contributor to the OpenStack community (Launchpad ID "Eli Qiao").
Qunar Tech Salon
Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.