Blueprints as Code in vRealize Automation 7 Part 1 – Exporting Blueprints

I’ve been doing some work recently with vRealize Autmation 7 and exploring options of how to export blueprints so that they may be stored in a source control system, such as Github. In doing so I discovered a great post by Kris Thieler (@inkysea) which describes his newest Jenkins plugin for vRealize Automation (vRA) 7. One of the enhancements with vRA 7 is the ability to manage blueprints as code, specifically in YAML. Unforunately there isn’t a native way to do this easily. Kris Thieler, however, has been working to make this process easier. The post I mentioned above shows the Jenkins working with vRA 7 along with a source control system, but I wanted to take some time to outline the entire set up process to get this working. I will break this up into a few different posts, starting with this one.

This post(s) will assume you have a source control system set up (such as Github). This post also assumes you are familiar with using Git. If you aren’t, check out the 30 Days of Commitmas, an intro to Git.

Blueprints as Code in vRealize Automation 7 Part 1 – Exporting Blueprints

Blueprints as Code in vRealize Automation 7 Part 2 – Adding Blueprints to Github and Setting up Jenkins

Blueprints as Code in vRealize Automation 7 Part 3 – Creating a New Jenkins Job

 

First up, you’ll need to have vRA 7 installed and a basic blueprint created. In order to export the blueprint you’ll need to download the latest vRealize CloudClient, which as of this writing is version 4.1. Once you’ve downloaded and extracted it, open up a command prompt and navigate to the directory where you extracted it to. Navigate to the bin directory and dependning on your platform, run the cloudclient.bat or cloudclient.sh file

ScreenShot2016-05-20at10.26.27AM

Once you’ve gotten into the CloudClient type the following to log on to the vRA appliance:

 

 

You will see a message stating that your login is [ACTIVE] but your session is [INACTIVE] and that’s OK.

Now you need to log on to the vRA IAAS box:

 

 

You’ll see a similar message about you login and session, but this time for the IaaS Model Manager. Now make sure you’re authenticated:

 

 

ScreenShot2016-05-20at10.41.37AM

 

Now that the logins are active for both the appliance and IaaS you can export your blueprint.

The first thing we need to do is get a list of all the blueprints that are part of this tenant.

 

 

This will pull all the blueprints that you have created

ScreenShot2016-05-20at10.47.06AM

 

I have a few in this environment, you’ll notice there is an id column and a name column. The first thing you’ll need to do before you can export the blueprint is to create a package. A package is an object with one or more blueprints, as specified by the blueprint id. We’re going to use the Windows Server 2008 R2 blueprint that you see above for this example. However, unfortunately we cannot use the blueprint id to create a package. We need to first get the id (not contentId) for the blueprint we want to add and then create the package; here are the steps:

 

 

Copy the Id for the blueprint you want to add to eventually export

ScreenShot2016-05-20at11.19.29AM

 

Now lets create the package so that we can export it:

 

 

You should now receive a message that the package was created successfully along with the package ID. You’ll need this to perform the export. Lets verify the package you created along with its Id:

 

 

ScreenShot2016-05-20at11.26.46AM

You now have a newly created package that contains the blueprint you want to export. Time to export the package (blueprint):

 

 

Note: if you have slashes (\) in your path you need to escape them with another slash (\)

ScreenShot2016-05-20at11.35.46AM

The exported package will be in .zip format. When we are ready to push it to a source control system we will first unpackage it

You’ve successfully exported your first vRA 7 blueprint!

In the Part 2 we will cover placing the blueprint into a source control system and setting up the Jenkins environment.

Comments 4

  1. Pingback: Blueprints as Code in vRealize Automation 7 Part 2 – Adding Blueprints to Github and Setting up Jenkins – ValCo Labs

  2. Pingback: Blueprints as Code with vRA and Jenkins | Phil's Splice

  3. Nice Post,
    Hi i am working on automation of vRA 6.2. i installed CloudClient and able to login.
    but when trying to run blueprint,content,package list commands all are not giving any output.

    CloudClient>vra package list
    Command ‘vra package list’ not found (for assistance press TAB)

    any one has idea about that please help.
    thanks in advance.

    1. Post
      Author

Leave a Reply

Your email address will not be published. Required fields are marked *

*