November 13, 2019 By Powell Quiring 5 min read

Learn how to create a Continuous Integration/Continuous Deployment (CI/CD) environment for VPC instance images.

Using a common set of approved base images will improve consistency across your development teams. You can ensure security and reliability through the consistent use of OS versions with the latest updates and security patches. Level up your operational environment by pre-installing agents for powerful cloud logging and metrics services.

See Part 1 of the series: “Automate the Migration of a Workload Based on Virtual Servers from Classic Infrastructure to VPC” 

Create the toolchain, step-by-step

The toolchain is captured in the Toolchain repository. Click the Create Toolchain button to get started—the toolchain is free and there is a free version of the Continuous Integration service. The resources deployed will incur charges.

You have the option to change the toolchain parameters. I suggest changing the Toolchain Name to the name of the virtual private cloud (VPC) image that you are creating. For me, it is the CentOS production image, so I named it centos-prod:

If the values in the GitHub panel are not changed, a clone of the repository that is input into the toolchain’s Delivery Pipeline will be the default in the GitHub integration configuration. Notice that it will have the same name as the toolchain—centos-prod—which will make it easy to find. Your new repository will be a clone of the vpc-tutorials repository and vpc-migrate-from-classic will be the directory that contains the files required:

The Delivery Pipeline panel must be configured. The API keys, classic name, and API key are a little tricky but the handy information button will help you locate the values that you need. For classic, remember you are looking for Classic infrastructure API key. You may need to create the classic API key by clicking the Create button in the Identity and Access Management (IAM) part of the IBM Cloud UI.

Back in the toolchain, clicking Create will create the toolchain and start the first build. You should see the following:

Click on the Delivery Pipeline:

Click on the pipeline settings in the upper right to see some additional fine-grain settings. This gives a hint of what is going to be created. The defaults should be fine—the region, resource group, and secrets came from the toolchain create dialog.  

Special notes:

  • PREFIX defaults to the the name of the toolchain. Note that it will be sanitized during the execution of the pipe line scripts. For detail, see the the script in the GitHub repository that is input to the pipeline.
  • DATE is calculated during the execution of the first stage of the pipeline.
  • REGION is ibm:yp:us-south and will be converted to us-south during the execution of the scripts. The property COS_REGION with the value \$REGION will have the value us-south. If you want a different region, insert the simple name (like eu-de). You can find a list of regions in the docs.

Now, take a look at the stages. They match pretty closely to the Part 1 blog post. Open the first stage to take a look:

The input panel is configured to be invoked when source code is pushed to the GitHub repository:

The jobs in all of the stages are similar, and they kick off the steps defined in Part 1. This one executes parts 000, 010, and 020:


The final stage in the pipeline will clean up everything except the following:

  • COS instance
  • COS bucket
  • VPC custom image

If everything went well, there will be an image in the Custom images for VPC page—it will be the name of the pipeline with the date appended. The date is the time the first stage started execution.

Configuring Github

See the docs on Configuring GitHub to connect GitHub to the toolchain GitHub integration. When complete, changes to your clone of the vpc-tutorials repository will automatically start the first stage of the toolchain pipeline.

Changing the image contents

In your clone of the vpc-tutorials repository, you will see the vpc-migrate-from-classic/create-classic/ file. You will need to replace this portion with your desired content:

If the GitHub integration is configured (see previous step), pushing a new change to your cloned repository will start the toolchain pipeline. 

Final cleanup

The final stage in the pipeline is not triggered automatically. It will remove the COS instance and all COS buckets and contents; click the start button on this stage to do this final cleanup.  

You can manually delete the VPC custom images when they are no longer in use.

Check for the existence of VPC instances and Classic instances from failed runs.


This toolchain pipeline handles the simple creation of a VPC custom image for use when provisioning a VPC instance.  Extend this example to automatically create exactly the image that you need in production and keep it up to date.

For more information on the topics covered in this blog see these resources:

If you have feedback, suggestions, or questions about this post, please reach out to me on Twitter (@powellquiring).

Was this article helpful?

More from Cloud

Enhance your data security posture with a no-code approach to application-level encryption

4 min read - Data is the lifeblood of every organization. As your organization’s data footprint expands across the clouds and between your own business lines to drive value, it is essential to secure data at all stages of the cloud adoption and throughout the data lifecycle. While there are different mechanisms available to encrypt data throughout its lifecycle (in transit, at rest and in use), application-level encryption (ALE) provides an additional layer of protection by encrypting data at its source. ALE can enhance…

Attention new clients: exciting financial incentives for VMware Cloud Foundation on IBM Cloud

4 min read - New client specials: Get up to 50% off when you commit to a 1- or 3-year term contract on new VCF-as-a-Service offerings, plus an additional value of up to USD 200K in credits through 30 June 2025 when you migrate your VMware workloads to IBM Cloud®.1 Low starting prices: On-demand VCF-as-a-Service deployments begin under USD 200 per month.2 The IBM Cloud benefit: See the potential for a 201%3 return on investment (ROI) over 3 years with reduced downtime, cost and…

The history of the central processing unit (CPU)

10 min read - The central processing unit (CPU) is the computer’s brain. It handles the assignment and processing of tasks, in addition to functions that make a computer run. There’s no way to overstate the importance of the CPU to computing. Virtually all computer systems contain, at the least, some type of basic CPU. Regardless of whether they’re used in personal computers (PCs), laptops, tablets, smartphones or even in supercomputers whose output is so strong it must be measured in floating-point operations per…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters