This is an example of showing how to set up a dynamic environment and deploy an application in that environment. It has OpenStack and Chef accounts that do not exist in the latest appliance by default.
Now Try It Yourself
In this module, you will learn how to set up a dynamic environment and deploy an application in that environment. This tutorial presents the following information:
- Creating a resource template for the dynamic environment.
- Creating an environment template for the dynamic environment.
- Deploying an application to the dynamic environment.
- De-provisioning and retiring the dynamic environment.
The steps below describe how to model dynamic environments as demonstrated in the video. You can perform these steps to model dynamic environments using accounts that you create. The accounts in the video are just examples and do not exist in the latest appliance.
Creating the Resource Template for a Dynamic Environment
Let’s first create the resource template for the dynamic environment.
In the Home page, click Environments .
The Environments List opens.
Click on the Resource Templates tab.
The resource template has the information required to spin up the resources on an on-demand basis and to provision dynamic resource pools.
It has cloud provider and cloud instance details as well as configuration management settings.
To add a resource template, click in the "There are no Resource Templates yet. Add one + " message.
The Resource Template dialog box opens.
Click Create new.
Enter the myDynamicResource as the template name in the Name field, and click Next .
We now need to specify the cloud provider.
Click Select cloud provider > OpenStack to specify the cloud provider settings.
The Cloud Provider Account Setup form for OpenStack appears.
Click Select account > hp .
The fields in the form are auto-populated with the HP OpenStack configuration settings. The configuration was created before you configure dynamic resources in CloudBees CD (CloudBees Flow).
Click Next .
The Provision Parameters form appears. This form contains the parameters to provision dynamic resources.
Enter the parameters, and click Next .
The Configuration Management Account Setup page appears.
Click Select configuration management > Chef to specify the configuration management settings.
The Account Setup form for Chef appears.
Click Select account > hostedChef .
The fields in the form are auto-populated with the hostedChef configuration management settings. The configuration is created before you configure dynamic resources in CloudBees CD (CloudBees Flow).
Click Next .
The Converge Parameters form appears.
In the Run List field, enter “wildfly” as the Chef recipe, and click OK .
The wildfly recipe will install JBoss.
Creating the Environment Template for a Dynamic Environment
Now that resource template has been created, next step is to create the environment template.
In the Environments List, click the Environment Templates tab.
Environment templates define the environments created when resources are spun up on an on-demand basis and provision dynamic resource pools are provisioned. They contain this information:
- Name and description
- Environment tier details and properties
Resources assigned to the environment tiers
Cloud resource details from the resource templates
- To add an environment resource template, click in the "There are no Environment Templates yet. Add one + " message.
The Environment Template dialog box opens.
Enter the myEnvTemplate as the template name in the Name field, and click Next .
The Environment Templates Visual Editor appears with a new environment tier.
- Click the Edit button () next to “Tier 1,” enter “Wildfly” as the new environment tier name, and click OK.
- Click + to add a resource.
- Click Add Resource Template.
Select myDynamicResource , the resource template we previously created, and click OK .
Enter the Number of Resources to Provision by entering a number in the field or using the up and down arrows.
- Click OK.
- Click the Add tier button () in the upper right corner of the Environments Visual Editor to create a database tier.
- In the new tier, click the Edit button () next to “Tier 1.”
- In the dialog box, change the tier name from the default (Tier 1) to “MariaDB” and click OK.
- Click + to add a new resource to the MariaDB tier.
In the dialog box, click Add resources , and select jpetstore-db-wildfly-resource in the resource list.
In the Environments Visual Editor, the myEnvTemplate template has two tiers called Wildfly and Maria DB.
- Deploying an Application in a Dynamic Environment
- Now that you know how to create a environment template, let’s see one in action.
In the jpetstore-app row in the Applications List, click on green “Run process” button () and select New Run .
- Select Deploy in the Select process field.
- Click the down arrow in the Select environment field, select the Templates tab, and select myEnvironmentTemplate.
Enter myEnvironment as the environment name in the Name field.
- Click OK to deploy the application process.
View the progress of the application as it is deployed.
To view more details, click the View Detail button ().
Notice that Provisioning Step is running. The environment will be provisioned and configured according to the environment template specification.
The “Applications / View Run” page shows the progress of the provisioning step as well as its parent step.
- De-provisioning and Retiring Dynamic Environments
- The dynamic environment can be automatically de-provisioned or manually retired from the Environments List.
- To de-provision and retire a dynamic environment:
- In the Environment List, select the Environments tab.
In the myEnvironment row, click the Tear down button () to retire the environment and destroy the resources, making them unavailable for any future deployments.
The Retire this Environment? message appears. The provisioned resources will be removed from the cloud and will no longer exist if you click OK .
Click OK .
The Job Details page appears and shows the progress of the job to retire the environment, which is successfully completed.
View the Environments List, and notice that there are no environments in the list.
- What’s next
- Create and run more application deployments.
- To learn more, go to learn.electric-cloud.com.