views

Search This Blog

Thursday, August 5, 2021

Configure vRealize Automation using Terraform


 You probably are aware of the VMware has a HashiCorp Terraform provider. which we can be used to configure our vRealize Automation (vRA) infrastructure as well requesting deployments. In this blog I am going to cover, how to configure cloud account for Vsphere .

 

In upcoming blog, I will cover how to configure below resource using Terraform .

 Cloud account for AWS,

Cloud account for Azure

Cloud account for google. 

Cloud Zone

Project

Images

Flavors

Create a vRA Cloud Account for Vsphere :-

I have created a  folder to hold my Terraform configuration files:

main.tf – this is my main terraform file in which I am describing the desired state of my environment

terraform.tfvars – used for setting variable values

variables.tf – used for declaring variables

Create a new file called “main.tf” and define the required providers block to be used, in this blog, we are not going to define any version but by defult going to use latest version. Following this, create a provider block called “vra” and Second block to be created as a data source and for this we will pull vSphere information for cloud account. The third block is a resource block, meaning that something will be created, in this case we have a resource  “vra_cloud_account_vsphere.



.  provider "vra" {
  url           = var.url
  refresh_token = var.refresh_token
  insecure      = var.insecure // false for vRA Cloud and true for vRA 8.0
}


data "vra_region_enumeration_vsphere" "vca01" {
  username                = var.username
  password                = var.password
  hostname                = var.hostname
  accept_self_signed_cert = true
}

resource "vra_cloud_account_vsphere" "this" {
  name        = "tf-vsphere-account"
  description = "foobar"
  username    = var.username
  password    = var.password
  hostname    = var.hostname
  
regions                      = data.vra_region_enumeration_vsphere.inprmvca01.regions
  accept_self_signed_cert      = true

  tags {
    key   = "Cloud"
    value = "Vsphere"
  }
}


The next file is “variable.tf” and  where the variables are defined. Each variable block is created with the variable name. below are the example. 


variable "refresh_token" {
}

variable "url" {
}

variable "insecure" {
}

variable "username" {
}

variable "password" {
}

variable "hostname" {
}

Generating an API token 

 Terraform to authenticate with the vRealize Automation API we need have API token – this can either be an access token or a refresh token. In my lab I have generated refresh_token. Access and Refresh tokens are based on your login credentials and expire in 8 hours or 6 months respectively but share the scope and permissions as your user account and cannot be revoked without disabling the account. For vRealize Automation 8 (on-premises) you will need to use the instructions or scripts provided to retrieve a refresh token.


In Final step need to define the values of each variable. Let’s create a “variables.tfvars” file and enter your environmental details in the file, as per the below example.

refresh_token = "7wq3LMUWCARyEbcGaQUj6hb14gv7w2XE"
url = "https://vra08.mylabs.com"
insecure =false
username = "randhirkumar.chaubey"
password = "XXXXXXXXXXXXXX"
hostname = "vca01. mylabs.com"

The provider vra definition references the two variables we’ve configured in the terraform.tfvars file through the “var” keyword. Now we can run terraform init to see if the provider configures successfully.


The provider is initialized and is ready to start configuring vRealize Automation! 

 

Now we can see at first glance what this will going to  create a new Cloud Account named “tf-vsphere-account”, using the variables declared in variables.tf.  Executing terraform plan will describe what will happen if we run the code: 


Once you run the “terraform plan” and confirm everything looks correct then after run “terraform apply” to create resource (Cloud account for Vsphere).  

 

When command has been finished successfully without error, then you will see new Cloud account for Vsphere in vRA with the properties configured as we set in the “Main.tf” file. 


I hope you enjoy reading this blog as much as I enjoyed writing it. Feel free to share this on social media if it is worth sharing.





Sunday, July 11, 2021

VMware vRealize Automation Migration from 7.x to 8.X

 Free Course sponsor by vmware for VMware vRealize Automation  Migration from 7.x to 8.X

 

If you interested to Learning VMware vRealize Automation Migration from 7.x to 8.X.  ELearning course available at VMware Customer Connect Learning.

 

To acces this course VMware vRealize Automation Migration [v7.x to v8.X] ,  Click on this Link -vRealize Automation Migration from 7.x to 8.2

 

Here we go Click on Get Started to Start this Course.



Course Module :-


  1. Course Introduction
    • Migrating from vRealize Automation 7 to vRealize Automation v8
    • Component Mapping Between vRealize Automationv7 .x and vRealize Automation v8.2
    • Limitations of the Migration Assistant
    • Introduction to the Migration Assistant Tool

 

 

  1. Extensibility Migration
    • Use the vro-migrate command
    • Migrate subscriptions
    • Migrate the XaaS blueprints

 

  1. Using the Migration Assistant
    • Migration Strategies
    • Running an Assessment
    • Running the Migration
    • Reviewing the Migrated Data

By the end of the course, you should be able to meet the following objectives:

  • Describe the differences between the features of vRealize Automation v7 and vRealize Automation v8.2
  • Identify the value and advantages of upgrading to vRealize Automation v8.2
  • Describe the vRealize Automation v7 .x upgrade path
  • Map the components between vRealize Automation v7 and vRealize Automation v8.2 as part of your migration preparation
  • Describe the items that cannot be automatically migrated by the vRealize Automation Migration Assistant tool
  • Plan the migration and redesign for items that cannot be automatically migrated
  • Describe the difference between migration assessment and Migration Assistant
  • Describe the features of the Migration Assistant tool
  • Use the vro-migrate command
  • Migrate subscriptions
  • Migrate the XaaS blueprints
  • Describe the advantages of the greenfield strategy and brownfield migrations
  • Describe the advantages of using migration as a redesign or consolidation opportunity
  • Use tags to place resources
  • Use a business group-based migration approach
  • Configure endpoints for the vRealize Automation Migration Assistant
  • Run an assessment
  • Analyze your assessment
  • Migrate the infrastructure
  • Migrate subscriptions
  • Migrate deployments
  • Review the migrated components

 

Hope you will enjoy ........

Sunday, June 27, 2021

What is new in VMware vRealize Automation 8.4.2


VMware vRealize Automation 8.4.2 has  released as on June 24, 2021. With this release, VMware has provided several enhancements and new capabilities.

 

vRealize Automation 8.4.2 adds to the vRealize Automation 8.3 capabilities to bring it closer in capability to the vRA 7.x release, reintroducing key capabilities like XaaS and adding capabilities such as Powershell support in ABX and python, node.js and Powershell in vRO.

 

The many benefits of vRealize Automation 8.4.2 include: 


Disks added through vRO and extensibility reflected on deployment (topology) diagram.

Disks that were added using vRO workflows or ABX with vRA APIs at the time of initial provisioning are also reflected on the deployment design canvas. All current day 2 actions are available for these disks.


Support for Microsoft Azure Disk Encryption Set

The Microsoft Azure disk encryption set supports:

  • Disk Encryption feature for Microsoft Azure independent disks (independent managed disks) in vRA
  • Disk encryption feature for Day 2 action "Add Disk"


Property group enhancements (vRO, secrets)

Property groups can now:

  • Use vRO workflows for dynamic external values to define properties .
  • Bind secrets to property groups in order to reuse multiple secrets.


Shared IP range for multiple networks

It is now possible for vRA to assign same IP range coming from internal or external IPAM to multiple networks.


Provider Events triggered upon tenant resource CRUD

Events in the provider organization enable the provider to trigger subscriptions and write in the CMDB etc. (or for billing purposes). These events are only for resources that the provider must have visibility into. No deployment level events are triggered in the provider org, for tenant deployments.


Limit the number of namespaces for a project on a K8s zone

Prior to this, there was no per K8s zone limit for projects. This feature introduces a configurable limit for the max number of supervisor namespaces that can be deployed for the project on a given K8s zone.


Support for Snapshot management of Microsoft Azure disks


The Microsoft Azure disk snapshot management now supports:

  •    Disk Snapshot Enumeration
  •    Day 2 action for deleting Disk Snapshot from Machine
  •    Compatibility for Managed Disk Snapshot – Resource Group, Encryption set, Network policy, Tags as parameters.


Deploy Windows VMs for vRealize Automation Installation using vRealize Suite Lifecycle Manager 2.0

Deploy Windows VMs for vRealize Automation Installation using vRealize Suite Lifecycle Manager 2.0 In this post I am going to describe ...