Part-4: Enable Multi-Tenancy for vRealize Automation 8 Deployment

Featured

In the previous post we talked about Scaling out our newly deployed vIDM Deployment using vRealize Suite Lifecycle Manager. In this post we will take you through the process of Enabling Multi-Tenancy in vRealize Automation 8 Deployment.

Part-1: Configure Load Balancer for vRA 8 and vIDM
Part-2: Deploy vRSLCM, vRA and vIDM Appliances using Easy Installer
Part-3: Scale-Out VMware Identity Manager Deployment
Part-4: Enable Multi-Tenancy for vRealize Automation 8 Deployment

Part-4: Enable Multi-Tenancy for vRealize Automation 8 Deployment

Before we start with Enabling Multi-Tenancy ensure that you have generated and applied VMware Identity Manager and vRealize Automation Certificates using the process shared in the previous post Part-3: Scale-Out VMware Identity Manager Deployment.

The following steps in this final Blog of this Blog series will help us in Enabling Multi-Tenancy and will create 2 tenants for vRealize Automation 8.X Deployment:

1. Before we begin ensure that you have taken snapshot of all the Appliances and you have added your Active Directory under Directory Management in vRealize Suite Lifecycle Manager.

2. We can enable Multi-Tenancy under Tenant Management section of Identity and Tenant Management in vRealize Suite Lifecycle Manager:

vRealize Suite Lifecycle Manager – My Services Screen

3. We will observe a page with 4 recommendations to ensure an easy and error free tenancy experience. Click on ENABLE TENANCY.

Enable Tenancy – Tenant Management Screen

3. Ensure that you have taken Snapshots for all the Appliances and Trigger an Inventory Sync before clicking on Proceed.

Enable Tenancy – Snapshot Warning & Inventory Sync Screen

4. On the next screen we will have to supply the name of our default tenant which is tenant in our case and click on ENABLE TENANCY.

Enable Tenancy – Master Tenant Screen

5. The request will go through 6 steps including the Step 6 of Initialize vRealize Automation cluster which Stops and Starts vRealize Automation services.

Enable Tenancy – Request Details Screen

6. Once we have successfully Enabled Tenancy, we can go back to Tenant Management in Identity and Tenant Management to ADD TENANT.

Add Tenant – Tenant Management Screen

7. Input the Tenant Name as tenant1 and supply the rest of the details for your tenant.

Add Tenant – Tenant Details Screen

8. We can copy the Directory from our Default tenant to the new tenant by supplying the Bind DN and Password or Copy the Directory to new tenant later on. For LCM to copy a Directory to a new tenant, the Directory has to be mapped to the Default tenant.

Add Tenant – Directory Details Screen

9. Select your vRA Environment. There is a reminder there on this screen to ensure that you have created the Certificates and have applied them to vRA Environment.

Add Tenant – Select Environment Screen

10. Run the Precheck and ensure that status reports Successful on completion.

Add Tenant – Run Precheck Screen

11. Review the details on the Summary screen and click CREATE TENANT.

12. The process of creating a new Tenant takes around 2 mins and after successful creation of new Tenant we can see our new Tenant listed under Tenant Management in Identity and Tenant Management section of vRealize Suite Lifecycle Manager.

Tenant Management – Tenant List Screen

With that we have come to the end of this 4 Blog series of Deploying and Configuring a Clustered vRealize Automation 8 Environment which is Highly-Available, Clustered, Distributed & Production ready with the capability of Multi-Tenancy.

Part-3: Scale-Out VMware Identity Manager Deployment

Featured

In the previous post we talked about Deploying vRSLCM, vRA and vIDM Appliances using Easy Installer. In this post we will take you through the process of Expanding VMware Identity Manager Deployment from a Single-Node to a 3-Node Environment.

Part-1: Configure Load Balancer for vRA 8 and vIDM
Part-2: Deploy vRSLCM, vRA and vIDM Appliances using Easy Installer
Part-3: Scale-Out VMware Identity Manager Deployment
Part-4: Enable Multi-Tenancy for vRealize Automation 8 Deployment

Part-3: Scale-Out VMware Identity Manager Deployment

Before we start expanding VMware Identity Manager Deployment we need to generate Certificates for vRealize Automation and VMware Identity Manager Appliances. We will be generating SAN Certificates in this post using vRealize Suite Lifecycle Manager but you can also apply Custom CA Signed certificates by Importing the Certificates in vRealize Suite Lifecycle Manager.

The following steps will help in generating and applying the new Certificates with the help of vRealize Suite Lifecycle Manager:

1. We can find the existing Certificates and Generate new Certificates under Locker > Certificates section in vRLSCM:

vRealize Suite Lifecycle Manager Certificates

2. If you want to use Custom CA Certificates, you can click on Generate CSR and fill the details and send it to your CA for generating the Certificates but in this post we will be using the Generate option to Generate SSL Certificates using vRSLCM. Click on Generate and fill in the following details for vIDM Certificate:

Name: MyCloud-vIDM Certificate
Common Name (CN): vidm
Organization (O): MyCloud
Organization Unit (OU): Delhi
Country Code (C): IN
Locality (L): Delhi
State (ST): Delhi
Key Length: 2048
Server/Domain/Hostname: vidm1.mycloud.lab, vidm2.mycloud.lab, vidm3.mycloud.lab, vidm.mycloud.lab, tenant.mycloud.lab, tenant1.mycloud.lab
IP Address: 192.168.10.17, 192.168.10.18, 192.168.10.19, 192.168.10.16, 192.168.10.22

Generating new Certificate using vRSLCM

3. We need to Generate another Certificate for vRA Appliances:

Name: MyCloud-vRA Certificate
Common Name (CN): vra
Organization (O): MyCloud
Organization Unit (OU): Delhi
Country Code (C): IN
Locality (L): Delhi
State (ST): Delhi
Key Length: 2048
Server/Domain/Hostname: vra.mycloud.lab, vra1.mycloud.lab, vra2.mycloud.lab, vra3.mycloud.lab, tenant1.vra.mycloud.lab
IP Address: 192.168.10.12, 192.168.10.13, 192.168.10.14, 192.168.10.15

Note: If you are not very concerned about the certificates and would like to use a wildcard certificate, you can simply generate a wildcard certificate *.mycloud.lab

4. Once we have generated the Certificates, we will have to Import the MyCloud-vIDM Certificate in NSX-LB. We mentioned this Step as the last Step in Part-1: Configure Load Balancer for vRA 8 and vIDM of this Blog Series.

Import vIDM Certificate to NSX-LB

4. We will login to vRealize Suite Lifecycle Manager, under Lifecycle Operations section we need to go to globalenvironment & MyCloud-VRA8 Environment. Select Replace Certificate and apply the respective Certificates to each solution.

Replace vIDM and vRA Environment Certificates

5. Once we have successfully applied the newly Generated Certificates, we will proceed with the Actual Task at hand which is to expand our VMware Identity Manager Deployment from 1-Node to 3-Node which will make our environment truly Production Ready and Highly-Available. Now we need to go into globalenvironment under Environments and click on Add Components.

Adding Secondary Nodes to vIDM Environment

6. Please ensure that you have taken snapshots of your vIDM and vRA Appliances before proceeding, Trigger Inventory Sync, check the Checkbox which ensures that VMware Identity Manager cluster is Healthy and click Proceed.

Snapshot and vIDM Health Warning Screen

7. In Infrastructure section Select the Target vCenter Server, Cluster, Folder, Network and Datastore where you would like to Host the Secondary VMware Identity Manager Appliances. You can also enable Thin Disk Mode for the Storage of these Appliances.

Target Infrastructure for Secondary vIDM Nodes

8. Network Section should already have the details of Default Gateway, Netmask, Domain Name, Domain Search Path and DNS Servers.

Default Gateway: 192.168.10.1
Netmask: 255.255.255.0
Domain Name: mycloud.lab
Domain Search Path: mycloud.lab
DNS1 Server: 192.168.10.50
DNS2 Server: 192.168.10.51

Network Configuration for Secondary vIDM Nodes

9. Under Configuration section click on + next to Components and Select VMware Identity Manager Secondary Node. Repeat the process to add another Secondary Node to VMware Identity Manager Deployment and fill in the following details:

Cluster VIP FQDN: vidm.mycloud.lab
Database IP Address: 192.168.10.20
VIDM3 VM Name: VIDM3
VIDM3 FQDN: vidm3.mycloud.lab
VIDM3 IP Address: 192.168.10.19
VIDM2 VM Name: VIDM2
VIDM2 FQDN: vidm2.mycloud.lab
VIDM2 IPAddress: 192.168.10.18

Cluster and Secondary Node IP Details for vIDM

10. Click on RUN PRECHECK and System will run multiple tests against the Entered Data, Infrastructure and VMware Identity Manager Configuration.

Run Precheck Screen
Re-Run Precheck and Download Report Screen

11. Once all Pre-Checks have Passed, Review all the details on Summary screen and click Submit.

Scale-Out Identity Manager Request Summary Screen

12. Once you click Submit, vRSLCM goes through Stages 1 to 16 for Expanding VMware Identity Manager Deployment from 1-Node to 3-Nodes.

vIDM Scale-Out Task Screen

The entire process of Expanding VMware Identity Manager Deployment took us around 1 hour and 45 mins on a Production Grade Hardware right from Generating new Certificates to Deploying and Configuring Secondary VMware Identity Manager Nodes. In the next and final part of this Blog series Part-4: Enable Multi-Tenancy for vRealize Automation 8 Deployment, we will discuss the process of Enabling Multi-Tenancy for your newly Deployed vRealize Automation 8 setup.

Understanding Nutanix Cloud Infrastructure

Featured

Nutanix Cloud Infrastructure is the Hyperconverged Infrastructure which brings together the Virtual Compute, Storage and Networking of the physical nodes into a single resource pool of the cluster which can consumed by applications hosted on top of it.

Hyperconverged Infrastructure brings the power of simplicity by providing a single console to manage your computer, storage and networking. HCI also enables Enterprises to manage their Infrastructure and utilise their Resources more efficiently.

Components of Nutanix Cloud Infrastructure includes:

  1. Acropolis Hypervisor (AHV): Acropolis Hypervisor is Nutanix’s Type-1 Hypervisor installed on Bare Metal on-prem Hosts or on the Bare Metal Instances of Public Clouds to deliver the Virtualization capabilities.
  2. Acropolis Operating System (AOS): Acropolis Operating System (AOS) is the software which runs inside the Controller Nodes (CVM) of Nutanix and delivers the storage capabilities
  3. Prism: Prism is the Management software which provides the capabilities of managing an individual cluster using Prism Element UI and the functionality of managing multiple clusters using Prism Central UI.
  4. Flow Network Security (FNS): Flow Network Security is the Network Security stack which helps Enterprises to secure their network by enhancing Application security and protecting the user workload
  5. Disaster Recovery: Nutanix Disaster Recovery which was formerly known as Leap delivers the Synchronous, NearSync and Asynchronous replication capabilities for the workload to protect from site failures
  6. Lifecycle Manager (LCM): The capabilities of managing the updates and upgrades of the Hyperconverged Infrastructure & for the HW Firmware is delivered using Lifecycle Manager.
  7. Nutanix Kubernetes Enginer (NKE): Nutanix Kubernetes Engine is a kubernetes Management Platform which provides the capabilities of provisioning Kubernetes upstream conformant clusters and to manage the lifecycle of these K8s clusters.
  8. Nutanix Unified Storage (NUS): Nutanix Unifies Storage is responsible for providing highly scalable enterprise level unified storage platform which can deliver Block, File and Object Storage.

Nutanix Cloud Infrastructure has its own SKU of Software Licenses which can be applied to the Nutanix environment with respective editions to leverage the above mentioned features.

In the upcoming blogs we’ll talk about each of these Nutanix Cloud Infrastructure (NCI) components in greater details along with demos. Happy Learning!

Nutanix

Featured

Nutanix is one of the leaders in cloud software which helps their customers in building Hybrid Multi-Cloud. Nutanix was founded in the year 2009 and as per the latest public data available, Nutanix is serving around 25000 customers across the globe.

Nutanix is based on Hyperconverged Infrastructure Technology which delivers services like virtualisation, software defined storage, software defined networking, security, database management and Kubernetes Management.

In this series of Blogs we’ll cover some of the key features and functionalities offered by Nutanix Cloud Platform. On a High level, Nutanix Cloud Platform Comprises of two components: Nutanix Cloud Infrastructure and Nutanix Cloud Platform. Nutanix Cloud Platform delivers Hybrid Multi-Cloud capabilities through a unified Control Plane. We’ll talk about some of the key components of Nutanix Cloud Platform and we’ll also cover some of the How-To Blogs on Nutanix Platform. Stay Tuned!

Nutanix Cloud Platform

Part-2: Deploy vRSLCM, vRA and vIDM Appliances using Easy Installer

Featured

In the previous post we talked about Configuring Load Balancer for vRealize Automation 8 and VMware Identity Manager in a NSX-V environment. In this post we will take you through the process of Deploying vRealize Lifecycle Manager, Clustered vRealize Automation Appliances and VMware Identity Manager appliance

Part-1: Configure Load Balancer for vRA 8 and vIDM
Part-2: Deploy vRSLCM, vRA and vIDM Appliances using Easy Installer
Part-3: Scale-Out VMware Identity Manager Deployment
Part-4: Enable Multi-Tenancy for vRealize Automation 8 Deployment

Part-2: Deploy vRSLCM, vRA and vIDM Appliances using Easy Installer

Before we start deploying the new vRSLCM, vIDM and vRA Appliances below are some of the considerations which need to make sure that are in place:

  1. Review System Requirements for vRealize Automation 8
  2. Download vRealize Suite Lifecycle Manager 8 Easy Installer
  3. Complete Load Balancer Configuration
  4. Ensure that all DNS Records and IP Reservations are in place
  5. Keep DNS server and NTP server details handy

Now we re ready to deploy to deploy our new appliances, the steps to deploy vRSLCM, vRA and vIDM appliances are as follows:

1. Mount the Easy Installer ISO and Launch installer.exe located under F:\vrlcm-ui-installer\win32\installer.exe

vRealize Easy Installer Launch Screen

2. Please go through the Introduction and Accept the End User License Agreement. Click Next

End User License Agreement Screen

3. Enter the Appliance Deployment Target details like vCenter Server Hostname, Administrator Username and Password.

Appliance Deployment Target Screen

4. Select a Target Location, Target Cluster and Datastore.

Select a Target Location Screen
Select a Target Compute Resource Screen
Select a Destination Storage Location Screen

6. Enter the details of Network Configuration which includes Target Network, IP Assignment Type, Subnet Mask, Default Gateway, DNS Servers, Domain Name and NTP Servers.

Network: DC_MGMT_VLAN100
IP Assignment: static
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.10.1
DNS Servers: 192.168.10.50, 192.168.10.51
Domain Name: mycloud.lab
Provide NTP Server for the appliance: 192.168.10.70,192.168.10.71

Network Configuration Screen

7. Enter your Password. This password will be used for vRSLCM admin & root account, vRA root account, vIDM admin, sshuser, root user and default configuration user.

Password Configuration Screen

8. Enter Virtual Machine name, IP Address, FQDN, Datacenter Name and vCenter Name for vRealize Suite Lifecycle Manager. Set Increase Disk Size in GB to 20 and Leave FIPS Mode Compliance to deafult.

Virtual Machine Name: VRSLCM
IP Address: 192.168.10.11
Hostname: vrslcm.mycloud.lab
Data Center Name: MYCLOD-DC
vCenter Name: MYCLOUD-VC
Increase Disk Size in GB: 20
FIPS Mode Compliance: Enabled

Lifecycle Manager Appliance Configuration Screen

9. In Identity Manager Configuration, we will initially configure a Single Node VMware Identity Manager deployment which will be expanded to a clustered deployment in next blog in this series. Select Install New VMware Identity Manager and Enter the details of Virtual Machine Name, IP Address, FQDN, Default Configuration Admin, E-mail Address and Node size as per your environment’s requirement. Tick Sync Group Members to the Directory When Adding Group checkbox.

Virtual Machine Name: VIDM1
IP Address: 192.168.10.17
Hostname: vidm1.mycloud.lab
Default Configuration Admin: configadmin
Default Configuration Email: configadmin@vsphere.local
Node Size: Medium
Sync Group Members to the Directory When Adding Group: Enabled

Identity Manager Appliance Configuration Screen

10 a. Under vRealize Automation Configuration section select Clustered Deployment. Enter vRealize Automation Environment Name, License Key, Turn Off FIPS Compliance Mode and Select the Node size.

vRA Environment Name: MYCLOUD-VRA8
License Key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
FIPS Compliance Mode: Disabled
Node Size: Medium

vRealize Automation Configuration – Clustered Deployment Screen

10 b. Enter vRealize Automation Load Balancer IP Address, Load Balancer FQDN and leave SSL terminated at Load-Balancer unchecked. In the vRealize Automation Primary Node Details section, enter Virtual Machine Name, IP Address and FQDN for the vRA Primary Node.

Load Balancer IP: 192.168.10.12
Load Balancer Hostname: vra.mycloud.lab
SSL terminated at Load Balancer: Disabled

vRealize Automation Configuration – Primary Node Details

10 c. Enter vRealize Automation Secondary Node-1 and Secondary Node-2 Details, Virtual Machine Name, IP Address and FQDN. Leave Advanced Configuration for vRealize Automation to default.

vRealize Automation Node Details:
Primary Node Virtual Machine Name: VRA1
IP Address: 192.168.10.13
Hostname: vra1.mycloud.lab
Secondary Node-1 Virtual Machine Name: VRA2
IP Address: 192.168.10.14
Hostname: vra2.mycloud.lab
Secondary Node-2 Virtual Machine Name: VRA3
IP Address: 192.168.10.15
Hostname: vra3.mycloud.lab
Internal Pods and Services Configuration: Use Default

vRealize Automation Configuration – Secondary Node-1 and Secondary Node-2 Details

11. Review Configuration details on the Summary screen and click Submit.

vRealize Easy Installer Summary Screen

12. Installation Process goes through 5 stages: Initializing, Installing vRSLCM, Moving Binaries, Initiating install vIDM and vRA and Finish vRA Install.

Installation Process Screen

13. Once the Installation Process has passed the stage of vRSLCM Installation, we can login to vRSLCM UI using the username as admin@local and Password which we entered during the Password Configuration stage.

Installation Process – vRSLCM Services Started Screen

14. In vRealize Suite Lifecycle Manager select Lifecycle Operations under My Services and then to the Requests section. You’ll find 2 requests: globalenvironment – Create Environment (IDM Installation) and MYCLOUD-VRA8 – Create Environment (vRA Installation).

vRealize Suite Lifecycle Manager – My Services Screen

15. VMware Identity Manager Installation Request goes through 8 Stages before your vIDM deployment is ready.

globalenvironment – Create Environment Request Screen

16. vRealize Automation Installation Request goes through 13 Stages before your vRealize Automation Deployment is setup and ready to use. Our vRealize Automation Installation failed twice during the setup process but the process was intelligent enough to provide intuitive insights into error and to allow us to resume from failed stage.

MYCLOUD-VRA8 – Create Environment Screen

The entire Deployment and Setup process took us around 1 hour and 35 mins and we were using Enterprise Grade Hardware for this setup. In the next part of this series Part-3: Scale-Out VMware Identity Manager Deployment, we will discuss the process of Expanding vIDM Environment by Adding Two Secondary Nodes.

Part-1: Deploy a Clustered vRealize Automation 8

Featured

In this series of blog posts we will talk about the steps involved in deploying a Clustered Production-Ready vRealize Automation Environment enabled with Multi-Tenancy. We have divided this series into 4 blog posts which will be as follows:

Part-1: Configure Load Balancer for vRA 8 and vIDM
Part-2: Deploy vRSLCM, vRA and vIDM Appliances using Easy Installer
Part-3: Scale-Out VMware Identity Manager Deployment
Part-4: Enable Multi-Tenancy for vRealize Automation 8 Deployment

VMware solutions which we will deploy in this 4 – Blog series are as follows:

1. vRealize Suite Lifecycle Manager 8
2. VMware Identity Manager 3.3.4
3. vRealize Automation 8

Part-1: Configure Load Balancer for vRealize Automation 8 and VMware Identity Manager

In this post we are going to talk about one of the Primary requirement to deploy a clustered vRealize Automation deployment with Multi-Tenancy, which is, Setting up your Load Balancer. We are using NSX-V for our setup but you can use NSX-T, F-5 or Citrix Netscaler.
We are assuming that you already have your Active Directory and DNS configured.

Before we begin setting up our Load Balancer we need to perform the following pre-requisites:

  1. We need 11 IP Addresses and 12 DNS entries.
    1. vRSLCM (A-Type Record) – 1 IP Address and DNS Record
      vrslcm.mycloud.lab – 192.168.10.11
    2. vRA- 3 IP Addresses for vRA Appliances and 1 vRA-LB IP with DNS Records
      vra.mycloud.lab (A-Type Record) – 192.168.10.12 (vRA LB IP Address)
      vra1.mycloud.lab (A-Type Record) – 192.168.10.13
      vra2.mycloud.lab (A-Type Record) – 192.168.10.14
      vra3.mycloud.lab (A-Type Record) – 192.168.10.15
    3. vIDM – 3 IP Addresses for vIDM Appliances and 1 vIDM-LB IP with DNS Records
      We will also need 1 IP Address for vIDM Postgres replication
      vidm.mycloud.lab (A-Type Record) – 192.168.10.16 (vIDM LB IP Address)
      vidm1.mycloud.lab (A-Type Record) – 192.168.10.17
      vidm2.mycloud.lab (A-Type Record) – 192.168.10.18
      vidm3.mycloud.lab (A-Type Record) – 192.168.10.19
      Internal vIDM Postgres IP Address – 192.168.10.20
    4. Load Balancer Interface IP Address – 192.168.10.21
    5. DNS Entry for Default Tenant
      tenant.mycloud.lab (A-Type Record) – 192.168.10.16
      tenant1.mycloud.lab (A-Type Record) – 192.168.10.16
    6. Multi-Tenancy DNS Entries:
      tenant1.vra.mycloud.lab (CNAME Record) – vra.mycloud.lab

Now we re ready to configure our Load Balancer in NSX-V, the steps to configure NSX-V LB are as follows:

1. Deploy a new NSX-V Edge Services Gateway with High Availability.

NSX Edge Services Gateway Deployment – Basic Details Screen

2. Enter the Admin Password for your Edge Services Gateway and enable SSH.

NSX Edge Services Gateway Deployment – Settings Screen

3. We have selected the Appliance size as Large for our Edge Service Gateway. You can select the Appliance size as per your requirement.

NSX Edge Services Gateway Deployment – Deployment Configuration Screen

4. Specify the placement for your Edge Services Gateway Appliances by clicking on Add Edge Appliance VM.

NSX Edge Services Gateway Deployment – Edge Placement Screen

5. Now we need configure an Interface to the uplink for Edge Services Gateway.

NSX Edge Services Gateway Deployment – Configure Interfaces Screen

6. Enter the Name for the Interface, Select the Port Group and enter the Primary and Secondary IP Addresses. Primary IP Address should be your Load Balancer Interface IP and Secondary IP Addresses should be the Load Balancer IPs for your vRA & vIDM.

NSX Edge Services Gateway Deployment – Configure Subnets for Interface Screen

7. Enter the Default Gateway IP for your Interface.

NSX Edge Services Gateway Deployment – Deafult Gateway Screen

8. Keep the Firewall Deafault Policy values to as is.

NSX Edge Services Gateway Deployment – Firewall Deafult Policy Screen

9. Leave the High Availability values to default and click Next.

NSX Edge Services Gateway Deployment – High Availability Screen

10. Review your configuration and click Finish.

NSX Edge Services Gateway Deployment – Review Configuration Screen

Once your Edge Services Gateway has been deployed, we will proceed with the rest of the configuration.

1. Stop the Firewall for your Edge Services Gateway.

NSX Edge – Stop NSX Edge Firewall Screen

2. Enable Load Balancer and Logging on NSX Edge.

NSX Edge – Load Balancer Global Configuration Screen

3. Create 2 Application Profiles, One for vRealize Automation8 and one for VMware Identity Manager with type SSL Passthrough.

NSX Edge – Load Balancer Application Profiles Screen
NSX Edge – Application Profile for vRealize Automation Screen
NSX Edge – Application Profile for VMware Identity Manager Screen

4. Create 2 Service Monitors, One for vRealize Automation and one for VMware Identity Manager.Create 2 Service Monitors, One for vRealize Automation and one for VMware Identity Manager.

vRealize Automation Service Monitor:
Name: vRealize Automation8
Interval: 3
Timeout: 10
Max Retries: 3
Type: HTTP
Expected: 200
Method: GET
URL: /health

NSX Edge – Service Monitor for vRealize Automation Screen

VMware Identity Manager Service Monitor:
Name: VMware Identity Manager
Interval: 3
Timeout: 10
Max Retries: 3
Type: HTTPS
Expected: 200
Method: GET
URL: /SAAS/API/1.0/REST/system/health/heartbeat

NSX Edge – Service Monitor for VMware Identity Manager Screen

5. Now we will create 2 Pools of Member Servers, One for vRealize Automation and one for VMware Identity Manager.

vRealize Automation Pool:
Name: pool_vra8
Algorith: LEASTCONN
Monitors: vRealize Automation8

NSX Edge – Pool Configuration for vRealize Automation Screen

vRealize Automation Pool Members:
Members: vra1, vra2 and vra3
IP Addresses: 192.168.10.13, 192.168.10.14 and 192.168.10.15
Monitor Port: 8008
Port: 443

NSX Edge – vRealize Automation Pool Members Screen

VMware Identity Manager Pool:
Name: pool_vidm
Algorith: LEASTCONN
Monitors: VMware Identity Manager

NSX Edge – VMware Identity Manager Pool Configuration Screen

VMware Identity Manager Pool Members:
Members: vidm1, vidm2 and vidm3
IP Addresses: 192.168.10.17, 192.168.10.18 and 192.168.10.19
Monitor Port: 443
Port: 443

NSX Edge – VMware Identity Manager Pool Members Screen

6. The last step in the process of setting up our Load Balancer is to create 2 Virtual Servers, again one for vRealize Automation and one for VMware Identity Manager.

vRealize Automation Virtual Server:
Virtual Server: Enable
Acceleration: Disable
Application Profile: vRealize Automation8
Name: vs_vra8-va
IP Address: 192.168.10.12
Protocol: HTTPS
Default Pool: pool_vra8

NSX Edge – vRealize Automation Virtual Server Screen

VMware Identity Manager Virtual Server:
Virtual Server: Enable
Acceleration: Disable
Application Profile: VMware Identity Manager
Name: vs_vidm-va
IP Address: 192.168.10.16
Protocol: HTTPS
Default Pool: pool_vidm

NSX Edge – VMware Identity Manager Virtual Server Screen

There is actually one more step where we need to import a Certificate for the Load Balancer in NSX Edge Services Gateway but we will discuss about that step in Part-3: Scale-Out VMware Identity Manager Deployment of this series. For steps related to NSX-T, F5 Big-IP and Citrix Netscaler configurations please visit vRealize Automation 8 Load Balancing Guide.

In Part-2 of this Blog post series Part-2: Deploy vRSLCM, vRA and vIDM Appliances using Easy Installer, we will discuss the process to deploy vRealize Suite Lifecycle Manager 8, vRealize Automation 8 and VMware Identity Manager Appliances using Easy Installer. Stay Tuned.

Export LUN IDs with Path Selection Policy

Featured

In this post we are sharing a PowerCLI script that we used to export a list of LUNs attached to ESXi hosts in a cluster along with the details of Path Selection Policy selected for the LUN and CommandsToSwitchPath parameter set for the LUNs.

Script was tested on below versions:

  • PowerCLI version 11.5.0 build 14912921
  • vSphere 6.7U3

Script:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
$cred = Get-Credential
Connect-VIServer vCenter_IP/FQDN -Credential $cred

$getCluster = Get-Cluster -Name "Cluster_Name"
$getESXis = $getCluster | Get-VMHost
$printluns=@()

foreach ($getESXi in $getESXis)
{
    $getLUNsforESXi = Get-VMhost $getESXi | Get-ScsiLun -LunType disk | Select VMHost, CanonicalName, MultipathPolicy, CommandsToSwitchPath
    $printluns = $printluns + $getLUNsforESXi
}

$printluns | Export-Csv C:\users\Administrator\Desktop\PathtoSaveFile.csv -NoTypeInformation 

Disconnect-VIServer -Confirm:$false

Just replace the vCenter_Server_IP_Address/FQDN, Cluster_Name and Path of CSV File and run the script to generate a report of LUNs mapped to all ESXi hosts in a vSphere cluster in your environment. BOOM!!

Happy Scripting!!

Event Subscriptions in vRealize Automation 8

Featured

In vRealize Automation 8 the process of creating an Event Subscription has changed a little bit. In vRealize Automation 8 there are 40 Event Topics already defined under Extensibility Library in Cloud Assembly.

Event topics which you can choose from while creating an Event Subscription vRealize Automation are as follows:

Blueprint configuration                                             EventLog            
Blueprint version configuration                               Kubernetes cluster allocation
Compute allocation                                                    Kubernetes cluster post provision
Compute post provision                                            Kubernetes cluster post removal
Compute post removal                                              Kubernetes cluster provision
Compute provision                                                     Kubernetes cluster removal
Compute removal                                                       Load balancer post provision
Compute reservation                                                 Load balancer post removal
Deployment action completed                                 Load balancer provision
Deployment action requested                                  Load balancer removal
Deployment completed                                             Network Configure
Deployment onboarded                                            Network post provisioning
Deployment requested                                              Network post removal
Deployment resource action completed                Network provisioning
Deployment resource action requested                 Network removal
Deployment resource completed                            Project Lifecycle Event Topic
Deployment resource requested                             Security group post provision
Disk allocation                                                             Security group post removal
Disk post Removal                                                      Security group provision
Disk post resize                                                           Security group removal

In order to understand an Event topic review the Descripton, Topic ID, Blocakble and Schema of the Event Topic.

Compute provision Event Topic

If you want to create a Subscription for an Event Topic, just select the Event Topic and click on Subscribe, select the ABX Action or Workflow to trigger, select the Blocking of events and Subscription scope. Schema of an Event Topic can also be reviewed on this screen, Schema (Payload in the previous versions of vRealize Automation) of an Event Topic is a set of Properties which will be passed to Orchestrator when an event of this Topic is triggered.

Test Subscription for Compute provision Event Topic

Important Tip: If you are not sure about the Schema of an Event Topic, create a Blank Workflow with Input Variable of name “inputProperties” & Type “Properties” and Create a Test Subscription using this Blank Workflow. Name of the Input Variable is Important here, if you name it something else it will not receive the Properties from Cloud Assembly.

Schema Properties received by the Orchestrator Workflow

Did you notice that the Workflow ran twice? This is because i have Specified 2 Machine components in the Blueprint and the Workflow ran each time a Machine Component was provisioned for this Deployment request.

2 Workflow Runs for the Test Subscription

The names of the machine components in the Test Blueprint used for this illustration are “Primary_VM” and “Secondary_VM”.

Blueprint for which Event Subscription was triggered

There is one more important thing which you can specify while creating an Event Subscription using Event Topics, which is the Condition. Condition is something which you describe to filter out a specific Event from the list of Events which are triggered when a user requests for Services using Service Broker.

Condition to filter Events for an Event Topic

Condition can only be specified in Javascript Syntax in the current version of vRealize Automation. For Instance if I would like to trigger the same Test Workflow only for the Secondary_VM, i can specify a condition in the Test Subscription as event.data.blueprintId == ‘e9d2abc4-94fa-48f1-a1db-19a31510a375’ && event.data.componentId == ‘Secondary_VM’ Blueprint ID can be copied from one of the previous sample Workflow runs.

Sample Filter Condition for Events in Topic

This condition would ensure that the Workflow is triggered if the Blueprint requested has an id e9d2abc4-94fa-48f1-a1db-19a31510a375 and only for the component with id Secondary_VM. If you request a Deployment now using the same Blueprint, the Workflow will be triggered only once and that is for the Machine Component Secondary_VM.

Single Workflow Run for Secondary_VM Machine Component

Note: I noticed one typo in the examples provided for Condition statement in vRealize Automation 8, there is a space missing after event.data.blueprintId == and the actual id. I had to spend 15 mins figuring out why the event is not triggering a workflow, so make sure that the Syntax for the Condition is correct.

Bad Syntax for the Condition Statement Example

With that you are now ready to create Event Subscription in vRealize Automation 8. Enjoy!!

https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8549655389727719

VMware Aria Operations – Backup & Export Configuration

Featured

In this blog we have covered the 2 methods of taking Backup of your VMware Aria Operations (vRealize Operations Manager) configuration.

VMware Aria Operations introduced a feature called Content Management in version 8.2 back in October 2020.

Content Management helps the Customers to Backup and Export their configuration of VMware Aria Operations which can be further used to restore the configuration like Dashboards, Views, Report Templates, Supremetrics and a lot more in case you run into issues with the deployment.

We have covered two methods of taking a Backup and Export of VMware Aria Operations Configuration – First one, using the Content Management Tab under Administration in VMware Aria Operations UI and Second one, using a Python Script which makes use of the native APIs of Aria Operations.

Python script which we have developed has been tested on Python 3.10.10 version and Aria Operations 8.10 version. This script can also be scheduled as a Scheduled Task to take periodic configuration backups.

Method -1: Content Management Tab under Administration in VMware Aria Operations UI

Method -2: Python Script which uses native APIs of Aria Operations

#!/usr/local/bin python3

import requests, json, urllib3, datetime, time, os, zipfile, shutil

from requests.auth import HTTPBasicAuth
from datetime import datetime


urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

base_url = 'https://vrops80-weekly.cmbu.local/suite-api/api'
token_url = base_url + '/auth/token/acquire'
headers =  {"Content-Type":"application/json", "Accept":"application/json"}
body = {
    "username": "admin",
    "password": "VMware1!",
    "authSource": "local"
    }

token_api_response = requests.post(token_url, headers=headers, json=body, verify=False)

token_api_response = token_api_response.json()

vRealize_ops_token = token_api_response["token"]

print("vRealize Ops Token: " + vRealize_ops_token)

content_export_request_url = base_url + '/content/operations/export/'

headers = {"Content-Type":"application/json", "Accept":"application/json", "EncryptionPassword": "Aman@123456789", "Authorization": "vRealizeOpsToken " + vRealize_ops_token}

body = {
  "scope" : "CUSTOM",
  "contentTypes" : [ "DASHBOARDS", "VIEW_DEFINITIONS", "REPORT_DEFINITIONS", "REPORT_SCHEDULES", "CONFIG_FILES", "ALERT_DEFINITIONS", "SYMPTOM_DEFINITIONS", "RECOMMENDATION_DEFINITIONS",  "NOTIFICATION_RULES", "PAYLOAD_TEMPLATES", "POLICIES", "CUSTOM_GROUPS", "SUPER_METRICS", "COMPLIANCE_SCORECARDS", "AUTH_SOURCES", "USERS", "USER_GROUPS", "ROLES", "INTEGRATIONS", "HTTP_PROXIES", "OUTBOUND_SETTINGS", "COST_DRIVERS", "SDMP_CUSTOM_SERVICES", "SDMP_CUSTOM_APPLICATIONS", "DISCOVERY_RULES", "APP_DEF_ASSIGNMENTS", "CUSTOM_PROFILES", "GLOBAL_SETTINGS"  ],
  "Password" : "12345"
  }

content_export_response = requests.post(content_export_request_url, headers=headers, json=body, verify=False)

content_export_response = content_export_response.json()

print("Sleeping for 60 seconds")

time.sleep(60)

export_zip_url = base_url + '/content/operations/export/zip'

headers = {"Content-Type":"application/json", "Accept":"application/json", "Authorization": "vRealizeOpsToken " + vRealize_ops_token}

export_zip_response = requests.get(export_zip_url, headers=headers, verify=False)

current_datetime = datetime.now()
str_current_datetime = str(current_datetime)
file_name = "./vROpsContentBackup/" + str_current_datetime+".zip"
print(file_name)
with open(file_name, 'wb') as zipFile:
    zipFile.write(export_zip_response.content)

For the detailed process to Backup and Export VMware Aria Operations Configuration please watch our video:

I hope this blog was informative for you, stay tuned for our upcoming blogs. Happy Learning!!

#vmware #aria #operations #vROps #manager #content #management #public #private #hybrid #cloud #backup #export

Single Sign-On Configuration for VMware vRealize Suite

Featured

In vRealize Automation 8.X, Easy Installer deploys a vIDM appliance which is used for Authentication by vRealize Automation whether you choose a Standalone deployment or a Clustered deployment. As we already have an external vIDM appliance as part of our vRA 8.X deployment, we can use it for configuring Single Sign-On for VMware vRealize Suite products.

Single Sign-On configuration is supported in 7.X versions of vRealize Suite products as well but we need an external VMware Identity Manager which most of the customers do not deploy. vRealize Automation 7.X Appliances also include an embedded version of VMware Identity Manager, even though we can enable the UI for the embedded vIDM using the command vcac–vami horizon ui enable but there is no documentation suggesting that making changes directly to VMware Identity Manager is supported by VMware.

In this post we will discuss the process of configuring Single Sign-On for vRealize Suite 8.X version products. In this article I am assuming that an Active Directory domain has already been configured in VMware Identity Manager.

vRealize Automation:

1. Login to VMware Identity Manager and click on Web Apps under the Catalog section.

VMware Identity Manager Web Apps Section

2. Click on New to configure vRealize Automation Web Application Link.

Creating a New Web Application Link in Identity Manager

3. In the Name section enter vRealize Automation 8.X (vRA) and upload an Icon file for vRealize Automation.

vRealize Automation Web App Configuration

4. Leave the Category section blank and click Next.

5. In Authentication Type select Web Application Link and type https://vRA_FQDN/csp/gateway/portal/#/consumer in Target URL.

Target URL for vRealize Automation Web App

5. Click Next and then click Save.

6. Now the only task left is to assign this App to Active Directory users who already have access to vRealize Automation. Select the newly created Application and Click on Assign.

Assign vRealize Automation Web App to Users/Groups

5. Search the name of Users/User Groups to publish the App, select the Deployment type as Automatic and click Save.

Assign vRealize Automation Web App Enterprise Admins Group

6. Next time the user authenticates with vIDM and goes to User Portal, he/she will be able to see the newly published vRA 8.X Application.

Access VMware Identity Manager User Portal

7. Next time the user authenticates with vIDM and goes to User Portal, he/she will be able to see the newly published vRA 8.X Application.

Launch vRealize Automation Web App from vIDM Catalog

8. Once the user clicks on Open on this App, user will be authenticated & re-directed to vRealize Automation portal.

vRealize Log Insight:

1. Before publishing vRealize Log Insight as an App in VMware Identity Manager we need to configure vIDM as an Authentication Source in vRealize Log Insight and we need to obtain the Target URL.

2. Login to vRealize Log Insight. Click on Administration and Under Authentication enter the details of your vIDM.

Configure vRealize Log Insight to use VMware Identity Manager for Authentication

3. Provide access to VMware Identity Manager Users/User Groups in Administration section under Access Control > Users and Groups.

Access Control in vRealize Log Insight

4. In order to obtain the Target URL, logout from vRealize Log Insight & logout from vIDM and select System Domain.

5. Open vRealize Log Insight in a new Tab, select VMware Identity Manager from the Drop-down and click on Login via SSO.

vRealize Log Insight Target URL for VMware Identity Manager

6. You’ll be redirected to VMware Identity Manager for login. Copy the URL from the Address Bar of the browser. URL will look something like:
https://idm01.mydomain.lab/SAAS/auth/login?dest=https://idm01.mydomain.lab/SAAS/auth/oauth2/authorize?response_type%3Dcode%26client_id%3Dbabc6f64a70-2c7c-4c5a-867f-bc631327f5dc%26redirect_uri%3Dhttps://192.168.113.112/login&chainedauthMethods
=%5B%7B%212chainedAuthmethods%212:%5B%7B%22authMethoId%22:15,%212a
uthMethodOrder%22:13%7D%5D%7D,%7B%22chainedAuthmethods%22:%5B%7B%
22authMethoId%22:3,%22authMethodOrder%22:1%7D%5D%7D%5D&ttl=28800

Capture vRealize Log Insight Target URL for VMware Identity Manager

7. URL highlighted in red is our Target URL for vRealize Log Insight. Follow the same process as vRealize Automation App and publish vRealize Log Insight for users using the vRealize Log Insight Target URL.

8. Now the users should be able to launch vRealize Log Insight App from vIDM User Portal & Authenticate using vIDM Single Sign-On.

vRealize Operations Manager:

1. For vRealize Operations Manager we need to follow the process similar to vRealize Log Insight. Configure vIDM as Authentication Source, Grant permissions to vIDM Users/Groups in vROps & obtain the Target URL.

2. Login to vRealize Operations Manager as an Admin user. Click on Administration and Under Authentication Sources click Add. Select Source Type as VMware Identity Manager and enter the details of your vIDM Appliance.

Configure VMware Identity Manager as Authentication Source in vRealize Operations Manager

3. Provide access to VMware Identity Manager Users/Groups by Importing them in Administration section under Access > Access Control > User Accounts and User Groups.

Import Users/Groups from VMware Identity Manager for Access Control in vRealize Operations Manager

4. In order to obtain the Target URL, logout from vRealize Operations Manager & logout from vIDM and select System Domain.

5. Open vRealize Operations Manager in a new Tab, select VMware Identity Manager from the Drop-down and click REDIRECT.

vRealize Operations Manager Target URL for VMware Identity Manager

6. You’ll be redirected to VMware Identity Manager for login. Copy the URL from the Address Bar of the browser. URL will look something like:

https://idm01.mydomain.lab/SAAS/auth/login?dest=https://idm01.mydomain.lab/SAAS/auth/oauth2/authorize?response_type%3Dcode%26client_id%3D0246fe54-d0a5-42ff-b3c1-f3d144b64519%26redirect_uri%3Dhttps://10.11.12.13/ui/vidmClient/vidm/&chainedauth
Methods=%5B%7B%22chainedAuthmethods%22:%5B%7B%22authMethoId%22:15,%
22authMethodOrder%22:13%7D%5D%7D,%7B%22chainedAuthmethods%22:%5B%7
B%22authMethoId%22:3,%22authMethodOrder%22:1%7D%5D%7D%5D&ttl=28800

We are only interested in Client ID highlighted in RED in the above link.

Capture VMware Identity Manager Client ID for vRealize Operations Manager

7. Replace the details of the below URL with your environment details and you’ll get Target URL for vRealize Operations Manager.

https://idm01.mydomain.lab/SAAS/auth/oauth2/authorize?response_type=code&client_id=3D0246fe54-d0a5-42ff-b3c1-f3d144b64519&redirect_uri=https://idm_ip_address/ui/vidmClient/vidm/

8. Follow the same process as vRealize Automation App and publish vRealize Operations Manager App for users using the vRealize Operations Manager Target URL.

9. Now the users should be able to launch vRealize Operations Manager App from vIDM User Portal & Authenticate using vIDM Single Sign-On.

vRealize Suite Lifecycle Manager:

1. For vRealize Suite Lifecycle Manager the process is fairly easy. We just need to provide users access to vLCM under Identity and Tenant Management and publish the Target URL.

2. Login to vRealize Suite Lifecycle Manager as an Admin user. Click on dentity and Tenant Management.

Identity and Tenant Management in vRealize Suite Lifecycle Manager

3. In Directory Management section, click on Directories click Add Directory by selecting Active Directory over LDAP.

Add Active Directory in vRealize Suite Lifecycle Manager

4. The process of Adding the Active Directory is same as vRealize Automation 7.X.

Active Directory over LDAP configuration in vRealize Suite Lifecycle Manager

5. Once Active Directory has been configured, provide relevant permissions to Users/Groups under User Management section.

User Management in vRealize Suite Lifecycle Manager

6. Replace the details of the below URL with your environment details and you’ll get Target URL for vRealize Suite Lifecycle Manager.

http://lcm01.mydomain.lab/lcm/login/vidm

8. The process of publishing vRealize Suite Lifecycle Manager App for users using the vRealize Suite Lifecycle Manager Target URL remains the same.

Note: The current versions of vCenter Server do not support VMware Identity Manager as an Identity Provider. NSX-T does support Single Sign-On configuration using vIDM.
For more details on integrating NSX-T with IDM, check out this blog.

The final catalog of your VMware Identity Manager will have Web Apps for all 4 vRealize Suite Components. Enjoy!!

VMware Identity Manager Signle Sign-On User Catalog

Assign Custom Attributes to VMs

Featured

There was a requirement in one of the projects to assign Custom Attributes to multiple Virtual Machines hosted in a vSphere Environment. We wrote a PowerCLI script to Assign the Custom Attributes to Virtual Machines using a CSV file which had all the details of the Custom Attributes.

Requirements:

  • PowerCLI
  • PowerShell 5.1 or later

Script:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
$cred = Get-Credential
Connect-VIServer vCenter_Server_IP_Address/FQDN -Credential $cred
$files = Import-CSV "C:\Users\testuser\Desktop\CustomAttributes.csv"
foreach ($file in $files)
{
$vm = Get-VM -Name $file.VMName
$vm | Set-Annotation -CustomAttribute "AppName" -Value $file.AppName
$vm | Set-Annotation -CustomAttribute "Owner" -Value $file.Owner
$vm | Set-Annotation -CustomAttribute "AppDL" -Value $file.AppDL
$vm | Set-Annotation -CustomAttribute "Env" -Value $file.ENv
}

Disconnect-VIServer -Confirm:$false

Input CSV File:

CustomAttributes.csv

Just replace the vCenter_Server_IP_Address/FQDN and Path of CSV File and run the script to assign Custom Attributes to Virtual Machines in vSphere environment. BOOM!!

Happy Scripting!!

Part-1 VMware NSX – Network & Security Virtualization

Featured

In this series of blogs we will cover the architectural components of VMware NSX.VMware NSX is a Software Defined Network Virtualization and Security solution offered by VMware to support Virtual Machine and cloud native applications in an on-premise as well as VMware’s cloud hosted on hyperscaler environment.

VMware NSX provides complete set of Networking services like Routing, Switching, Firewalling, Loadbalancing and QoS. In this blog of VMware NSX we will cover NSX Architecture Components and in the following blogs we will talk about all these services in detail.

A typical Production NSX deployment comprises of NSX Manager Appliances and Transport Nodes. There are Planes which run across these 2 type of Nodes which are as follows:

Management Plane: Management Plane resides inside the NSX Manager Appliances. Management Plane is responsible for storing the desired configuration inside a database which is replicated across the 3 NSX Manager Appliances which run as 3 Virtual Machines.

Management Plane also acts as a User Interface as well as the entry point for the programmatic users.

Control Plane: Control Plane resides inside a NSX Controller element which also resides inside the NSX Manager Appliances with the latest releases of NSX. In the earlier releases of NSX, NSX Controllers used to reside inside separate Virtual Machines. Control Plane is responsible for pushing the configuration entered by the user using UI or APIs to the Data Plane.

Management Plane and Control Plane are bundled in a virtual machine called NSX Manager Appliance. NSX Manager Appliance is clustered into 3 Appliances for Production deployments to ensure High Availability.

Data Plane: Data Plane is responsible for performing stateless packet forwarding and the user data passes through the Data Plane. Data Plane comprises of Transport Nodes which can be an ESXi Host, Edge VM or a Bare Metal Server. KVM hosts were supported in the earlier NSX releases however with the latest release of NSX, KVM Hosts are no longer supported as a Transport Node.

Transport Nodes: A Transport Node is a Node which is prepared for NSX, runs the local control plane daemon and forwarding engines implementing NSX Data plane. A Transport Node can be an Edge VM, ESXi Host or a Bare Metal Server.

Edge Transport Node: NSX Edge Transport nodes are service appliances dedicated to running centralized network services that cannot be distributed to the hypervisors like North/South routing, load balancing, DHCP, VPN, NAT, etc. They can be instantiated as a bare metal appliance or in virtual machine form factor. They are grouped in one or several clusters. Each cluster is representing a pool of capacity.

Host Transport Node: Host Transport Nodes are ESXi Hypervisors which runs the distributed Network services. NSX used to support KVM as well as a Host Transport Node but in the latest releases support for KVM as a Host Transport Node has been withdrawn.

In the next blog, we will talk about the Distributed Routing in VMware NSX.

I hope this blog was informative for you, stay tuned for our upcoming blogs. Happy Learning!!

#vmware #nsx #sdn #network #networking #routing #switching #firewall #loadbalancer #manager #NAT #DHCP #VPN #cloud #private #public #ESXi #transport #node

Event Subscriptions in vRealize Automation 8

Featured

In vRealize Automation 8 the process of creating an Event Subscription has changed a little bit. In vRealize Automation 8 there are 40 Event Topics already defined under Extensibility Library in Cloud Assembly.

Event topics which you can choose from while creating an Event Subscription vRealize Automation are as follows:

Blueprint configuration                                             EventLog            
Blueprint version configuration                               Kubernetes cluster allocation
Compute allocation                                                    Kubernetes cluster post provision
Compute post provision                                            Kubernetes cluster post removal
Compute post removal                                              Kubernetes cluster provision
Compute provision                                                     Kubernetes cluster removal
Compute removal                                                       Load balancer post provision
Compute reservation                                                 Load balancer post removal
Deployment action completed                                 Load balancer provision
Deployment action requested                                  Load balancer removal
Deployment completed                                             Network Configure
Deployment onboarded                                            Network post provisioning
Deployment requested                                              Network post removal
Deployment resource action completed                Network provisioning
Deployment resource action requested                 Network removal
Deployment resource completed                            Project Lifecycle Event Topic
Deployment resource requested                             Security group post provision
Disk allocation                                                             Security group post removal
Disk post Removal                                                      Security group provision
Disk post resize                                                           Security group removal

In order to understand an Event topic review the Descripton, Topic ID, Blocakble and Schema of the Event Topic.

Compute provision Event Topic

If you want to create a Subscription for an Event Topic, just select the Event Topic and click on Subscribe, select the ABX Action or Workflow to trigger, select the Blocking of events and Subscription scope. Schema of an Event Topic can also be reviewed on this screen, Schema (Payload in the previous versions of vRealize Automation) of an Event Topic is a set of Properties which will be passed to Orchestrator when an event of this Topic is triggered.

Test Subscription for Compute provision Event Topic

Important Tip: If you are not sure about the Schema of an Event Topic, create a Blank Workflow with Input Variable of name “inputProperties” & Type “Properties” and Create a Test Subscription using this Blank Workflow. Name of the Input Variable is Important here, if you name it something else it will not receive the Properties from Cloud Assembly.

Schema Properties received by the Orchestrator Workflow

Did you notice that the Workflow ran twice? This is because i have Specified 2 Machine components in the Blueprint and the Workflow ran each time a Machine Component was provisioned for this Deployment request.

2 Workflow Runs for the Test Subscription

The names of the machine components in the Test Blueprint used for this illustration are “Primary_VM” and “Secondary_VM”.

Blueprint for which Event Subscription was triggered

There is one more important thing which you can specify while creating an Event Subscription using Event Topics, which is the Condition. Condition is something which you describe to filter out a specific Event from the list of Events which are triggered when a user requests for Services using Service Broker.

Condition to filter Events for an Event Topic

Condition can only be specified in Javascript Syntax in the current version of vRealize Automation. For Instance if I would like to trigger the same Test Workflow only for the Secondary_VM, i can specify a condition in the Test Subscription as event.data.blueprintId == ‘e9d2abc4-94fa-48f1-a1db-19a31510a375’ && event.data.componentId == ‘Secondary_VM’ Blueprint ID can be copied from one of the previous sample Workflow runs.

Sample Filter Condition for Events in Topic

This condition would ensure that the Workflow is triggered if the Blueprint requested has an id e9d2abc4-94fa-48f1-a1db-19a31510a375 and only for the component with id Secondary_VM. If you request a Deployment now using the same Blueprint, the Workflow will be triggered only once and that is for the Machine Component Secondary_VM.

Single Workflow Run for Secondary_VM Machine Component

Note: I noticed one typo in the examples provided for Condition statement in vRealize Automation 8, there is a space missing after event.data.blueprintId == and the actual id. I had to spend 15 mins figuring out why the event is not triggering a workflow, so make sure that the Syntax for the Condition is correct.

Bad Syntax for the Condition Statement Example

With that you are now ready to create Event Subscription in vRealize Automation 8. Enjoy!!

https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8549655389727719

VMware Aria Operations – Backup & Export Configuration

Featured

In this blog we have covered the 2 methods of taking Backup of your VMware Aria Operations (vRealize Operations Manager) configuration.

VMware Aria Operations introduced a feature called Content Management in version 8.2 back in October 2020.

Content Management helps the Customers to Backup and Export their configuration of VMware Aria Operations which can be further used to restore the configuration like Dashboards, Views, Report Templates, Supremetrics and a lot more in case you run into issues with the deployment.

We have covered two methods of taking a Backup and Export of VMware Aria Operations Configuration – First one, using the Content Management Tab under Administration in VMware Aria Operations UI and Second one, using a Python Script which makes use of the native APIs of Aria Operations.

Python script which we have developed has been tested on Python 3.10.10 version and Aria Operations 8.10 version. This script can also be scheduled as a Scheduled Task to take periodic configuration backups.

Method -1: Content Management Tab under Administration in VMware Aria Operations UI

Method -2: Python Script which uses native APIs of Aria Operations

#!/usr/local/bin python3
import requests, json, urllib3, datetime, time, os, zipfile, shutil
from requests.auth import HTTPBasicAuth
from datetime import datetime
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
base_url = 'https://vrops80-weekly.cmbu.local/suite-api/api'
token_url = base_url + '/auth/token/acquire'
headers =  {"Content-Type":"application/json", "Accept":"application/json"}
body = {
    "username": "admin",
    "password": "VMware1!",
    "authSource": "local"
    }
token_api_response = requests.post(token_url, headers=headers, json=body, verify=False)
token_api_response = token_api_response.json()
vRealize_ops_token = token_api_response["token"]
print("vRealize Ops Token: " + vRealize_ops_token)
content_export_request_url = base_url + '/content/operations/export/'
headers = {"Content-Type":"application/json", "Accept":"application/json", "EncryptionPassword": "Aman@123456789", "Authorization": "vRealizeOpsToken " + vRealize_ops_token}
body = {
  "scope" : "CUSTOM",
  "contentTypes" : [ "DASHBOARDS", "VIEW_DEFINITIONS", "REPORT_DEFINITIONS", "REPORT_SCHEDULES", "CONFIG_FILES", "ALERT_DEFINITIONS", "SYMPTOM_DEFINITIONS", "RECOMMENDATION_DEFINITIONS",  "NOTIFICATION_RULES", "PAYLOAD_TEMPLATES", "POLICIES", "CUSTOM_GROUPS", "SUPER_METRICS", "COMPLIANCE_SCORECARDS", "AUTH_SOURCES", "USERS", "USER_GROUPS", "ROLES", "INTEGRATIONS", "HTTP_PROXIES", "OUTBOUND_SETTINGS", "COST_DRIVERS", "SDMP_CUSTOM_SERVICES", "SDMP_CUSTOM_APPLICATIONS", "DISCOVERY_RULES", "APP_DEF_ASSIGNMENTS", "CUSTOM_PROFILES", "GLOBAL_SETTINGS"  ],
  "Password" : "12345"
  }
content_export_response = requests.post(content_export_request_url, headers=headers, json=body, verify=False)
content_export_response = content_export_response.json()
print("Sleeping for 60 seconds")
time.sleep(60)
export_zip_url = base_url + '/content/operations/export/zip'
headers = {"Content-Type":"application/json", "Accept":"application/json", "Authorization": "vRealizeOpsToken " + vRealize_ops_token}
export_zip_response = requests.get(export_zip_url, headers=headers, verify=False)
current_datetime = datetime.now()
str_current_datetime = str(current_datetime)
file_name = "./vROpsContentBackup/" + str_current_datetime+".zip"
print(file_name)
with open(file_name, 'wb') as zipFile:
    zipFile.write(export_zip_response.content)

For the detailed process to Backup and Export VMware Aria Operations Configuration please watch our video:

I hope this blog was informative for you, stay tuned for our upcoming blogs. Happy Learning!!

#vmware #aria #operations #vROps #manager #content #management #public #private #hybrid #cloud #backup #export

Create Your First VPC on AWS

Featured

In this blog we have covered the manual process of creating a custom Virtual Private Cloud (VPC) on Amazon Web Services (AWS) cloud platform.

We have also talked about some of the key concepts related to VPC like Route Table, Subnet, Network Access Control List (ACL) and Security Group.

A Virtual Private Cloud (VPC) is a virtual, private and logically isolated network that an AWS Customer can define which is dedicated for that Customer.

VPC enable Customers to launch their resources like EC2 (Virtual Machine) instances in this private network.

Key Concepts:

Route Table – A Route Table is a set of rules called routes which helps router make effective decisions in routing packets.

Subnets – A subnet is a range of IP Addresses present in a CIDR block in which you can launch your EC2 instances

Network Access Control List – Network ACL includes inbound and outbound rules which allows traffic to flow in and out of a Subnet.

Security Group – Security Groups consist of rules which are associated with Resources and controls the traffic entering or leaving a resource.

For the detailed process of creating a custom Virtual Private Cloud on AWS, please watch our video.

Create Your First VPC on AWS

I hope this blog was informative for you, stay tuned for our upcoming blogs. Happy Learning!!

#aws #vpc #route-table #subnet #nacl #security-group #igw #ec2

Create Your First VPC on AWS

Featured

In this blog we have covered the manual process of creating a custom Virtual Private Cloud (VPC) on Amazon Web Services (AWS) cloud platform.

We have also talked about some of the key concepts related to VPC like Route Table, Subnet, Network Access Control List (ACL) and Security Group.

A Virtual Private Cloud (VPC) is a virtual, private and logically isolated network that an AWS Customer can define which is dedicated for that Customer.

VPC enable Customers to launch their resources like EC2 (Virtual Machine) instances in this private network.

Key Concepts:

Route Table – A Route Table is a set of rules called routes which helps router make effective decisions in routing packets.

Subnets – A subnet is a range of IP Addresses present in a CIDR block in which you can launch your EC2 instances

Network Access Control List – Network ACL includes inbound and outbound rules which allows traffic to flow in and out of a Subnet.

Security Group – Security Groups consist of rules which are associated with Resources and controls the traffic entering or leaving a resource.

For the detailed process of creating a custom Virtual Private Cloud on AWS, please watch our video.

Create Your First VPC on AWS

I hope this blog was informative for you, stay tuned for our upcoming blogs. Happy Learning!!

#aws #vpc #route-table #subnet #nacl #security-group #igw #ec2

Script to Create Multiple Datastores

Featured

There was a requirement in one of the projects to create multiple (approx. 60) datastores using a PowerCLI script. We wrote a PowerCLI script to perform this operation on multiple LUNs presented to all ESXi hosts in the cluster.

Requirements:

  • PowerCLI
  • PowerShell 5.1 or later

Script:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
Connect-VIServer “vCenter_Server_IP_Address/FQDN” -Credential (Get-Credential)

$datanames = Import-Csv ‘C:\Users\Admin\Desktop\File_with_datastore_name_NAA_Ids.csv

foreach ($dataname in $datanames)
{
$dataname.Datastore_Name
$dataname.Naa_Id
New-Datastore -VMHost ESXi-01.mycloud.lab -Name $dataname.Datastore_Name -Path $dataname.Naa_Id -Vmfs -FileSystemVersion 6
Get-Cluster -name “Cloud-Clu-01” | Get-VMhost | Get-VMHostStorage –RescanAllHBA
Start-Sleep -Seconds 15
}

Disconnect-VIServer -Confirm:$false

Input File Sample:

Sample of File_with_datastore_name_NAA_Ids.csv

Just replace the vCenter_Server_IP_Address/FQDN, Path of File Containing Datastore Names, NAA Ids, ESXi Host, Cluster Name and Sleep Interval after each Datastore creation operation with the details of your environment. BOOM!!

Happy Scripting!!

Script to Export VI Permissions

Featured

There was a requirement in one of the projects to export permissions assigned to each Virtual Machine hosted in a vSphere Environment. We wrote a PowerCLI script to fetch the list of users along with the Role assigned to each user and export these details to a CSV file.

Requirements:

  • PowerCLI
  • PowerShell 5.1 or later

Script:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
$cred = Get-Credential
Connect-VIServer vCenter_IP/FQDN -Credential $cred
$vms = Get-VM
$output = New-Object System.Collections.ArrayList($null)
$vmpermission = @()
foreach ($vm in $vms)
{
    $permissions = $vm | Get-VIPermission | Get-Unique
    Foreach ($permission in $permissions)
    {
        $formatpermission = $permission.Principal + " (" + $permission.Role + ")"
        $permission | Add-Member -NotePropertyName FormatPermission -NotePropertyValue $formatpermission
    }
    $vmpermission = [pscustomobject]@{VMName=$vm.Name;Role=$permissions.FormatPermission  -join ', '}
    [void]($output.Add($vmpermission))
}

$output | Export-csv C:\Users\VMPermissionsExport.csv -NoTypeInformation

Just replace the vCenter_Server_IP_Address/FQDN and Path of CSV File and run the script to export VI Permissions assigned to each Virtual Machine in vSphere environment. BOOM!!

Happy Scripting!!

Single Sign-On Configuration for VMware vRealize Suite

Featured

In vRealize Automation 8.X, Easy Installer deploys a vIDM appliance which is used for Authentication by vRealize Automation whether you choose a Standalone deployment or a Clustered deployment. As we already have an external vIDM appliance as part of our vRA 8.X deployment, we can use it for configuring Single Sign-On for VMware vRealize Suite products.

Single Sign-On configuration is supported in 7.X versions of vRealize Suite products as well but we need an external VMware Identity Manager which most of the customers do not deploy. vRealize Automation 7.X Appliances also include an embedded version of VMware Identity Manager, even though we can enable the UI for the embedded vIDM using the command vcac–vami horizon ui enable but there is no documentation suggesting that making changes directly to VMware Identity Manager is supported by VMware.

In this post we will discuss the process of configuring Single Sign-On for vRealize Suite 8.X version products. In this article I am assuming that an Active Directory domain has already been configured in VMware Identity Manager.

vRealize Automation:

1. Login to VMware Identity Manager and click on Web Apps under the Catalog section.

VMware Identity Manager Web Apps Section

2. Click on New to configure vRealize Automation Web Application Link.

Creating a New Web Application Link in Identity Manager

3. In the Name section enter vRealize Automation 8.X (vRA) and upload an Icon file for vRealize Automation.

vRealize Automation Web App Configuration

4. Leave the Category section blank and click Next.

5. In Authentication Type select Web Application Link and type https://vRA_FQDN/csp/gateway/portal/#/consumer in Target URL.

Target URL for vRealize Automation Web App

5. Click Next and then click Save.

6. Now the only task left is to assign this App to Active Directory users who already have access to vRealize Automation. Select the newly created Application and Click on Assign.

Assign vRealize Automation Web App to Users/Groups

5. Search the name of Users/User Groups to publish the App, select the Deployment type as Automatic and click Save.

Assign vRealize Automation Web App Enterprise Admins Group

6. Next time the user authenticates with vIDM and goes to User Portal, he/she will be able to see the newly published vRA 8.X Application.

Access VMware Identity Manager User Portal

7. Next time the user authenticates with vIDM and goes to User Portal, he/she will be able to see the newly published vRA 8.X Application.

Launch vRealize Automation Web App from vIDM Catalog

8. Once the user clicks on Open on this App, user will be authenticated & re-directed to vRealize Automation portal.

vRealize Log Insight:

1. Before publishing vRealize Log Insight as an App in VMware Identity Manager we need to configure vIDM as an Authentication Source in vRealize Log Insight and we need to obtain the Target URL.

2. Login to vRealize Log Insight. Click on Administration and Under Authentication enter the details of your vIDM.

Configure vRealize Log Insight to use VMware Identity Manager for Authentication

3. Provide access to VMware Identity Manager Users/User Groups in Administration section under Access Control > Users and Groups.

Access Control in vRealize Log Insight

4. In order to obtain the Target URL, logout from vRealize Log Insight & logout from vIDM and select System Domain.

5. Open vRealize Log Insight in a new Tab, select VMware Identity Manager from the Drop-down and click on Login via SSO.

vRealize Log Insight Target URL for VMware Identity Manager

6. You’ll be redirected to VMware Identity Manager for login. Copy the URL from the Address Bar of the browser. URL will look something like:
https://idm01.mydomain.lab/SAAS/auth/login?dest=https://idm01.mydomain.lab/SAAS/auth/oauth2/authorize?response_type%3Dcode%26client_id%3Dbabc6f64a70-2c7c-4c5a-867f-bc631327f5dc%26redirect_uri%3Dhttps://192.168.113.112/login&chainedauthMethods
=%5B%7B%212chainedAuthmethods%212:%5B%7B%22authMethoId%22:15,%212a
uthMethodOrder%22:13%7D%5D%7D,%7B%22chainedAuthmethods%22:%5B%7B%
22authMethoId%22:3,%22authMethodOrder%22:1%7D%5D%7D%5D&ttl=28800

Capture vRealize Log Insight Target URL for VMware Identity Manager

7. URL highlighted in red is our Target URL for vRealize Log Insight. Follow the same process as vRealize Automation App and publish vRealize Log Insight for users using the vRealize Log Insight Target URL.

8. Now the users should be able to launch vRealize Log Insight App from vIDM User Portal & Authenticate using vIDM Single Sign-On.

vRealize Operations Manager:

1. For vRealize Operations Manager we need to follow the process similar to vRealize Log Insight. Configure vIDM as Authentication Source, Grant permissions to vIDM Users/Groups in vROps & obtain the Target URL.

2. Login to vRealize Operations Manager as an Admin user. Click on Administration and Under Authentication Sources click Add. Select Source Type as VMware Identity Manager and enter the details of your vIDM Appliance.

Configure VMware Identity Manager as Authentication Source in vRealize Operations Manager

3. Provide access to VMware Identity Manager Users/Groups by Importing them in Administration section under Access > Access Control > User Accounts and User Groups.

Import Users/Groups from VMware Identity Manager for Access Control in vRealize Operations Manager

4. In order to obtain the Target URL, logout from vRealize Operations Manager & logout from vIDM and select System Domain.

5. Open vRealize Operations Manager in a new Tab, select VMware Identity Manager from the Drop-down and click REDIRECT.

vRealize Operations Manager Target URL for VMware Identity Manager

6. You’ll be redirected to VMware Identity Manager for login. Copy the URL from the Address Bar of the browser. URL will look something like:

https://idm01.mydomain.lab/SAAS/auth/login?dest=https://idm01.mydomain.lab/SAAS/auth/oauth2/authorize?response_type%3Dcode%26client_id%3D0246fe54-d0a5-42ff-b3c1-f3d144b64519%26redirect_uri%3Dhttps://10.11.12.13/ui/vidmClient/vidm/&chainedauth
Methods=%5B%7B%22chainedAuthmethods%22:%5B%7B%22authMethoId%22:15,%
22authMethodOrder%22:13%7D%5D%7D,%7B%22chainedAuthmethods%22:%5B%7
B%22authMethoId%22:3,%22authMethodOrder%22:1%7D%5D%7D%5D&ttl=28800

We are only interested in Client ID highlighted in RED in the above link.

Capture VMware Identity Manager Client ID for vRealize Operations Manager

7. Replace the details of the below URL with your environment details and you’ll get Target URL for vRealize Operations Manager.

https://idm01.mydomain.lab/SAAS/auth/oauth2/authorize?response_type=code&client_id=3D0246fe54-d0a5-42ff-b3c1-f3d144b64519&redirect_uri=https://idm_ip_address/ui/vidmClient/vidm/

8. Follow the same process as vRealize Automation App and publish vRealize Operations Manager App for users using the vRealize Operations Manager Target URL.

9. Now the users should be able to launch vRealize Operations Manager App from vIDM User Portal & Authenticate using vIDM Single Sign-On.

vRealize Suite Lifecycle Manager:

1. For vRealize Suite Lifecycle Manager the process is fairly easy. We just need to provide users access to vLCM under Identity and Tenant Management and publish the Target URL.

2. Login to vRealize Suite Lifecycle Manager as an Admin user. Click on dentity and Tenant Management.

Identity and Tenant Management in vRealize Suite Lifecycle Manager

3. In Directory Management section, click on Directories click Add Directory by selecting Active Directory over LDAP.

Add Active Directory in vRealize Suite Lifecycle Manager

4. The process of Adding the Active Directory is same as vRealize Automation 7.X.

Active Directory over LDAP configuration in vRealize Suite Lifecycle Manager

5. Once Active Directory has been configured, provide relevant permissions to Users/Groups under User Management section.

User Management in vRealize Suite Lifecycle Manager

6. Replace the details of the below URL with your environment details and you’ll get Target URL for vRealize Suite Lifecycle Manager.

http://lcm01.mydomain.lab/lcm/login/vidm

8. The process of publishing vRealize Suite Lifecycle Manager App for users using the vRealize Suite Lifecycle Manager Target URL remains the same.

Note: The current versions of vCenter Server do not support VMware Identity Manager as an Identity Provider. NSX-T does support Single Sign-On configuration using vIDM.
For more details on integrating NSX-T with IDM, check out this blog.

The final catalog of your VMware Identity Manager will have Web Apps for all 4 vRealize Suite Components. Enjoy!!

VMware Identity Manager Signle Sign-On User Catalog

Export LUN IDs with Path Selection Policy

Featured

In this post we are sharing a PowerCLI script that we used to export a list of LUNs attached to ESXi hosts in a cluster along with the details of Path Selection Policy selected for the LUN and CommandsToSwitchPath parameter set for the LUNs.

Script was tested on below versions:

  • PowerCLI version 11.5.0 build 14912921
  • vSphere 6.7U3

Script:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
$cred = Get-Credential
Connect-VIServer vCenter_IP/FQDN -Credential $cred

$getCluster = Get-Cluster -Name "Cluster_Name"
$getESXis = $getCluster | Get-VMHost
$printluns=@()

foreach ($getESXi in $getESXis)
{
    $getLUNsforESXi = Get-VMhost $getESXi | Get-ScsiLun -LunType disk | Select VMHost, CanonicalName, MultipathPolicy, CommandsToSwitchPath
    $printluns = $printluns + $getLUNsforESXi
}

$printluns | Export-Csv C:\users\Administrator\Desktop\PathtoSaveFile.csv -NoTypeInformation 

Disconnect-VIServer -Confirm:$false

Just replace the vCenter_Server_IP_Address/FQDN, Cluster_Name and Path of CSV File and run the script to generate a report of LUNs mapped to all ESXi hosts in a vSphere cluster in your environment. BOOM!!

Happy Scripting!!

Assign Custom Attributes to VMs

Featured

There was a requirement in one of the projects to assign Custom Attributes to multiple Virtual Machines hosted in a vSphere Environment. We wrote a PowerCLI script to Assign the Custom Attributes to Virtual Machines using a CSV file which had all the details of the Custom Attributes.

Requirements:

  • PowerCLI
  • PowerShell 5.1 or later

Script:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
$cred = Get-Credential
Connect-VIServer vCenter_Server_IP_Address/FQDN -Credential $cred
$files = Import-CSV "C:\Users\testuser\Desktop\CustomAttributes.csv"
foreach ($file in $files)
{
$vm = Get-VM -Name $file.VMName
$vm | Set-Annotation -CustomAttribute "AppName" -Value $file.AppName
$vm | Set-Annotation -CustomAttribute "Owner" -Value $file.Owner
$vm | Set-Annotation -CustomAttribute "AppDL" -Value $file.AppDL
$vm | Set-Annotation -CustomAttribute "Env" -Value $file.ENv
}

Disconnect-VIServer -Confirm:$false

Input CSV File:

CustomAttributes.csv

Just replace the vCenter_Server_IP_Address/FQDN and Path of CSV File and run the script to assign Custom Attributes to Virtual Machines in vSphere environment. BOOM!!

Happy Scripting!!

Script to Export VI Permissions

Featured

There was a requirement in one of the projects to export permissions assigned to each Virtual Machine hosted in a vSphere Environment. We wrote a PowerCLI script to fetch the list of users along with the Role assigned to each user and export these details to a CSV file.

Requirements:

  • PowerCLI
  • PowerShell 5.1 or later

Script:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
$cred = Get-Credential
Connect-VIServer vCenter_IP/FQDN -Credential $cred
$vms = Get-VM
$output = New-Object System.Collections.ArrayList($null)
$vmpermission = @()
foreach ($vm in $vms)
{
    $permissions = $vm | Get-VIPermission | Get-Unique
    Foreach ($permission in $permissions)
    {
        $formatpermission = $permission.Principal + " (" + $permission.Role + ")"
        $permission | Add-Member -NotePropertyName FormatPermission -NotePropertyValue $formatpermission
    }
    $vmpermission = [pscustomobject]@{VMName=$vm.Name;Role=$permissions.FormatPermission  -join ', '}
    [void]($output.Add($vmpermission))
}

$output | Export-csv C:\Users\VMPermissionsExport.csv -NoTypeInformation

Just replace the vCenter_Server_IP_Address/FQDN and Path of CSV File and run the script to export VI Permissions assigned to each Virtual Machine in vSphere environment. BOOM!!

Happy Scripting!!

Script to Create Multiple Datastores

Featured

There was a requirement in one of the projects to create multiple (approx. 60) datastores using a PowerCLI script. We wrote a PowerCLI script to perform this operation on multiple LUNs presented to all ESXi hosts in the cluster.

Requirements:

  • PowerCLI
  • PowerShell 5.1 or later

Script:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
Connect-VIServer “vCenter_Server_IP_Address/FQDN” -Credential (Get-Credential)

$datanames = Import-Csv ‘C:\Users\Admin\Desktop\File_with_datastore_name_NAA_Ids.csv

foreach ($dataname in $datanames)
{
$dataname.Datastore_Name
$dataname.Naa_Id
New-Datastore -VMHost ESXi-01.mycloud.lab -Name $dataname.Datastore_Name -Path $dataname.Naa_Id -Vmfs -FileSystemVersion 6
Get-Cluster -name “Cloud-Clu-01” | Get-VMhost | Get-VMHostStorage –RescanAllHBA
Start-Sleep -Seconds 15
}

Disconnect-VIServer -Confirm:$false

Input File Sample:

Sample of File_with_datastore_name_NAA_Ids.csv

Just replace the vCenter_Server_IP_Address/FQDN, Path of File Containing Datastore Names, NAA Ids, ESXi Host, Cluster Name and Sleep Interval after each Datastore creation operation with the details of your environment. BOOM!!

Happy Scripting!!

vRealize Automation Managed VMs Report with Machine Owner’s ID

Featured

We were working on a requirement last week to pull a report of all vRealize Automation Managed Machines using PowervRA Module version 3.7.0 which supports vRealize Automation 7.6. While generating the report using a PowerShell script we noticed that the output was only showing the name of the Machine owner instead of the ID.

Then we started digging into the function Get-vRAResource of PowervRA Module and we noticed that the method which is used by function Get-vRAResource in PowervRA Module is /catalog-service/api/consumer/resourceViews

vRealize Automation API Method used by function Get-vRAResource in PowervRA

After checking the vRealize Automation Catalog Service API 7.6 documentation we realized that this method was deprecated in vRealize Automation 7.5 version and this method is similar to /catalog-service/api/consumer/resources method.

Method /api/consumer/resourceViews has been deprecated since version 7.5

We used our Good Old API building Platform Postman to do a side by side comparison of vRA API methods /catalog-service/api/consumer/resourceViews and /catalog-service/api/consumer/resources. If you’ll look at the output of both the methods closely, you’ll notice that the resourceViews methods returns only the Name of the Owner where as the resources methods returns an Array which includes the values of tenantName, ref, type & value out of which ref is the Machine Owner’s ID.

Side-by-Side Comparison of API Methods /api/consumer/resourceViews and /api/consumer/resources using Postman

Armed with all that information we prepared our script to pull resource Information of all vRA Managed Machines using PowervRA function Get-vRAResource and then we used the vRealize Automation API method /catalog-service/api/consumer/resources/{ResourceID} to get the Machine Owner’s ID of each Resource to generate our vRA Managed VMs report with Owner’s ID.

Script:

Set-ExecutionPolicy RemoteSigned

$cred = Get-Credential
$vRAFQDN = "vRA_FQDN"
$vRATenant = "TenantName"

#Connecting to vRA Server using PowervRA 3.7.0 Module
Connect-vRAServer -Server $vRAFQDN -Tenant $vRATenant -Username $cred.UserName -Password $cred.Password -IgnoreCertRequirements

#Fetching List of vRealize Automation Managed Virtual Machines
$filter = Get-vRAResource | where {$_.ResourceType -eq "Infrastructure.Virtual"}
$date = Get-Date -Format "yyyy-MM-dd-hh-mm-tt"
$print =  $filter | Select Data,Owners,ResourceId
$output = $print | Select @{Name="VMName";Expression={$_.Data.MachineName}}, @{Name="BusinessGroup";Expression={$_.Data.MachineGroupName}},`
@{Name="Owner";Expression={$_.Owners}}, @{Name="OwnersID";Expression={""}}, @{Name="ResourceID";Expression={$_.ResourceId}}, @{Name="ReservationName";Expression={$_.Data.MachineReservationName}},`
@{Name="vCPUs";Expression={$_.Data.MachineCPU}}, @{Name="Memory (MB)";Expression={$_.Data.MachineMemory}}, @{Name="Storage (GB)";Expression={$_.Data.MachineStorage}}
 
$output = $output | where {$_.VMName -ne $null}
 
$output | ft -AutoSize -Wrap

[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $True }
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add('Accept','application/json')
$headers.Add('Content-Type','application/json')
 
$Body = @{
    username = $cred.UserName
    password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($cred.Password))
    tenant = $vRATenant
} | ConvertTo-Json
 
#Generating API Bearer Token for vRA Login
 
$url = "https://" + $vRAFQDN
$tokenurl = $url + "/identity/api/tokens"
$token = Invoke-RestMethod -Method Post -Uri $tokenurl -Body $Body -Headers $headers -Verbose
$token = $token.id
$headers.Add('Authorization',"Bearer $token")
$printvalue = @{}
$i=0;

#Get Machine Owner's ID for each Managed Machine

foreach ($item in $output)
{
    $owneridurl = $url + "/catalog-service/api/consumer/resources/" + $item.ResourceId
    $ownersId = Invoke-RestMethod -Method Get -Headers $headers -uri $owneridurl -Verbose
    $item.OwnersID = $ownersId.owners.ref
    $printvalue[$i] = $item
    $i = $i + 1
}

$printvalue.Values | FT -AutoSize -Wrap
 
$printvalue.Values | Export-Csv C:\Users\Administrator\Desktop\vRAManagedMachineReport-$date.csv -NoTypeInformation

Output:

Sample Output

Just replace the vRA_FQDN and TenantName with the details of your vRA environment and supply the output file path to generate the report.

Happy Scripting!!

Two-Factor Authentication for vRealize Automation

Featured

In vRealize Automation 7.X VMware Identity Manager (vIDM) was embedded in vRealize Automation Appliance, even though the UI for vIDM is disabled however we can still use the capability of vRealize Automation to Authenticate using a RADIUS server. There is a very informative VMware blog on Configuring vRA 7 for 2 Factor Authentication posted by Jon Schulman back in February 2016 but a few things have changed since then.

I had to configure Two Factor Authentication for one the customers, this was when i realized that there are few modification which are required to configure Two-Factor Authentication in vRA. In order to provide a brief overview, we will be using a Ubuntu Machine to install and will install Google Authenticator and RADIUS server on this machine. Ubuntu machine will integrate with Active Directory for Authentication and then we will configure vRealize Automation to use RADIUSAuthAdapter to Authenticate users with “AD Password + Google Authenticator Passcode”.

Configuring Two-Factor Authentication:

Pre-requisites:

1. 1 Ubuntu 18.04.3 VM
2. VM should have minimum of 2 vCPUs and 4 GB RAM
3. Active Directory
4. vRealize Automation 7.X
5. DNS Record for Ubuntu Machine

1. Configure Ubuntu Machine:

I am using an Ubuntu VM of 2 vCPUs, 4 GB Memory and 20 GB HDD for this Demo.

Patch/Update the Ubuntu machine and Install open-vm-tools using the below commands:

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install open-vm-tools

Install NTP and Open-SSH on the Ubuntu machine using the below commands:

sudo apt-get install ntp
sudo apt-get install openssh-server

Now would be a good time to verify DNS resolution for Active Directory and vRealize Automation.

Download and Install latest PowerBroker Identity Services package pbis-open-9.1.0.551.linux.x86_64.deb.sh from BeyondTrust Github repo:

sudo ./Desktop/pbis-open-9.1.0.551.linux.x86_64.deb.sh

Once the Power Broker Identity Services has been installed, there is one more thing that we need to do before we add Ubuntu machine to Active Directory. We need to uninstall Avahi daemon:

sudo apt-get remove avahi-daemon

Now we can add our Ubuntu machine to Active Directory using the below command:

sudo /opt/pbis/bin/domainjoin-cli join vmlab.local administrator@vmlab.local

After you have successfully joined the system to Active Directory, login to Active Directory and verify that the Computer Object has been created.

Reboot your Ubuntu machine. Once the machine has been restarted, you should be able to login to the machine using Active Directory Credentials.

Now we will setup the Default Domain, Home Directory and Shortname for our Active Directory Domain in the Ubuntu server by running the below commands:

sudo /opt/pbis/bin/config AssumeDefaultDomain true
sudo /opt/pbis/bin/config LoginShellTemplate /bin/bash
sudo /opt/pbis/bin/config HomeDirTemplate %H/%U
sudo /opt/pbis/bin/config UserDomainPrefix VMLAB

Now we need to add the below mentioned lines to /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf file to allow users to login to Ubuntu machine using Active Directory Credentials on Ubuntu login screen:

sudo nano /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf


allow-guest=false
greeter-show-manual-login=true

Install Freeradius Server on your Ubuntu machine using the below command:

sudo apt install freeradius

Edit the file /etc/freeradius/3.0/radiusd.conf and replace the below entries:
Replace:
user = freerad
group = freerad

With:
user = root
group = root

Run the below command to enable PAM modules:
ln -sf /etc/freeradius/3.0/mods-available/pam /etc/freeradius/3.0/mods-enabled/pam


Comment out all the lines in the file /etc/pam.d/radiusd and add the below lines:

auth requisite pam_google_authenticator.so forward_pass
account required pam_lsass.so use_first_pass

Add the below entry to the file /etc/freeradius/3.0/users:

DEFAULT Auth-Type := PAM



Modify the file /etc/freeradius/3.0/clients.conf to make an entry for vRealize Automation server in the Ubuntu machine:

client vra76.vmlab.local {
ipaddr = 192.168.0.55
secret = VMwar31!
shortname = vra76
}

Edit the file and uncomment pam to enable Pluggable Authentication Modules in file /etc/freeradius/3.0/sites-enabled/default:

Restart FREEARDIUS service:

2. Install Google Authenticator:

Once your machine has been setup to Authenticate using Active Directory, we will proceed with installing Google Authenticator and generate Google Authenticator Token to generate Passcodes using Google Authenticator Mobile Application:

Use the below command to install Google Authenticator:

sudo apt install libpam-google-authenticator

We can now begin enabling our Active Directory users to start enrolling for Google Authenticator Application on their Mobile phones. Advise the users to login to the respective App Stores (Google Playstore & Apple’s App Store) to download and Install Google Authenticator App.



Assume the Identity of the user you want to enable for login and run the command google-authenticator:

su demo@vmlab.local
google-authenticator

Type y to generate a time-based token and a QR Code and Secret Key will be generated for th user. User can scan the QR code using Google Authenticator App or User can enter the Secret Key to import the tokwn in the App:

There are 5 Emergency Scracth codes which are generated for the user to use when user wants to Authenticate but does not have Mobile phone handy with him/her.
These codes are one-time codes and answer the below questions as per your environment. I would recommend answering the 3rd question as “yes”, as it will allow the users to use a token for upto 4 minutes otherwise the each token expires within 30 seconds.

Google Authenticator doesn’t allow you to take a screenshot of an actie token hence the image but a successfully imported token in Google Authenticator looks like this:

3. Configure vRealize Automation to Authenticate using Radius:

Login to vRealize Automation with Tenant Administrator credentials and click on the Connector under Directories Management section:

Click on the Auth Adapters and click on the RadiusAuthAdapter to enable Radius Authentication.

Enable Radius Adapter and enter the details of the Ubuntu machine, set the Authentication Type as PAP, you can enter Number of attemps to Radius server and Time out values as per your requirement and enter the shortname for your domain followed by a Backslash “\”:

If you want to enable High Availability, you can setup another Ubuntu machine in a similar fashion but for our demo we will not be enabling Secondary server. Click on Save to save the settings and enable the Radius Auth Adapter. Enter the Passphrase hint to provide users information about entering Password followed by Passphrase.

Click on Network Ranges and create a new Network range, All clients which are using the IP addresses of this range will be required to authenticate using Password + Passcode (Two-Factor Authentication). If you are using a Distributed vRealize Automation Deployment, Start and End IP Address of the Network Range should be the vRA Portal VIP:

Now the last step in the configuration is to setup a Policy Rule to enforce Radius Authentication. Create a Policy Rule by selecting the newly created Network Range, select All Device Types to access the content from and select the Authentication method as Radius and click on Ok.

Drag and drop the newly created Network Range to the top of the list and click Save to save the configuration:

Now when you’ll attempt to login to vRealize Automation portal using a client with the IP Address defined in the Network Range, you’ll prompted with the new Passphrase hint:

In order to login to vRA portal, enter your Password followed by the Google Authenticator Passphrase:

BOOM!!, you have managed to configure Two-Factor Authentication for vRealize Automation.

Export vRealize Automation Network Profile’s IP Ranges

Featured

We received a request to export the details of vRealize Automation Network Profile’s IP Ranges. We wrote a PowerShell script which uses PowervRA (3.6.0) module to extract the details of Network Ranges for each Network Profile.

Pre-requisites:

  • PowervRA 3.6.0
  • PowerShell 5.1 or later

Script:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$cred = Get-Credential
Connect-vRAServer -Server ‘vRA_Server/Portal_Address‘ -Username $cred.UserName -Password $cred.Password -Tenant ‘Tenant_Name‘ -IgnoreCertRequirements

$netids = Get-vRAExternalNetworkProfile
$out = @()
foreach ($netid in $netids)
{
$print = $netid | Select @{Name=”Name”;Expression={$_.Name}}, @{Name=”SubnetMask”;Expression={$_.SubnetMask}},`
@{Name=”BeginIPv4Address”;Expression={$_.DefinedRanges.beginIPv4Address}},`
@{Name=”EndIPv4Address”;Expression={$_.DefinedRanges.endIPv4Address}}
$out = $out + $print
}

$out | Export-Csv C:\Users\Administrator\vRANetProfileRanges.csv -NoTypeInformation
Disconnect-vRAServer -Confirm:$false

Output:

output

Just replace the vRA_Server/Portal_Address and Tenant_Name with the details of your vRA environment and supply the output file path.

Happy Scripting!!

 

Bulk Shutdown of Virtual Machines

Featured

There was a requirement in one of the projects to perform an unattended shutdown of multiple Virtual Machines during a planned Maintenance Window. We wrote a PowerCLI script to perform shutdown operation on multiple VMs with a delay of 20 seconds between each shutdown.

Requirements:

  • PowerCLI
  • PowerShell 5.1 or later
  • VMware Tools on the Virtual Machines

Script:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
Connect-VIServer “vCenter_Server_IP_Address/FQDN” -Credential (Get-Credential)
$VMs = Get-Content C:\Scripts\VMShutdown\VMList.txt
foreach ($VM in $VMs)
{
Write-Host “Initiating Guest Shutdown for VM ” + $VM -ForegroundColor DarkRed
Shutdown-VMGuest -VM $VM -Confirm:$false
Start-Sleep -Seconds “20
}

foreach ($VM in $VMs)
{
Get-VM $VM | Select Name, PowerState | Ft -AutoSize -Wrap
}
Disconnect-VIServer -Confirm:$false

Note: Virtual Machines are shutdown gracefully and requires VMware Tools to installed on machine.

Just replace the vCenter_Server_IP_Address/FQDN, Path of File Containing VMs Name and Sleep Interval after each shutdown operation with the details of your environment. BOOM!!

Happy Scripting!!

Execute PowerShell Scripts from vRO

Featured

In order to execute PowerShell scripts from vRealize Orchestrator, we need to configure a PowerShell host as an endpoint for your vRealize Orchestrator. vRealize Orchestrator which comes embedded with vRealize Automation appliance already has PowerShell Plug-in installed and has all the required workflows available under Library > PowerShell.

Adding PowerShell host to vRealize Orchestrator:

Pre-requisites:

  1. vRealize Orchestrator with PowerShell Plug-in
  2. Windows Host – 2 vCPUs & 4 GB RAM, PowerShell PSVersion 5.X, Windows Server 2012 or later (Domain-joined)
  3. Certificate for Windows Host (if you are using Custom certificates)
  4. Active Directory User Account – Service Account which should be part of Administrators and Remote Management Users groups on Windows Host.

Configuration Steps:

  1. Enable PowerShell Remoting on Windows Host by running the command Enable-PSRemoting command. The Enable-PSRemoting cmdlet configures the computer to receive PowerShell remote commands that are sent by using the WS-Management technology.
    PowerShell remoting is enabled by default on Windows Server 2012. You can use Enable-PSRemoting to enable PowerShell remoting on other supported versions of Windows and to re-enable remoting on Windows Server 2012 if it becomes disabled. This command has to be run only once on the Windows PowerShell Host.undefined
    Increase the amount of memory each PowerShell session is allowed to consume for executing the scripts by running the below command:

    winrm set winrm/config/winrs @{MaxMemoryPerShellMB=”2048″}

    undefined
  2. Import the Custom Certificate generated by your Certificate Authority to your Windows PowerShell Host. In this example, we are generating a Self-signed certificate (Using a Self-signed certificate is not recommended for the Production environment). Self-Signed certificate can be generated using the below command:

    New-SelfSignedCertificate -DnsName YourServerFQDN -CertStoreLocation Cert:\LocalMachine\My

    undefined
    Copy this newly generated Self-signed certificate to Console Root > Certificates > Trusted Root Certification Authorities > Certificates. Note down the thumbprint of the certificate from the Certificate details:undefined
  3. Create a WinRM HTTPS Listener by running the below mentioned command:

    winrm create winrm/config/Listener?Address=*+Transport=HTTPS @{Hostname=”PWShellHost_FQDN“;CertificateThumbprint=”Certificate_Thumbprint”}

    Replace PWShellHost_FQDN with the FQDN of your PowerShell Host and replace Certificate_Thumbprint with the thumbprint of the Self-signed certificate generated in the previous step.undefined

    Run the following command to enable Kerberos authentication for WinRM service:

    winrm set winrm/config/service/auth @{Kerberos=”true”}

    If you need to delete the WinRM HTTPS Listener for some reason, run the below command:

    winrm delete winrm/config/Listener?Address=*+Transport=HTTPS @{Hostname=”PWShellHost_FQDN”;CertificateThumbprint=”Certificate_Thumbprint”}
  4. Create an Inbound Windows Firewall Rule on Windows PowerShell Host by running the below command:

    New-NetFirewallRule –Direction Inbound –Action Allow –DisplayName “Windows Remote Management [HTTPS-In]” –Description “Inbound rule for Windows Remote Management via WS-Management. [TCP 5986]” –Program “System” –Profile Domain,Private –Protocol TCP –LocalPort “5986” –RemotePort Any

    Firewall Rule Details:

    Name: Windows Remote Management (HTTPS-In)
    Description: Inbound rule for Windows Remote Management via WS-Management. [TCP 5986]
    Program: System
    Local IP address: Any
    Remote IP address: Any
    Direction: Inbound
    Profile: Domain, Private
    Protocol: TCP
    Local port: 5986
    Remote port: Any
  5. We need to configure vRealize Orchestrator to use Kerberos Authentication. Edit the krb5.conf configuration file on your vRealize Orchestrator server located at path /usr/java/jre-vmware/lib/security/ to specify the domain name and domain controller name. If the file does not already exist, create a new file and paste the contents after modifying as per your requirement in the file:

    [libdefaults]
    default_realm = DOMAIN.COM
    udp_preference_limit = 1
    [realms]
    DOMAIN.COM = {
    kdc = AD-Server.domain.com
    default_domain = domain.com
    }
    [domain_realm]
    .domain.com=DOMAIN.COM
    domain.com=DOMAIN.COM

    Set the permissions of the file krb5.conf to chmod 7777.
  6. Run vRealize Orchestrator workflow Import a certificate from URL located under Library > Configuration > SSL Trust Manager > Import a certificate from URL to import the certificate of the PowerShell Host to vRealize Orchestrator:undefined
    There will be couple of warnings thrown at you, just accept all the warnings and verify the Certificate Validity and accept to Import the certificate.

    undefined
    undefined
    undefined
    undefined
    Once the Certificate has been imported successfully, you’ll be able to see the certificate under the CA Keystore:undefined
    undefined
  7. Next step is to run the vRO workflow Add a PowerShell Host located under Library > PowerShell > Configuration > Add a PowerShell host workflow to add the Windows PowerShell Host to vRO.

    Enter PowerShell Host FQDN under Host, Any reference name under Name and Port should be 5986 for HTTPS connection: undefined
    Select WinRM under PowerShell remote host type, HTTPS under Transport protocol, set Accept all certificates to Yes and Authentication type should be Kerberos.undefined
    Enter the credentials of Active Directory Service Account which is part of the Administrators and Remote Management Users groups on Windows PowerShell host and select Session mode as Shared Session.undefined
    Under Advanced Settings select Shell Code Page as UTF8.undefined
    Once Workflow has ran successfully, you’ll be able to see the newly configured PowerShell host under PowerShell plugin in Inventory tab of vRealize Orchestrator.undefined
    undefined
  8. Now comes the part we have been waiting for, we can now execute any PowerShell script hosted on this newly configured Windows PowerShell Host. To execute a PowerShell Script we will run the vRealize Orchestrator workflow Invoke an external script located under Library > PowerShell > Invoke an external script.
    Select your newly configured Windows PowerShell host under the Host.undefined
    Enter the path of the PowerShell script which is hosted on the Windows PowerShell Host and enter any arguments under Arguments section.undefined
    Voila!undefined
    You are now all set to run all your favorite PowerShell scripts using vRealize Orchestrator.

Happy Scripting!!

https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8549655389727719

Backup and Export Distributed Switch configuration

The below script was prepared to Backup and Export Distributed Switch configuration:

Connect-VIServer -Server vCenter_FQDN/IP_Address -Credential (Get-Credential)
$vDSwitchDetails = Get-VDSwitch
$vDSwitchNames = $vDSwitchDetails.Name
$datestamp = Get-Date -Format “MM-dd-yyyy”
Foreach ($vDSwitchName in $vDSwitchNames)
{
$DestiationDir = “C:\Users\Administrator\Desktop\Scripts\vDSExport\”+ $datestamp + “\” + $vDSwitchName + “\”
New-Item -Path $DestiationDir -ItemType “Directory” -Force
$filename= $DestiationDir + $vDSwitchName + “.zip”
Get-VDSwitch -Name $vDSwitchName | Export-VDSwitch -Description “vDS Backup” -Destination $filename
}
Disconnect-VIServer -Confirm:$false