on 01-17-2018 11:53 AM
Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel.
Using the CloudCenter platform we can directly use packer to create AMIs in AWS and add the image mapping to CloudCenter to be used by various application profiles. This helps with image management in the public cloud using CloudCenter. Note in this example, during image mapping we will leave the mapping of the instance types empty. Once the images are mapped, the user will have to edit the mapping to choose the right instance type they would like to make available for this image.
The service highlights how we can use packer to create a Centos image in AWS. This script is an example usage of Packer. You can leverage this integration to create more advance deployments.
The Packer Service bundle consists of the following files:
The parameter name is key here and should match the parameter name in the UI
amazon-ebs Packer builder is able to create Amazon AMIs backed by EBS volumes for use in EC2When using Packer we need to provide parameters for the template that is used to build the image. This example integration provides a sample template to create a Centos image. Users can modify these parameters and create their own templates based on their use case
To add this service login to CloudCenter as an administrator and click on Admin->Services->Add Service. Use the information listed below to create the service.
Service Type: External Service
Name: Packer
Service ID: packerbuild
Description: Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration.
Category: Custom Service
External Lifecycle Actions:
External Action Bundle: <location of packerbuild.zip>
Start:
Script from Bundle: service start
Service Parameters
| Parameter Name | PACKER_ZIP_URL |
| Display Name | PACKER ZIP URL |
| Type | string |
| Default Value | https://releases.hashicorp.com/packer/1.1.3/packer_1.1.3_linux_amd64.zip |
| User Options |
| Parameter Name | api_user |
| Display Name | CloudCenter API User |
| Type | string |
| Default Value | cliqradmin |
| User Options |
| Parameter Name | api_key |
| Display Name | CloudCenter API Key |
| Type | string |
| Default Value | |
| User Options |
| Parameter Name | ccm_url |
| Display Name | CloudCenter CCM URL |
| Type | string |
| Default Value | <your ccm ip> |
| User Options |
Deployment Parameters
| Parameter Name | ami_name |
| Display Name | AMI Name |
| Type | string |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | source_ami |
| Display Name | Source AMI |
| Type | string |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | subnet_id |
| Display Name | Subnet ID |
| Type | string |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | vpc_id |
| Display Name | VPC ID |
| Type | string |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | instance_type |
| Display Name | Instance Type |
| Type | string |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | ssh_username |
| Display Name | SSH Username |
| Type | string |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | virtualization |
| Display Name | Virtualization |
| Type | string |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | root_volume_size |
| Display Name | Root Volume Size |
| Type | string |
| Default Value | 10 |
| User Options | Visible, Editable |
| Parameter Name | log_volume_size |
| Display Name | Log Volume Size |
| Type | string |
| Default Value | 10 |
| User Options | Visible, Editable |
| Parameter Name | region |
| Display Name | AWS Region |
| Type | string |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | template_url |
| Display Name | Packer Template Location |
| Type | path |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | provisioner_script_url |
| Display Name | Provisioner Script Location |
| Type | path |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | image_name |
| Display Name | CloudCenter Image Name |
| Type | string |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | image_desc |
| Display Name | CloudCenter Image Description |
| Type | string |
| Default Value | |
| User Options | Visible, Editable |
| Parameter Name | os_type |
| Display Name | CloudCenter Image OS Type |
| Type | list |
| List Values | LINUX,WINDOW |
| Default Value | LINUX |
| User Options | Visible, Editable |
i do have a company of movers and packers in Dubai and man I was looking for some cool ideas to improve it and your post just solved my problem it really helped me a lot you can add something to my site as well by looking at once if you can otherwise thanks for the post man
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: