Browsed by
Tag: vra

vRA 7.x Snapshotting using PowerCLI Script

vRA 7.x Snapshotting using PowerCLI Script

Recently, I was looking for a scripted method for cold snapshotting of vRA in enterprise deployment. First, I wanted to confirm the shutdown order. VMware’s product documentation is quite limited regarding this topic, but it describes the right shutdown order. Looking further I found a better explanation here, where the documentation talks about vRA backup order. Of course, I wanted to check the proper starting procedure as well. I found it quickly here.

Well equipped with all information needed, I decided to write a script. Usually I use PowerCLI for tasks related to VMware software. I was sure that someone had the same idea before me so in order not to reinvent the wheel I started to check what Google will find.
I found a few elegant approaches, but one was the most interesting and inspiring.
Distributed vRealize Automation 7.x Orchestrated Shutdown, Snapshot and Startup using PowerCLI
Razz made it the way that I found I could use in my environment. I adjusted the script to my needs and it worked quite well. Of course, there is a lot to polish, but it works for me.

I decided to share Razz’s script adjusted by me. Maybe it will help someone with their administration tasks related to vRA.

$vCSA = ""
$snapName = ""
$snapDescription = ""
$log = ""

# vRA components
$proxy = @() 
$worker = @() 
$activeMgr = ""
$passiveMgr = @()
$primaryWeb = ""
$secondaryWeb = @()
$masterVRA = ""
$replicaVRA = @()
$dbServers = @()
$vRB = ""
$vRO = @()
$allVMs = @()

# Log file
$log = "coldvRASnapshots.log"

function shutdownVMandWait($vms,$log) {
    foreach ($vmName in $vms) {
        try {
            $vm = Get-VM -Name $vmName -ErrorAction Stop
            foreach ($o in $vm) {
                    if (($o.PowerState) -eq "PoweredOn") {
                        $v = Shutdown-VMGuest -VM $o -Confirm:$false
                        Write-Host "Shutdown VM: '$($v.VM)' was issued"
                        Add-Content -Path $log -Value "$($v)"
                    } else {
                        Write-Host "VM '$($vmName)' is not powered on!"
        } catch {
            Write-Host "VM '$($vmName)' not found!"
    foreach ($vmName in $vms) {
        try {
            $vm = Get-VM -Name $vmName -ErrorAction Stop
            while($vm.PowerState -eq 'PoweredOn') { 
                sleep 5
                Write-Host "VM '$($vmName)' is still on..."
                $vm = Get-VM -Name $vmName
            Write-Host "VM '$($vmName)' is off!"
        } catch {
            Write-Host "VM '$($vmName)' not found!"

function snapshotVM($vms,$snapName,$snapDescription,$log) {
    foreach ($vmName in $vms) {
        try {
            $vm = Get-VM -Name $vmName -ErrorAction Stop
        } catch {
            Write-Host "VM '$($vmName)' not found!"
            Add-Content -Path $log -Value "VM '$($vmName)' not found!"
        try {
            foreach ($o in $vm) {
                    New-Snapshot -VM $o -Name $snapName -Description $snapDescription -ErrorAction Stop   
        } catch {
            Write-Host "Could not snapshot '$($vmName)' !"
            Add-Content -Path $log -Value "Could not snapshot '$($vmName)' !"

function startupVM($vms,$log) {
    foreach ($vmName in $vms) {
        try {
            $vm = Get-VM -Name $vmName -ErrorAction Stop
            foreach ($o in $vm) {
                if (($o.PowerState) -eq "PoweredOff") {
                        Start-VM -VM $o -Confirm:$false -RunAsync
                    } else {
                        Write-Host "VM '$($vmName)' is not powered off!"
        } catch {
            Write-Host "VM '$($vmName)' not found!"

# vCenter Server FQDN
$vCSA = Read-Host -Prompt "Enter vCenter's FQDN"

# Connect vCenter Server
$creds = Get-Credential

Connect-VIServer $vCSA -Credential $creds -ErrorAction Stop

# Get VM names
$proxy = @(((Read-host -Prompt "Enter comma separated names of Proxy Agent VMs").Split(",")).Trim()) 
$worker = @(((Read-host -Prompt "Enter comma separated names of DEM worker VMs").Split(",")).Trim()) 
$activeMgr = Read-host -Prompt "First, check which VM is a Primary Manager and then enter its name"
$passiveMgr = @(((Read-host -Prompt "Enter comma separated names of Secondary Manager VMs").Split(",")).Trim())
$primaryWeb = Read-host -Prompt "First, check which VM is a Primary Web Server and then enter its name"
$secondaryWeb = @(((Read-host -Prompt "Enter comma separated names of Secondary Web VMs").Split(",")).Trim())
$masterVRA = Read-host -Prompt "Enter a name of Master vRA Node VM"
$replicaVRA = @(((Read-host -Prompt "Enter comma separated names of Replica vRA Node VMs").Split(",")).Trim())
$dbServers = @(((Read-host -Prompt "Shutdown MSSQL AlwaysOn Cluster first, than enter comma separated names of DB Cluster Node VMs").Split(",")).Trim())

<# ### Uncomment all commented block of code if you have vRB or the external vRO instances in your environment
$vRB = Read-host -Prompt "Enter a name of vRB VM"
$vRO = @(((Read-host -Prompt "Enter comma separated names of external vRO VMs").Split(",")).Trim())

$allVMs = @($proxy, $worker, $passiveMgr, $activeMgr, $secondaryWeb, $primaryWeb, $replicaVRA, $masterVRA, $dbServers)

# Snapshot definition
$snapName = Read-Host -Prompt "Enter Snapshot Name"
$snapDescription = Read-Host -Prompt "Enter Snapshot Description"

# Shutting down vRA VMs
foreach ($vmName in $allVMs) {
    foreach ($vm in $vmName) {
        if ($vm) {
            Write-Host "### Shutting down " + $vm
            shutdownVMandWait -vms $vm -log $log
        } else {
            Write-Host "VM '$($vm)' doesn't exist!"

# Snapshotting vRA VMs
foreach ($vmName in $allVMs) {
    foreach ($vm in $vmName) {
        if ($vm) {
            Write-Host "### Taking snapshot of " + $vm
            snapshotVM -vms $vm -snapName $snapName -snapDescription $snapDescription -log $log
        } else {
            Write-Host "VM '$($vm)' doesn't exist!"

# Starting vRA VMs
Write-Host "### Starting vROs"
startupVM -vms $vRO -log $log

Write-Host "### Starting vRB"
startupVM -vms $vRB -log $log

Write-Host "### Starting DB Servers"
startupVM -vms $dbServers -log $log
Write-Host  " Sleeping 5 minutes until db is up"
Start-Sleep -s 300

Write-Host "### Starting primary VRA"
startupVM -vms $masterVRA -log $log
Write-Host  " Sleeping 5 minutes until Licensing service is registered"
Start-Sleep -s 300

Write-Host "### Starting secondary VRA"
startupVM -vms $replicaVRA -log $log
Write-Host  " Sleeping 15 minutes until ALL services are registered"
Start-Sleep -s 900

Write-Host "### Starting Web"
startupVM -vms $primaryWeb -log $log
startupVM -vms $secondaryWeb -log $log
Write-Host  " Sleeping 5 minutes until services are up"
Start-Sleep -s 300

Write-Host "### Starting Primary manager"
startupVM -vms $activeMgr -log $log
Write-Host  " Sleeping 3 minutes until manager is up"
Start-Sleep -s 180

Write-Host "### Starting Secondary manager"
startupVM -vms $passiveMgr -log $log
Write-Host  " Sleeping 3 minutes until manager is up"
Start-Sleep -s 180

Write-Host "### Starting DEM workers"
startupVM -vms $worker -log $log

Write-Host "### Starting Proxy Agents"
startupVM -vms $proxy -log $log

Write-Host "### All components have been started"

# Disconnect vCenter 
Disconnect-VIServer -Server $vCSA -Confirm:$false 
VCIX6-CMA – another goal achieved

VCIX6-CMA – another goal achieved

It is almost a tradition or habbit for me to share my experience about VMware exmination taken so far.

Well, it happened, I eventually passed the VCAP6-CMA Design exam which together with previos passed VCAP6-CMA Deploy exam gave me VCIX6-CMA tiltle and badge. It looks like this:vmware_milestone_CMA_expert-e1502128382899Nothing special, it was not an easy way to get it, though!

The biggest problem with that IMHO is that it is and old version which is based on vRA 6.X, whilst we currently have 7.3 available since sometime already..

Besides that I experienced a few additional problems with Pearson Vue/ VMware certification engine which made me to take it each exam more than once.  And still it’s version 6 and a few days ago VMware announced new versions of VCAP certs, however that’s only Design ones.

There is nothing more to do right nowe, just prepare for new version 🙂 which as a certification addicted I will for sure try to gain.

P.S. to be honest VCAP6-CMA Design exam was the most tricky one I have ever took so far.


Importing the Dukes Bank sample application blueprint – Introduction to vRealize CloudClient

Importing the Dukes Bank sample application blueprint – Introduction to vRealize CloudClient

Have you just installed the vRealize Automation in your lab and do not know how to start the journey with services? The Dukes Bank for vSphere application might be a perfect start for you!

But what is that mystery Dukes Bank application ? It is not widely known that there are let’s say “embedded” samples of multi-tiered vRealize Automation blueprints  that includes multiple machine components with networking and software components.

The reason that it is not known by many is that they are not available ad-hoc after installation, you will not see them inside your catalog. To publish these services in Tenant’s catalog you need to import and configure it first. Bellow I described the procedure how to import and publish these services, in another article you will find out how to configure it.

The ZIP file for Dukes Bank sample application blueprint is include on the vRA appliance, however to import it you have to use vRealize Cloud Client which can be downloaded here.

vRealize CloudClient is a CLI utility that provides verb-based access with a unified interface across vRA APIs, it is available since vRA version 6.2. The purpose of CloudClient tool is to create a layer of abstraction between vRA and end consumer, I mean Administrator of vRA to increase the ease by which he is able to run automated actions against vRA. It is worth to meantion that this tool is not a REST or SOAP API. It uses the vRA API instead.

Just to list a few of use cases for vRA API:

  • Reporting;
  • Monitoring and troubleshooting;
  • Change request system;
  • Operation scripts;
  • Migration between environments;
  • Creating reservations;
  • Creating business groups;
  • Creating entitlements;
  • Other management tasks.

Going back to the point, after downloading the CloudClient you can run it from Windows as well as Linux, however I realized that if you want to import Dukes Bank application you must run it from vRA appliance.

Whilst running it from Windows I received an error like below:


Well, my recommendation is to copy CloudClient into vRA appliance and run it using

Before you will be ready to import Dukes Bank you need to download the package using following command:

#wget –no-check-certificate https://YOUR_vRA_URL:5480/blueprints/dukesbankappforv

Then you could copy it to /tmp for easier navigation.


When you have the package it is hight time to run CloudClient and connect to vRA using following command:

vra login userpass –user tenant_admin_username –tenant your_tenant_name –server –password your_pass


After successful login you can validate and import the package.

To validate use the following command with dry-run:

vra content import –path / –dry-run true –resolution OVERWRITE

NOTE! Pay attention to capital letters, it is case sensitive.

To import the package change the argument of dry-run to false:

vra content import –path / –dry-run false –resolution OVERWRITE


And that is it, the first step to deploy sample blueprints is done. You can validate that these packages are imported by from your vRA console. You need to log in as a user with software and infrastructure architect privileges. The Dukes Bank blueprints and software components on the Design > Blueprints tab and the Design > Software Components tab.



vRealize Automation 7 Installation – minimal deployment

vRealize Automation 7 Installation – minimal deployment

One might find it quite difficult to install new product for the first time. Even though installing previous version in the past (or particularly because of that!) That’s due to changes in requirements or event different structures of wizard form which requires information in different format. E.g domain administator accound in one version is required in administrator@domain.local format whils in other installation it accepts only domain\administrator format.

Thanks to that I’m going to provide the list of basic steps to install vRealize Automation 7 in minimal deployment.

I assume that you have successfully deployed the vRA appliance and prepared IaaS VM.

  1. I suggest to perform the initial configuration from IaaS VM which will be helpful during IaaS components installation during the process. After accessing the vRA appliance console at port 5480 providing default password, the wizard will start. At this stage you can choose the deployment type. Below you can see description of enterprise deployment. I will choose minimal deployment for now, though. It’s

vrainstall2 vrainstall3

2. Now it’s high time to prepare IaaS server for installation of IaaS components. In vRA 7.x it is much more simplier and faster process. You simply need to install the agent to let the wizard  discover the server and perform necessary steps then.vrainstall4

3. Here you can see that the server is discovered and you can move forward.vrainstall5

4. Next step is to check all the prerequisities and fix them if necessary.vrainstall6

5. Here you can see that there is a lot work to do on a freshly  installed Windows Server.vrainstall7

6. Furtunatelly the wizard will do the job by itself. That’s the time for short break 😉 It takes approximately 15 minutes to perform all steps.vrainstall87. When all tasks are done you can re-run the verification script to confirm that everything is fine and move to the next step.


8. Provide the FQDN of vRA VM.vrainstall10

9. Here you are going to create a password which will be used by the system administrator account.


10. Next step is to provide IaaS information, and here is the time to use domain\username format for IaaS Administrator account which should have local admin rights assigned.vrainstall12

11. Here you are going to provide information about the database server. I highly recommend to create new database. Keep in mind that IaaS administrator name which you provided in the previous step must have Sysadmin rights on Database Server. Without that the process will go forward. It will fail during the ending installation step, though. 

12. For minimal or PoC deployment you can simply leave default values here.vrainstall15

13. The same as previous steps, leave it without changing. Just note the exact agent name which will be required during endpoint creation.vrainstall16

14. Provide the information for vRA self-signed certificates, untill you want to use custom ones.vrainstall17

15.  Provide the information for Web self-signed certificates, untill you want to use custom ones.


16. Provide information for Manager service certificate.vrainstall19

17. Run the validation which might take about 10 minutes.

18. Now it’s the time for some kind of backup in case something went wrong. I suggest to take snapshot of IaaS server just in case. Even though validation stage was completed successfully there are some issues which could happen during installation. (I’ve faced a failed installation due to lack of appropriate database permissions)vrainstall22

19. Next just start the installation.
vrainstall2320. If you didn’t miss anything your installation should be successfull 🙂

21. Next you should provide the license key.vrainstall26

22. Deselect the VMware CEIP agreement checkbox.vrainstall27

23. You can also provide the password for initial config content. It’s expecially usefull in case of PoC installation. By clicking Create Initial Content button a blueprint for default automation on basic vRA configuration will be created and published in default tenant service catalog.


24. After that you can will see the installation confirmation. Now you can start the play and begin the jurney with you vRA!

Howto – Using Gmail as an Email server in vRalize Automation

Howto – Using Gmail as an Email server in vRalize Automation

Sometimes it is not possible to use corporation e-mail or deploy dedicated e-mail server expecially when it comes to a lab environment (and you are a little bit lazy like me to do it ;)). A workaround which I found is to configure my personal/fictional accounts profided by Gmail. It is more than enough in case you just want to see how notification or approval workflows work. It might not be enough if you want to deploy a little big bigger deployent with a few Business Groups and users, though. Of course there are plenty of other ways or small mail servers which you can deploy in a few minutes. I find gmail much more intuitive, though.

Anyway I’m going to show you how should Inbound and Outbound servers configurations look like.

Keep in mind the the outboud server is used to send notifications from vRA to users/managers etc. Inbound server is used to receive special kinds of notification by vRA from users. For instance when you are a Business Group Manager and you want to approve a request via e-mail without opening you vRA portal you can simply answer to the e-mail notification you received by clicking the hyperlink provided in that message. In this case you need to Inbound server configured.

Outboud Email configuration:


Inbound Email configuration:



Note. Be aware that you have to change restiction policy on you Gmail account – you will receive an e-mail with detailed steps displaying the setting to change it after you click Test Connection in vRA’s e-mail configuration window.