Skip to content

Commit 49472c0

Browse files
Doc for network extension (#649)
* Doc for network extension * Update doc: use JSON payload
1 parent 4752cbc commit 49472c0

4 files changed

Lines changed: 218 additions & 14 deletions

File tree

source/adminguide/extensions.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Extensions
1818
==========
1919

20-
Extensions are a new mechanism introduced in Apache CloudStack to allow administrators to extend the platform's functionality by integrating external systems or custom workflows. Currently, CloudStack supports a single extension type called Orchestrator.
20+
Extensions are a new mechanism introduced in Apache CloudStack to allow administrators to extend the platform's functionality by integrating external systems or custom workflows. Currently, CloudStack supports two extension types: Orchestrator and NetworkOrchestrator.
2121

2222
In the UI, extensions can be managed under *Extensions* menu.
2323

@@ -26,7 +26,7 @@ In the UI, extensions can be managed under *Extensions* menu.
2626
Overview
2727
^^^^^^^^
2828

29-
An extension in CloudStack is defined as an external binary (written in any programming language) that implements specific actions CloudStack can invoke. This allows operators to manage resource lifecycle operations outside CloudStack, such as provisioning VMs in third-party systems or triggering external automation pipelines.
29+
An extension in CloudStack is defined as an external binary (written in any programming language) that implements specific actions CloudStack can invoke. This allows operators to manage resource lifecycle operations outside CloudStack, such as provisioning VMs in third-party systems, orchestrating network and VPC services on external devices, or triggering external automation pipelines.
3030

3131
Extensions are managed through the API and UI, with support for configuration, resource mappings, and action execution.
3232

@@ -41,7 +41,7 @@ Administrators can define and manage the following components of an extension:
4141

4242
- Configuration Details: Key-value properties used by the extension at runtime.
4343

44-
- Resource Mappings: Association between extensions and CloudStack resources such as clusters, etc.
44+
- Resource Mappings: Association between extensions and CloudStack resources such as clusters and physical networks.
4545

4646
Path and Availabilty
4747
^^^^^^^^^^^^^^^^^^^^
@@ -80,6 +80,25 @@ An Orchestrator extension enables CloudStack to delegate VM orchestration to an
8080

8181
|extension.png|
8282

83+
NetworkOrchestrator Extension
84+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85+
86+
A NetworkOrchestrator extension enables CloudStack to delegate guest network and VPC service orchestration to an external network system. Key features include:
87+
88+
- Physical Network Mapping: NetworkOrchestrator extensions are registered with a CloudStack physical network instead of a cluster.
89+
90+
- Provider-based Integration: When a NetworkOrchestrator extension is registered with a physical network, CloudStack creates an external network service provider using the extension name. Network and VPC offerings can then use that provider.
91+
92+
- Capability-driven Services: Supported services are declared through the extension details ``network.services`` and optional per-service capabilities in ``network.service.capabilities``. CloudStack uses these declarations when exposing supported services and validating offering capabilities.
93+
94+
- Network and VPC Lifecycle: Depending on the declared services, the extension can handle operations for guest networks, VPCs, public IPs, NAT, load balancing, DHCP, DNS, userdata, network ACLs, and related restart or reapply flows.
95+
96+
- Registration Details: Resource-specific details such as device endpoints, credentials, host lists, or interface mappings can be stored on the physical-network registration and updated later through the UI or the ``updateRegisteredExtension`` API.
97+
98+
- Network and VPC Custom Actions: Admins can define custom actions for ``Network`` and ``Vpc`` resources when the extension advertises the ``CustomAction`` service.
99+
100+
- Reference Implementation: A Linux network namespace based implementation is available in `cloudstack-extensions <https://github.com/apache/cloudstack-extensions/tree/network-namespace/Network-Namespace>`_. This reference backend has been validated with KVM-based smoke tests.
101+
83102

84103
CloudStack provides built-in Orchestrator Extensions for Proxmox, Hyper-V, and MaaS, which work with their respective environments out of the box.
85104

source/adminguide/extensions/custom_actions.rst

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
Custom Actions
1818
^^^^^^^^^^^^^^
1919

20-
In addition to standard instance operations, extensions support custom actions. These can be configured via UI in the extension details view or the addCustomAction API. The extension binary or script must implement handlers for these action names and process any provided parameters.
20+
In addition to standard lifecycle operations, extensions support custom actions. These can be configured via UI in the extension details view or the addCustomAction API. The extension binary or script must implement handlers for these action names and process any provided parameters.
21+
22+
For Orchestrator extensions, custom actions typically target ``VirtualMachine`` resources. For NetworkOrchestrator extensions, custom actions can target ``Network`` and ``Vpc`` resources when the extension advertises the ``CustomAction`` network service.
2123

2224
|add-custom-action.png|
2325

@@ -43,11 +45,34 @@ A single parameter can have the following details:
4345

4446
- **valueoptions**: Options for the value of the parameter. This is allowed only for NUMBER and STRING type.
4547

48+
Supported Resource Types
49+
~~~~~~~~~~~~~~~~~~~~~~~~
50+
51+
Custom actions can be attached to the following resource types:
52+
53+
- ``VirtualMachine`` for Orchestrator extensions.
54+
55+
- ``Network`` for NetworkOrchestrator extensions.
56+
57+
- ``Vpc`` for NetworkOrchestrator extensions.
58+
59+
For network and VPC custom actions, CloudStack dispatches the action to the external provider that serves the ``CustomAction`` service for the selected resource.
60+
61+
For ``NetworkOrchestrator`` extensions, the action is executed as ``custom-action`` using the standard payload-file invocation model:
62+
63+
.. code-block:: bash
64+
65+
/path/to/<extension_name>.sh custom-action <payload_file> <timeout_seconds>
66+
67+
The payload file contains top-level keys such as ``action``, ``action-params``, ``physical-network-extension-details``, and ``network-extension-details``. Unlike other network extension commands, the custom action request does not wrap its command-specific values inside a nested ``payload`` object.
68+
4669

4770
Running Custom Action
4871
~~~~~~~~~~~~~~~~~~~~~
4972

50-
All enabled custom actions can then be triggered for a resource of the type the action is defined for or provided while running, using the **Run Action** view or runCustomAction API.
73+
All enabled custom actions can then be triggered for a resource of the type the action is defined for or provided while running, using the **Run Action** view or the relevant custom action API.
74+
75+
For network and VPC custom actions, CloudStack passes the full request in the payload file and returns the script's ``stdout`` to the caller. The available actions shown in the UI depend on the selected resource type and the extension bound to that resource.
5176

5277
|run-custom-action-instance.png|
5378

0 commit comments

Comments
 (0)