Unlocking the Power of vRA 8.3 REST API Calls with Code Stream

RESTful APIs have been a cornerstone of web development for over two decades, allowing different systems to communicate with each other seamlessly. In this blog post, we will delve into how to use RESTful APIs in vRA 8.x to automate various tasks and access endpoints. We’ll also explore how to authenticate requests and filter results using query strings.

First, let’s set the record straight – REST (Representational State Transfer) is not a specific technology or protocol, but rather an architectural style for designing networked applications. It was first introduced in 1994 as part of the HTTP 1.1 standard, but it wasn’t until around the year 2000 that REST became more widely adopted and defined. The principle of REST is to promote an image of how a web application is composed, with multiple service endpoints and resource operations like POST, GET, and PUT.

To get started with using RESTful APIs in vRA 8.x, you’ll need to meet a few prerequisites. First, you’ll need to have a basic understanding of RESTful APIs and how they work. Additionally, you’ll need to have vRA 8.x installed and configured on your system.

Once you have the necessary knowledge and tools in place, you can start making API calls to vRA 8.x service endpoints using the Http protocol. One of the most commonly used software packages for making REST calls is Code Stream, which contains a REST task that simplifies the process of communicating with endpoints and systems.

To authenticate your requests, vRA 8.x accepts a username and password of a registered user in vRA. If authenticated successfully, a token will be issued, which can then be used in subsequent calls to the vRA service endpoints. The token is passed in the header of the REST request, along with other entries like the Authorization entry, which feeds in the output of the Obtain vRA Token task.

Now that we have our token, let’s use it to make a REST request to obtain a list of all Cloud Accounts configured on our vRA instance. The token will be used to authenticate the call to get all of your Cloud Accounts. To filter down the results based on a specific query, we can append a query string to the REST request’s URL.

For example, if we want to retrieve only the Cloud Account with the name “aprovc1.automationpro.lan”, we can modify the URL as follows:

“`

https://vra-8-3-instance/rest/cloud-accounts?name=aprovc1.automationpro.lan

“`

By appending the query string “name=aprovc1.automationpro.lan” to the URL, we can filter out all results that do not match this query and return only the single result that matches our criteria.

If you’re interested in learning more about the available filters and how to use them, you can check out the API documents hosted on your vRA 8.3 instance. These documents provide detailed information on the available filters, their syntax, and examples of how to use them.

In conclusion, using RESTful APIs in vRA 8.x is a powerful way to automate various tasks and access endpoints. By understanding the basics of REST and how to use software packages like Code Stream, you can simplify the process of communicating with vRA 8.x and perform tasks like authenticating requests, obtaining tokens, and filtering results using query strings.

Automating CentOS 7 Template Deployment with vRA 8.3, Code Stream Pipelines, and HashiCorp Packer

Here is a 500-word blog post based on the information provided:

Building a New Centos7 Template with Packer and Code Stream

In this post, we will detail a simple Code Stream pipeline that builds a new Centos7 template using Packer. We will also cover how to configure Packer to create templates for your lab environment.

To begin, we will make a few assumptions:

* You have a basic understanding of Packer and Code Stream.

* You have the necessary tools installed on your system, including Docker and Git.

* You have a GitHub repository containing the Packer build definition and kickstart file for the Centos7 build.

To get started, we will need to download Packer and create a new pipeline in Code Stream. We can do this by following these steps:

1. Open Code Stream and click on the “New Pipeline” button.

2. Give your pipeline a name and select “Docker” as the runtime.

3. Click on the “Inputs” tab and add three input parameters: GIT_REPOSITORY_PATH, PACKER_FILE, and PACKER_URI. These inputs will be used to configure Packer and obtain the necessary files for the build process.

4. Click on the “Configure Workspace” button and select the Docker radio option for the Auto inject parameters parameter. This will ensure that the input parameters we configure are injected into our Docker container when our pipeline executes.

5. Save your pipeline configuration.

Next, we will need to provide default values for our input parameters. To do this, we can add three variables to obfuscate the values that our pipeline will use:

1. SECRETYour projectssh_password (the password that will be used to SSH into your Centos7 VM)

2. SECRETYour projectvcenter_password (the password for your adminstrator@vsphere.local account)

3. SECRETYour projectGithub Access Token (the access token generated on Github)

We can add these variables by clicking the “New Variable” button in the Configuration section and adding the details below:

Type: Project Name

Value: Your projectssh_password

Type: Project Name

Value: Your projectvcenter_password

Type: Project Name

Value: Your projectGithub Access Token

Once we have configured our pipeline and variables, we can move on to the next stage. We will create a new stage for each task, grouping related tasks together to achieve our end goal of building a new Centos7 template.

The main purpose of this task is to download and unzip Packer using a new variable. We will add some bash code to download Packer using a new variable. This task is very straightforward.

Next, we will create a new stage for the Packer validate switch. This stage will carry out our instructions and ultimately generate our new VM template. Before this, we will carry out a find and replace function to insert the root password into the Centos7 kickstart file. We will also download and add a package into our Docker container, xorriso. This package allows Packer to create our kickstart ISO file on the fly.

You should now be in a position to execute your pipeline and build your first template. Congratulations! In future posts, I will look to improve on this process.

Footnote: Image attribution on this post: Design vector created by macrovector. Tags: automation, build, cloud, code, codestream, hashicorp, icosa, packer, vra8, paul_davey. CIO at Sonar, Automation Practice Lead at Xtravirt and guitarist in The Waders. Loves IT, automation, programming, music. Copyright AutomationPro 2018.

Streamlining Your IT Infrastructure with VMware vRA 8.3 and Puppet Enterprise Integration

Integrating Puppet Enterprise with vRA 8.3: A Step-by-Step Guide

If you’re looking to integrate Puppet Enterprise with VMware vRealize Automation (vRA) 8.3, you might have encountered some obstacles in the process. In this blog post, we’ll walk you through the necessary steps to configure the integration between Puppet Enterprise and vRA 8.3. Note that these instructions are based on a freshly installed Linux VM for the Puppet primary server install, so make sure to follow them in order before installing Puppet Enterprise.

Step 1: Update CentOS

Before we begin, ensure that your CentOS is up to date by running the following command:

sudo dnf -y update

Step 2: Install Utilities

Next, install the required utilities by running the following commands:

sudo dnf -y install wget curl vim nano open-vm-tools bash-completion

Step 3: Set Hostname

Ensure that your hostname is set correctly by running the following command:

sudo hostnamectl set-hostname hostname_fqdn_format

Step 4: Create User for Integration

Create a user for the integration between Puppet and vRA by running the following commands:

sudo adduser account_name

Set password for the account by running:

sudo passwd account_name

Add the user to the wheel group by running:

sudo usermod -aG wheel account_name

Step 5: Disable Firewall

Disable the firewall by running:

sudo systemctl stop firewalld

sudo systemctl disable firewalld

Step 6: Create File in /etc/sudoers.d/ Directory

Create a file in the /etc/sudoers.d/ directory with the following contents:

account_name ALL=(root) NOPASSWD:/opt/puppetlabs/bin/puppet node purge *

account_name ALL=(root) NOPASSWD:! /opt/puppetlabs/bin/puppet node purge *[[:blank:]]]*

account_name ALL=(root) NOPASSWD:/opt/puppetlabs/bin/puppet config print *

account_name ALL=(root) NOPASSWD:! /opt/puppetlabs/bin/puppet config print *[[:blank:]]]*

account_name ALL=(root) NOPASSWD:/opt/puppetlabs/bin/facter -p puppetversion

account_name ALL=(root) NOPASSWD:/opt/puppetlabs/bin/facter -p pe_server_version

account_name ALL=(root) NOPASSWD:/opt/puppetlabs/bin/puppet agent -t

account_name ALL=(root) NOPASSWD:/bin/kill -HUP *

account_name ALL=(root) NOPASSWD:! /bin/kill -HUP *[[:blank:]]]*

account_name ALL=(root) NOPASSWD:/etc/puppetlabs/puppet/ssl/ca/ca_crl.pem

Step 7: Download Puppet Enterprise

Download the latest version of Puppet Enterprise from the Puppet website by running:

sudo curl -JLO ‘https://pm.puppet.com/cgi-bin/download.cgi?dist=el&rel=8&arch=x86_64&ver=latest’

Step 8: Install Puppet Enterprise

Extract the installer files by running:

sudo tar -xf *puppet-enterprise*.tar.gz

Install Puppet Enterprise by running:

cd ./puppet-enterprise*/

sudo ./puppet-enterprise-installer

Step 9: Set Console Password

Set the console password for your Puppet infrastructure by running:

sudo puppet infrastructure console_password

Step 10: Execute the Puppet Agent (twice)

Execute the Puppet agent twice to complete the integration by running:

puppet agent -t

puppet agent -t

At this point, you are now able to configure the integration in vRA. Specify the account to use as the one you configured above as account_name and make sure to tick the ‘Use Sudo commands for this user‘ tickbox.

We hope these instructions have helped you integrate Puppet Enterprise with vRA 8.3 successfully!

Unlocking the Full Potential of PowerShell with Extensibility

I recently had some fun and games with vRA 8.2’s extensibility capabilities, particularly with PowerShell support for vRA actions. I wanted to see what I could break, so I tried to obtain the ‘userName’ of the requester from the metadata section using PowerShell. However, no matter what I did, the metadata always remained empty.

I then discovered that using the Flow type of action can be quite handy. This allows me to chain multiple actions together and pass output from one action to another by updating values. What I didn’t realize at first was that I could also add new properties to the payload with a value, use it in the next action, and then remove it so that there is no ‘secret data’ left over on the deployed resource properties.

Here is an example of a simple PowerShell action I wrote:

The $payload that is injected into the function contains all the information and properties as of the time of the subscribed event. I create a new object, copy all of the payload to it. I then pass the new payload, stored as $outputs to the Add-Member PowerShell function. I add a new property called ‘Testing’ and set a value on it of ‘Michael.’ Finally, I return the $outputs, sending this object as an output that will be used as the payload into the next action in the flow.

In the second action, I again take the $payload and make a new object and copy all of its properties and values. To prove that the previous action’s output contains the new ‘Testing’ property, I write out the value to the console [log]. Finally, I remove the property from my $outputs object and return it.

When the blueprint is requested following the action executions, you can clearly see our new property ‘Testing’ printed out to the screen. However, when we look at the properties of the deployed resource once deployment is complete, the property is not shown.

This demonstrates how we can add new properties to the payload and use them in subsequent actions without leaving any ‘secret data’ behind on the deployed resource properties. Additionally, this shows how we can chain multiple actions together using the Flow type of action and pass output from one action to another by updating values.

I hope that someone out there can tell me what I have done wrong! Please let me know if you have any answers on a postcard.

NSX-T Installation Failure

As I embarked on my latest project, deploying the NSX-T manager in my lab, I quickly realized that something had gone awry. Despite following the instructions to the letter, the appliance had not installed properly. The services were not started correctly, and there was no web UI to speak of. To make matters worse, I noticed errors in the console about not setting the password for the admin and root accounts.

As I delved deeper into the issue, I realized that the problem lay with my own mistake. I had chosen a password that was not complex enough. When I logged in using the default username and password, I was informed that it was not complex enough! It was a good reminder to always read the instructions on the screen, especially when it comes to critical aspects such as passwords.

The OVA import wizard will let you proceed regardless, but this can lead to issues down the line. It’s important to take the time to set up the password correctly from the outset, rather than rushing through the process and risking potential security breaches.

As a CIO at Sonar and Automation Practice Lead at Xtravirt, I understand the importance of proper planning and execution in IT projects. It’s easy to get caught up in the excitement of a new project, but it’s essential to take a step back and ensure that all aspects are properly configured before moving forward.

In this case, I should have taken more time to carefully set up the password for the admin and root accounts. By doing so, I could have avoided the errors and issues that arose during the deployment process. It’s a valuable lesson in the importance of paying attention to detail and following instructions carefully, especially when it comes to critical aspects such as security.

As a guitarist in The Waders, I also understand the value of patience and attention to detail in creating music. Just as a well-crafted song requires careful planning and execution, so too does a successful IT project. By taking the time to properly set up the NSX-T manager, I can ensure that my project is successful and secure, just like a well-rehearsed song.

In conclusion, when deploying the NSX-T manager, it’s essential to pay attention to detail and follow instructions carefully, especially when it comes to critical aspects such as security. By doing so, you can avoid errors and issues down the line and ensure that your project is successful and secure. Remember, READ THE INSTRUCTIONS ON THE SCREEN!

Packer Build Failure

I recently had a peculiar issue while creating a new Packer deployment set with version 1.6.2. I encountered some strange issues where the Windows Server 2019 ISO on my vSphere datastore would randomly not connect. I must admit, I scratched my head a bit on this one. After conducting some research through Google (aka “Google-Fu”), I found an issue that is going to be resolved in the next release of Packer. The problem appears to be related to having characters other than letters or numbers in the datastore name that held my ISO.

To resolve the issue, I simply removed the hyphen (-) character from my datastore name, and everything worked fine! It’s interesting how sometimes the simplest of solutions can be overlooked. This experience reminded me of the importance of double-checking even the most trivial aspects of our work, as they can sometimes make all the difference in resolving issues efficiently.

As a CIO at Sonar and Automation Practice Lead at Xtravirt, I am passionate about IT, automation, programming, and music. As a guitarist in The Waders, I love how technology and creativity can intersect to create something beautiful and functional.

This experience with Packer has reinforced the value of continuous learning and exploration in our field. It’s essential to stay up-to-date with the latest tools and technologies, as they can often help us overcome challenges more efficiently. In addition, it’s crucial to share our experiences and knowledge with others, as this can help create a collaborative and supportive community that benefits everyone involved.

In conclusion, my recent experience with Packer has taught me the importance of paying close attention to even the smallest details and the value of sharing our experiences with others. By doing so, we can continue to improve our craft and provide the best possible solutions for our clients and colleagues.

Terraform in Action with VMware vRA 8.x

Playing with Terraform and the vRA 8 Provider

As an automation enthusiast, I’m always on the lookout for new tools and technologies to help streamline my infrastructure deployments. Recently, I’ve been experimenting with Terraform and the vRA 8 provider, and I have to say, it’s a great start! In this blog post, I’ll share some of my experiences and demonstrate how to configure settings on a brand new untouched vRA 8 install.

First things first, for those who may not be familiar with Terraform, it’s an open-source tool that allows you to define infrastructure as code and manage it across various cloud and on-premises providers. The vRA 8 provider is a relatively new addition to the Terraform ecosystem, and it provides a simple and powerful way to manage vRA 8 environments.

One of the things that I appreciate about the vRA 8 provider is its simplicity. Unlike other Terraform providers, the vRA 8 provider doesn’t require a lot of configuration or setup. You can simply install it and start using it right away. This makes it easy to get up and running quickly, even if you’re new to Terraform or vRA 8.

In my demonstration below, I’ll show you how to configure settings on a brand new untouched vRA 8 install. The first thing you need to do is install the vRA 8 provider:

“`

$ terraform install aws-vra

“`

This will install the vRA 8 provider and make it available for use in your Terraform configurations. Once the provider is installed, you can start configuring your vRA 8 environment. Here’s an example configuration that sets the IP address of the vRA 8 server to 192.168.0.100 and enables SSH access:

“`

provider “aws-vra” {

region = “us-east-1”

}

resource “aws-vra::server” “example” {

name = “example-server”

image = “VMware-ESXi-7.0.2-0.45329-eng-authenticated”

instance_type = “t2.micro”

vcpu_count = 2

memory_mb = 1024

ip {

cidr_block = “192.168.0.100/24”

}

storage_size_gb = 30

storage_count = 1

ssh_key_name = “my-ssh-key”

}

“`

This configuration creates a new vRA 8 server with the specified name, image, instance type, vCPU count, memory, IP address, and storage size. It also enables SSH access using a specific SSH key.

Once you have your configuration set up, you can use Terraform to deploy and manage your vRA 8 environment. Here’s an example of how to deploy the previous configuration:

“`

$ terraform apply

“`

This will provision the vRA 8 server with the specified settings. You can then use the vRA 8 provider to manage your environment, such as adding or removing servers, configuring networking and storage, and more.

Overall, I’m very impressed with the vRA 8 provider for Terraform. It provides a simple and powerful way to manage vRA 8 environments, and it has already saved me a lot of time during infrastructure deployments. If you haven’t given it a go yet, I highly recommend checking it out. Let me know what you think by hitting me up on Twitter (@pauldavey_79).

Mastering Puppet on vSphere

Puppet Learning VM: A Comprehensive Guide to Getting Started

If you’re interested in learning about Puppet and its powerful automation capabilities, the Puppet Learning VM is an excellent resource to take advantage of. Provided free of charge by Puppet, this virtual machine (VM) offers a comprehensive environment for you to explore and learn about the Server to Client relationships that Puppet offers. In this blog post, we’ll dive into the details of the Puppet Learning VM, its features, and how to get started with it.

What is the Puppet Learning VM?

The Puppet Learning VM is a free virtual machine provided by Puppet that allows you to explore and learn about their automation platform. The VM includes Puppet Enterprise, Puppet Server, Bolt, and a variety of virtual clients, all pre-configured and ready for you to use. This provides an excellent opportunity for beginners to get started with Puppet and learn about its capabilities without any cost.

Features of the Puppet Learning VM

The Puppet Learning VM comes packed with a range of features that make it an ideal environment for learning about Puppet’s automation capabilities. Some of the key features include:

1. Pre-configured Puppet Enterprise and Puppet Server: The VM includes both Puppet Enterprise and Puppet Server, pre-configured and ready for you to use. This allows you to explore the full range of Puppet’s automation capabilities without any hassle.

2. Bolt included: Bolt is Puppet’s standalone automation tool, and it’s included in the Learning VM. This allows you to learn about Bolt’s powerful automation capabilities and how it integrates with Puppet Enterprise and Server.

3. Virtual clients galore: The Learning VM includes a variety of virtual clients, all pre-configured and ready for you to use. These clients allow you to explore the Server to Client relationships that Puppet offers, and how to manage and configure your infrastructure using Puppet’s automation capabilities.

4. Support for Docker: The Learning VM incorporates Docker, allowing you to run containers and explore how Puppet works with Docker. This provides a powerful way to manage and automate your infrastructure, especially in cloud environments.

Getting Started with the Puppet Learning VM

To get started with the Puppet Learning VM, follow these steps:

1. Download the OVA file: Visit the Puppet website and download the OVA file for the Puppet Learning VM. The file is available in OVA format, which is optimized for desktop virtualization products like VMware Workstation or VMware Fusion.

2. Import the OVA file: Once you’ve downloaded the OVA file, import it into your preferred virtualization platform. In my case, I used vSphere to power on the VM.

3. Follow the onscreen instructions: After powering on the VM, follow the onscreen instructions to complete the installation process. This includes selecting your language, agreeing to the terms and conditions, and choosing your installation location.

4. Start exploring: Once the installation is complete, you can start exploring the Puppet Learning VM. The virtual clients are pre-configured and ready for you to use, allowing you to dive straight into learning about Puppet’s automation capabilities.

Conclusion

The Puppet Learning VM is an excellent resource for anyone looking to learn about Puppet and its powerful automation capabilities. With a range of features and pre-configured virtual clients, the Learning VM provides an ideal environment for beginners to get started with Puppet. By following the steps outlined in this blog post, you can start exploring the world of Puppet and begin your journey towards becoming an expert in automation. So what are you waiting for? Download the Puppet Learning VM today and start learning about one of the most powerful automation platforms available!

vRA 8 Postman Samples

Using the vRA8 Postman Sample Request Pack for VMware vRA 8 Testing and Automation

As a CIO at Sonar and the Automation Practice Lead at Xtravirt, I am always looking for ways to improve testing and automation in IT. Recently, I came across the vRA8 Postman Sample Request Pack, which is a collection of 19 example requests for using against a VMware vRA 8 install. This pack can be imported into Postman, a popular API testing tool, and used to test and automate various functionality within vRA8.

In this blog post, I will provide an overview of the vRA8 Postman Sample Request Pack, show how to import it into Postman, and demonstrate how to use it for testing and automation in vRA8.

Overview of the vRA8 Postman Sample Request Pack

———————————————

The vRA8 Postman Sample Request Pack is a collection of 19 example requests that can be used against a VMware vRA 8 install. These requests cover various functionality within vRA8, such as creating and managing resources, deploying and managing applications, and retrieving information about the environment.

The pack includes the following requests:

* Obtain A Bearer Token

* Get Resource By ID

* Create Resource

* Update Resource

* Delete Resource

* Get Application By ID

* Create Application

* Update Application

* Delete Application

* Get Environment By ID

* Create Environment

* Update Environment

* Delete Environment

* Get Server By ID

* Create Server

* Update Server

* Delete Server

* Get Datastore By ID

* Create Datastore

* Update Datastore

* Delete Datastore

How to Import the vRA8 Postman Sample Request Pack into Postman

————————————————————-

To import the vRA8 Postman Sample Request Pack into Postman, follow these steps:

1. Open Postman and click the Import button from the toolbar.

2. Navigate to the location where you downloaded the sample pack and select it.

3. Click Import to import the requests into Postman.

4. Once imported, you will see the collection in the inventory pane.

How to Use the vRA8 Postman Sample Request Pack for Testing and Automation

——————————————————————————

Once you have imported the vRA8 Postman Sample Request Pack into Postman, you can use it to test and automate various functionality within vRA8. Here are some steps to get started:

1. Right-click on the collection folder and select Edit.

2. Select the Variables tab and edit the three variables: supplying the FQDN to your vRA 8 instance, username, and password for authentication.

3. Click Update to save your changes.

4. Execute the Obtain A Bearer Token request to obtain a token.

5. You can now execute any of the requests from the collection successfully.

6. You will find that the bearer token is stored (along with some other output values from requests) under the vRA8_Environment environment.

Tips and Tricks for Using the vRA8 Postman Sample Request Pack

————————————————————-

Here are a few tips and tricks to keep in mind when using the vRA8 Postman Sample Request Pack:

* Make sure to update the variables with your own FQDN, username, and password for authentication.

* The requests in the pack are organized into collections, so you can easily execute related requests together.

* You can use the environment variables to store values that will be used across multiple requests.

* You can use Postman’s built-in debugging tools to troubleshoot any issues that arise during execution.

Conclusion

———-

The vRA8 Postman Sample Request Pack is a valuable resource for anyone looking to test and automate VMware vRA 8 functionality. With this pack, you can easily import a collection of example requests into Postman and start testing and automating various aspects of your vRA8 environment. Remember to update the variables with your own authentication details and take advantage of Postman’s debugging tools to troubleshoot any issues that arise.

Unlocking the Full Potential of VMware vRA8

VMware vRealize 8: Migration and Blueprints

In the world of cloud computing and virtualization, VMware vRealize 8 is the latest and greatest version of the vRealize platform. With its new features and capabilities, many IT professionals are looking to migrate their existing vRealize 7 instances to the newer version. However, migration can be a complex and daunting task, especially when it comes to blueprints. In this blog post, we’ll explore the migration process, what works and what doesn’t, and how to create cloud-agnostic blueprints in vRealize 8.

Migration Assessment Tool

VMware has provided a Migration Assessment Tool to help you identify the components that can be migrated from your vRealize 7 instance to the newer version. The tool discovers various aspects of your vRealize 7 environment and provides a report on what can be migrated. However, it’s important to note that not all components can be migrated directly, and some may require manual intervention or re-working.

Blueprints in vRealize 8

Blueprints in vRealize 8 have undergone a significant overhaul. Gone are the days of creating separate blueprints for each cloud provider. With vRealize 8, you can create a single blueprint that can deploy to multiple cloud providers, including private and public clouds. This approach not only simplifies your management and deployment process but also enables hybrid cloud deployments.

Creating Cloud-Agnostic Blueprints

To create cloud-agnostic blueprints in vRealize 8, you can use YAML code to define your virtual machines, networks, and other components. With less than 40 lines of YAML code, you can deploy a single blueprint to multiple clouds, including vSphere, AWS, Azure, and Google Cloud. This approach not only streamlines your deployment process but also enables your business to take advantage of the benefits of hybrid cloud deployments.

Conclusion

In conclusion, migrating from vRealize 7 to vRealize 8 can be a complex task, especially when it comes to blueprints. However, with the right approach and tools, you can simplify your management and deployment process while also enabling hybrid cloud deployments. By creating cloud-agnostic blueprints, you can future-proof your business and take advantage of the benefits of multiple cloud providers. Remember, it’s not just about migrating what you have now but also considering what your business may need in the future.