Using the vRA Cloud Client to export and import blueprints

There are lots of reasons to want to export and import blueprints from one vRA instance to another.  My current motives are to move blueprints from my vRA 7.2 environment to my newly deployed vRA 7.3 environment.  In vRA 7.3 their is a great new free feature available, the Code Stream Management Pack for IT Devops that is free.  However if you are running a pre vRA 7.3 environment you may want to get that content from that environment backed up so you can use it in another instance.  Cloud Client is a great option.

You can download Cloud CLient 4.4.0 here.

Connecting Cloud Client to vRA

I prefer to use an AutoLogin file to connect to vRA.  To create an AutoLogin file follow the instructions below:

  1. Launch CloudClient by going to the download folder and running either the cloudclient.bat or cloudclient.sh under the Bin folder.
  2. Run the command login autologinfile, this will create a file named Cloudclient.properties in the root CloudClient folder.
  3. Next we need to run the login keyfile command. The syntax for this command is login keyfile –password YOUR_PASS –file FILE_TO_STORE_ENCRYPTED_PASSWORD.txt.
  4. Next edit the Cloudclient.properties file and input the information for your vRA Server, vRA Tenant, vRA username, & vRA keyfile.  Repeat for the vRA Iaas Host.
  5. Run the Cloudclient and verify that it has connected to the vRA Appliance and IaaS Host.

image



Exporting vRA Blueprints With CloudClient

First we need to get a list of the content that is available in vRA by running the following command

vra content list

If you have a large collection you can see more by adding –pageSize {# to show} or by going to another page by using –page {page #}

image

You can also filter what you see to a specific type of content such as composite blueprints by using –type  {contentTypeId}

image



Make note of the ID and Content ID of the blueprint, Software Component, or property group you with download, we will need it in the next step.

Now we need to issue the command to perform the export.

vra content export –path c:\temp\cloudclient –id {ID from previous step} –content-id {Content ID from previous step}

image

You will notice that it exports the blueprint and any associated Software Components and dependent blueprints if you are using nested blueprints.

Importing Blueprints into vRA using Cloud Client

Once you have your blueprints exported we can connect cloud client to another environment and import them.  In my example about I showed you how to use a properties file to connect cloudclient to vRA.  This may not always be convenient, especially if you have multiple instances.  I tend to use the properties file for my primary instance and then override it with command when I need to connect to other instances.   To do this you use the following command:

vra login userpass –user {user} –tenant {tenant} –server {https://server FQDN} –password {password}

Alternatively you can copy your entire cloudclient directory to a new name and reconfigure it for a different server and use whichever one you need.

On to importing our previously exported blueprint.  As you can see from the image below I have to blueprints in my newly deployed vRA instance.

image

Once I import I will have multiple Blueprints as my exported composite blueprint utilizes nested blueprints.

To import your composite blueprint issue the following command:

vra content import –path {path to exported file} –resolution {OVERWRITE|SKIP} –precheck {OFF|ON|WARN} –verbose

Once completed you will see output like the following:

image

If we look again I have two blueprints.

Enjoy exporting and importing!



Leave a Reply