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 viktor@viktorious.local --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
and
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!
5 Comments
Justin
vra machines list –allMachines true –columns name,status,interfaceType,owner,blueprint,catalogResource.organization.subtenantLabel,reservation,resourceUsage.memoryUsageAverage,resourceUsage.cpuUsageAverage –format CSV –export machineList.csv
The column name is a little bit different from UI, and user can always use:
vra machines list –allMachines true –format JSON
to check the column name and decide what value should be put into the “–columns” field.
However, due to the GuestOS is a deeply nested parameter, CloudClient cannot export into CSV and Table yet,
santhosh
Hi Justin,
is that possible to pull report of Virtual machine which got deployed in last one month not the all machines report.
viktorious
Maybe you can do this with vRealize Operations?
Domenico D'Apice
Hi, can we export custom forms from a blueprint with the cloudclient? Or via vra rest api…
Thanks
Dominic
scott rosenberg
You can get a custom form from the API using the forms service. Check out the API documentation. I believe it can also be done from the composition service but I’m not sure about that