CloudBees CD/RO uses third-party plugins to provision cloud resources in resource templates for Dynamic Environments. Amazon EC2 (EC-EC2) and OpenStack (EC-OpenStack) are supported as out-of-the-box cloud provider plugins, and Chef (EC-Chef) is supported as an out-of-the-box configuration management plugin.
To view the supported cloud provider plugins, open the New Cloud Provider dialog box and click Select cloud provider to view the drop-down menu of cloud providers.
To view the supported configuration management plugins, click Select configuration management to view the drop-down menu of configuration management tools.
If you have an existing procedure that you would prefer to use instead of an out-of-the-box third-party plugin to provision cloud resources, you can create a custom plugin based on your deployment scenario.
The process to create custom cloud provider and configuration management plugins uses metadata to loosely couple them to the application you want to deploy. The custom plugins define specific known properties that are automatically recognized by Dynamic Environments.
To create your own plugin for other cloud platforms, see https://electric-cloud.github.io/index.html to get started. This website describes how to create open source plugins and has this information:
-
For an introduction to the process of building and developing open source plugins, go to the Quick Start .
-
To build and deploy your plugin, see Build and Deploy .
-
For more information, see More information.
Creating Custom Cloud Provider Plugins
This section applies to developers who want to create custom cloud provider plugins for Dynamic Environments in CloudBees CD/RO.
How to Create a Custom Cloud Provider Plugin
This procedure assumes that you already have a plugin and want to use it with CloudBees CD/RO. It describes how to define properties in your plugin that CloudBees CD/RO can read.
-
To convert your procedure to a plugin, define the name of the plugin and the CloudBees CD/RO project to which the plugin belongs.
Later in this procedure, you will use these properties to create pre- and post-hooks to the plugin in CloudBees CD/RO.
-
Define the following properties in your plugin under a top-level plugin property called ` ec_cloudprovisioning_plugin`, which the system will read to Dynamic Environments.
Property Name Description ec_cloudprovisioning_plugin/
Top-level plugin property directory
Properties defined by the custom plugin under
ec_cloudprovisioning_plugin
` displayName`
Name of the plugin that appears in the New Cloud Provider dialog box.
Example: Amazon for the EC-EC2 plugin
hasConfiguration
<Boolean flag —
0|1|true|false
>-
Set this property to
0
if the plugin does not have any configuration procedures (CreateConfiguration
andDeleteConfiguration
). -
Set this property to
1
if the plugin has configuration procedures.
configurationLocation
Name of the property sheet used by the plugin to store the saved configurations.
This value is relative to the plugin’s top-level properties. For example, if this value is set as ec2_cfgs , the plugins configurations are read from /plugins/<PLUGIN_KEY>/project/ec2_cfgs .
operations/
Property sheet for the specific operations required by the Dynamic Environment system.
Properties under operations/ – These operations are mapped to the plugin operations through the following child properties.
createConfiguration/
Properties for the procedure that creates the plugin configuration. It is usually called ` createConfiguration`.
deleteConfiguration/
Properties for the procedure that deletes the plugin configuration. It is usually called ` deleteConfiguration`.
provision/
Properties for the procedure that provisions virtual instances.
retireResource/
Properties for the procedure that tears down (decommissions) a previously provisioned virtual instance backing the specified resource.
retireResourcePool/
Properties for the procedure that tears down (decommissions) all previously provisioned virtual instances for the specified resource pool.
Properties for the previously listed operations defined in the
operations
property sheetprocedureName
Name of the procedure name in the plugin to which the operation is mapped.
ui_formRefs/
Property sheet that references the
ui_forms
properties defined under the plugin’s top-level properties.parameterRefs/
Property sheet for the input parameters to the procedure that can be used by the Dynamic Environment system.
The parameter list is operation-specific.
See Example: Property Structure for a Cloud Provider Plugin for an example of the properties for the EC-EC2 (Amazon) plugin.
-
-
Save the plugin file in the appropriate location on your CloudBees CD/RO server.
-
To import the plugin file to the automation platform:
-
In the automation platform, go to Administration > Plugins to open the Plugin Manager page.
-
Click the Install from File/URL tab.
-
In the File Install field, click Choose file to select the plugin file.
-
Click Upload to install it.
The plugin file appears in the Currently Installed tab.
-
Find your plugin and click Promote in the Actions column to make it available for use by CloudBees CD/RO.
-
-
In CloudBees CD/RO, to create a resource template:
-
See Creating Resource Templates for the details.
-
In the Select cloud provider field, select your plugin as the cloud provider.
-
Enter the plugin settings in the form.
-
(Optional) Set the configuration management tool.
See Creating Resource Templates for the details.
-
-
In the ectool API, enter the following commands to set pre- and post-hooks linking the plugin to an application that you later deploy in a dynamic environment.
-
To create a pre-hook, enter
ectool createHook postConfigurationHook --hookType POST_CONFIGURATION --procedureName <hookProcedureName> --procedureProjectName <hookProjectName> --resourceTemplateName <resourceTemplateName> --projectName <resourceTemplateProjectName>
where
hookProcedureName
is the plugin procedure name,hookProjectName
is the name of the project to which the plugin procedure belongs,resourceTemplateName
is the name of the resource template you created, andresourceTemplateProjectName
is the name of the project to which the resource template belongs. -
To create a post-hook, enter
ectool createHook preConfigurationHook --hookType PRE_CONFIGURATION --procedureName <hookProcedureName> --procedureProjectName <hookProjectName> --resourceTemplateName <resourceTemplateName> --projectName <resourceTemplateProjectName>
where
hookProcedureName
is the plugin procedure name,hookProjectName
is the name of the project to which the plugin procedure belongs,resourceTemplateName
is the name of the resource template you created, andresourceTemplateProjectName
is the name of the project to which the resource template belongs.
-
-
Create an environment template with the resource template that you created.
Example: Property Structure for a Cloud Provider Plugin
This is the EC-EC2 (Amazon) plugin property structure.
Property Name | Property Values |
---|---|
|
|
` displayName` |
Amazon |
|
1 |
|
ec2_cfgs |
|
|
|
|
|
CreateConfiguration |
|
|
|
|
|
|
|
|
|
|
|
DeleteConfiguration |
|
– |
|
configuration called |
|
|
|
API_RunInstances |
|
parameterForm called |
|
configuration called resourcePool called count called |
|
|
|
API_TearDownResource |
|
– |
|
resourcePool called |
|
|
|
API_TearDownResource |
` ui_formRefs/` |
– |
|
resourcePool called |
Creating Custom Configuration Management Plugins
This section applies to developers who want to create custom configuration management plugins for Dynamic Environments in CloudBees CD/RO.
How to Create a Custom Configuration Management Plugin
This procedure assumes that you already have a plugin and want to use it with CloudBees CD/RO. It describes how to define properties in your plugin that CloudBees CD/RO can read.
-
To convert your procedure to a plugin, define the name of the plugin and the CloudBees CD/RO project to which the plugin belongs.
Later in this procedure, you will use these properties to create pre- and post-hooks to the plugin in CloudBees CD/RO.
-
Define the following properties in your plugin under a top-level plugin property called ` ec_configurationmanagement_plugin`, which the Dynamic Environment system can access.
Name Description ec_configurationmanagement_plugin/
Top-level plugin property directory
Properties defined by the custom plugin under
ec_configurationmanagement_plugin
displayName
Name of the plugin that appears in the Dynamic Environment UI
Example: Chef for the EC-Chef plugin
hasConfiguration
<Boolean flag —
0|1|true|false
>-
When this property is set to
0
orfalse
, the plugin does not have any configuration procedures (CreateConfiguration
andDeleteConfiguration
). -
When this property is set to
1
ortrue
, the plugin has configuration procedures.
configurationLocation
Name of the property sheet used by the plugin to store the saved configurations.
This value is relative to the plugin’s top-level properties.
If this value is set as chef_cfgs , the configurations are in /plugins/<PLUGIN_KEY>/project/chef_cfgs .
operations/
Property sheet for the specific operations required by the Dynamic Environment system.
Properties under
operations/
– These operations are mapped to the plugin operations through the following child properties.createConfiguration/
Properties for the procedure that creates the plugin configuration. It is usually called ` createConfiguration`.
deleteConfiguration/
Properties for the procedure that deletes the plugin configuration. It is usually called ` deleteConfiguration`.
converge/
Properties for the procedure that converges the virtual instances to the defined configuration (including policies and roles).
teardown/
Properties for the procedure that deletes the configuration details on the specified dynamic resource or resource pool.
For Chef, properties for the procedure that deletes the Chef API client and Chef node on the specified dynamic resource or resource pool.
Properties for the previously listed operations defined in the
operations
property sheetProperties for the previously listed operations defined in the
operations
property sheetprocedureName
ui_formRefs/
Property sheet that references the
ui_forms
properties defined under the plugin’s top-level properties.parameterRefs/
Property sheet for the input parameters to the procedure that can be used by the Dynamic Environment system.
The parameter list is operation-specific.
See Example: Property Structure for a Configuration Management Plugin for an example of the properties for the EC-Chef plugin.
-
-
Save the plugin file in the appropriate location on your CloudBees CD/RO server.
-
To import the plugin file to the automation platform:
-
In the automation platform, go to Administration > Plugins to open the Plugin Manager page.
-
Click the Install from File/URL tab.
-
In the File Install field, click Choose file to select the plugin file.
-
Click Upload to install it.
The plugin file appears in the Currently Installed tab.
-
Find your plugin and click Promote in the Actions column to make it available for use by CloudBees CD/RO.
-
-
In CloudBees CD/RO, to create a resource template:
-
See Creating Resource Templates for the details.
-
In the Select cloud provider field, select a cloud provider.
-
Enter the account settings for the selected cloud provider.
-
Enter the provision parameters on the next page.
-
In the Select configuration management field, select your plugin as the configuration management tool.
See Creating Resource Templates for the details.
-
-
In the ectool API, enter the following commands to set pre- and post-hooks linking the plugin to an application that you later deploy in a dynamic environment.
-
To create a pre-hook, enter
ectool createHook postConfigurationHook --hookType POST_CONFIGURATION --procedureName <hookProcedureName> --procedureProjectName <hookProjectName> --resourceTemplateName <resourceTemplateName> --projectName <resourceTemplateProjectName>
where
hookProcedureName
is the plugin procedure name,hookProjectName
is the name of the project to which the plugin procedure belongs,resourceTemplateName
is the name of the resource template you created, andresourceTemplateProjectName
is the name of the project to which the resource template belongs. -
To create a post-hook, enter
ectool createHook preConfigurationHook --hookType PRE_CONFIGURATION --procedureName <hookProcedureName> --procedureProjectName <hookProjectName> --resourceTemplateName <resourceTemplateName> --projectName <resourceTemplateProjectName>
where
hookProcedureName
is the plugin procedure name,hookProjectName
is the name of the project to which the plugin procedure belongs,resourceTemplateName
is the name of the resource template you created, andresourceTemplateProjectName
is the name of the project to which the resource template belongs.
-
-
Create an environment template with the resource template you created.
Example: Property Structure for a Configuration Management Plugin
This is the EC-Chef plugin property structure.
Name | Values |
---|---|
|
|
` displayName` |
Chef |
|
1 |
|
chef_cfgs |
|
|
|
|
|
CreateConfiguration |
|
parameterForm called |
|
configuration called |
|
|
|
DeleteConfiguration |
|
– |
|
configuration called |
|
|
|
_RegisterAndConvergeNode |
|
parameterForm called |
|
configuration called |
|
|
|
_DeleteNode |
|
– |
|
resourceName called |