Valid since:
XL Deploy 5.5.0
Removed in:
XL Deploy 6.0.0
XL Deploy provisioning example (XL Deploy 5.5.x)
This topic provides a step-by-step example that will help you get started with the XL Deploy provisioning feature. This example shows how to provision a cloud-based environment running Apache Tomcat. This example assumes you are using a Unix-based operating system.
Note: A version of this topic is available for XL Deploy 6.0.0 and later.
Step 1 Start XL Deploy
Follow the instructions to install XL Deploy 5.5.0 or later. Note that Java Development Kit (JDK) 8 is required.
If XL Deploy is already installed, start the XL Deploy server.
Step 2 Create a blueprint
A blueprint is a logical grouping of provisioning packages. A provisioning package describes the infrastructure items that should be created and the details of the environment to which infrastructure items will be associated. To create a new blueprint:
- Click Repository in the top bar.
- Right-click Blueprints and select New > upm > Blueprint.
- In the Name box, enter
PetclinicEnvBlueprint
. - Click Save.
Step 3 Create a provisioning package
To create a new provisioning package:
- Right-click PetclinicEnvBlueprint and select New > ProvisioningPackage.
- In the Name box, enter
1.0
. - Click Save.
Step 4 Create provisionables and templates
A provisioning package consists of provisionables, which are virtual machine specifications, and templates for configuration items (CIs).
Create an instance specification
To create a new provisionable, right-click the 1.0 provisioning package and select New > aws > ec2.InstanceSpec. This will create a specification for an Amazon EC2 instance. Enter the following properties:
Property | Value | Description |
---|---|---|
Name | tomcat-instance-spec |
The name of the CI |
Cardinality | 1 |
The number of instances to create (default is 1) |
AWS AMI ID | Your AWS AMI ID (for example, ami-d91be1ae ) |
The ID of the AMI where Puppet is installed |
Region | The EC2 region of the AMI (for example, eu-west-1 ) |
The EC2 region, which must be valid for the AMI that you selected |
AWS Security Group | default |
The security group of the AMI |
Instance Type | m1.small |
The size of the instance |
AWS key pair name | Your AWS key name | Name of your EC2 SSH key pair. If you do not have an AWS key name, log in to the Amazon EC2 console, create a new key, and download it to your local machine. |
Create an SSH host template
Right-click the 1.0 provisioning package and select template > overthere.SshHost. Enter the following properties:
Property | Value | Description |
---|---|---|
Name | tomcat-host |
The name of the CI |
Operating System | UNIX |
Operating system of the virtual machine |
Connection Type | SUDO |
Puppet requires a SUDO connection |
Address | {{%publicHostname%}} |
This is a placeholder that will be resolved from the provisioned |
Username | ubuntu |
User name for the EC2 machine |
Private Key File | SSH_DIRECTORY/{{%keyName%}}.pem |
The location of the SSH key on your local machine to use when connecting to the EC2 instance. SSH_DIRECTORY is the directory where you store your SSH keys; for example, Users/yourusername/.ssh |
SUDO username | root |
The user name to use for SUDO operations (this property is located on the Advanced tab |
Create a Tomcat server template
Next, right-click the tomcat-host CI that you just created and select New > tomcat.Server. Enter the following properties:
Property | Value | Description |
---|---|---|
Name | tomcat-server |
The name of the CI |
Home | /opt/apache-tomcat |
Puppet will install Tomcat in this directory |
Start Command | sh bin/startup.sh |
The command that will start Tomcat |
Stop Command | sh bin/shutdown.sh |
The command that will stop Tomcat |
Create a Tomcat virtual host template
Finally, right-click the tomcat-server CI that you just created and select New > tomcat.VirtualHost. Enter the following properties:
Property | Value | Description |
---|---|---|
Name | tomcat-vh |
The name of the CI |
Now you will have the following CIs under Blueprints:
Step 5 Bind the SSH host template to the instance spec
To bind the tomcat-host template to the tomcat-instance-spec provisionable:
- Double-click tomcat-instance-spec to open it.
- Under Bound Templates, select
Blueprints/PetclinicEnvBlueprint/1.0/tomcat-host
and clickto move it to the Members list.
- Click Save.
Step 6 Add the Puppet provisioner
To add Puppet as a provisioner:
- Right-click tomcat-instance-spec and select provisioner.Manifest to create a new Puppet manifest.
- In the Name box, enter
install-tomcat
. - Select
tomcat-host
from the Host list. - Under Artifact, upload a Puppet manifest file that will install Tomcat.
- Click Save.
Add modules to the provisioner
Add Puppet modules to the provisioner:
- Right-click the install-tomcat CI that you just created and select New > provisioner.ModuleSpec.
- In the Name box and the Module Name box, enter
puppetlabs-tomcat
. - Click Save.
- Repeat this process to create a
provisioner.ModuleSpec
CI forpuppetlabs-java
.
Now you will have the following CIs under Blueprints:
Step 7 Create the AWS provider
Create a new provider for Amazon Web Services (AWS):
- Right-click Providers and select New > aws > ec2.Cloud.
- In the Name box, enter
xl-aws-provider
. - Enter your AWS credentials in the Access Key ID and Secret Access Key boxes.
- Click Save.
Step 8 Create a provisioning environment
Create an environment where the provisioning package will be provisioned:
- Right-click ProvisioningEnvironments and select New > upm > ProvisioningEnvironment.
- In the Name box, enter
environment-creator
. - Under Providers, select
Providers/xl-aws-provider
and clickto move it to the Members list.
- Click Save.
Step 9 Perform provisioning
To provision the environment:
- Click Provisioning in the top bar.
- Under Blueprints, select PetclinicEnvBlueprint and drag it to the left side of the Provisioning Workspace.
-
Under Provisioning Environments, select environment-creator and drag it to the right side of the Provisioning Workspace.
- There will be one error, because you did not specify the XL Deploy environment where the
overthere.SshHost
CI based on the bound template should be assigned. To fix this error, click Provisioning Properties. -
In the Environment Name box, enter
petclinic
. - Click OK.
-
Click Execute to perform the provisioning.