The CloudClient is a powerful tool that provides a CLI to vRealize Automation and vRealize Orchestrator. The CloudClient is used for troubleshooting, but also provides some additional functionality to vRealize Automation that isn’t available in the standard UI. In this article I will walk through the steps that are required if you want to export and import a vRA blueprint. I will also show how to create and use a “package” to bundle content.
First step is to logon to the vRA appliance and vRA infrastructure server. There are several ways to perform this, in this example I’m just using the basic manual logon process:
vra login userspass --user email@example.com --tenant vsphere.local --server https://vra01.viktorious.local
With –password you can also add your password to this command. The user account in this command, is the user account that is used to logon to the vRA self-service portal.
Now logon to the vRA infrastructure server, this is the Windows server.
vra login iaas --user svc_vra --server vraic.viktorious.local --password p@ssw0rd
Notice that the Windows server account (svc_vra) is without the domain name.
Now check if your sessions are authenticated:
vra login isauthenticated all
Now list available content in vRealize Automation with:
vra catalog list
vra catalog list --page 2
for the second page.
You can also list a specific type of content:
vra catalog list --type property-definition
You can export a single item (for example a blueprint) with:
vra content export --path /home/viktor --id XYZ --content-id ABX
If you want to export a collection of items (for example a set of property definitions, property groups, component profiles and a blueprint), it’s a better idea to create a “package”.
vra package create --name PackageName --ids ABC,DEF,GHI,JKL
You can add additional items to a package with
vra package content add --pkgId XYZ --ids ABC,DEF,GHI,JKL
You can check the contents of a package with:
vra package content list --pkgId ABD
Now export the package with:
vra package export --path /home/viktor --pkgId ABC
The import process for an individual item or a package is similar:
vra content import --path /home/viktor/package.zip --resolution SKIP --dry-run yes --verbose yes
In this command the resolution partner tells the Cloud Client what to do with conflicting (existing) items. Valid parameters are SKIP or OVERWRITE. With “–dry-run yes” you can test the import (perform a dry-run), with –verbose you can enable the verbose output. If you want to import the package “no matter what” you can run:
vra content import --path /home/viktor/package.zip --resolution OVERWRITE
I hope this was helpful!