Category Archives: VMware

VMware

Unleashing the Power of LogManager in vRO

Logging in VMware vRO Just Got a Whole Lot Easier!

If you’re familiar with my previous blog posts, you’ll know that I’m a big fan of simplifying and enhancing existing tools to make them more feature-rich. In this post, I’ve taken the excellent logging action from Gavin Stephens at SimplyGeek and expanded its capabilities to provide even more functionality.

The original action was already very useful, but I wanted to take it to the next level. So, I rewrote the bulk of the action to include the following features:

* The ability to pass the log attribute as an input into each workflow component (scripts, sub-workflows, actions, etc.) and set it as an output for the component. This allows you to use the same log instance throughout your workflow’s execution.

* Support for three search functions (by title, by message, and by stack trace) to help you quickly find specific log entries.

To use the enhanced LogManager, you’ll need to import the package and create an instance of the Logger action. Then, you can start creating log entries using the LogManager instance. Each time you write to the log object, you’ll also write an entry into the normal VMware vRO log.

Here’s an example workflow that demonstrates how to use the enhanced LogManager:

“`json

{

“name”: “Example Workflow”,

“description”: “A simple workflow that demonstrates the use of the LogManager action.”,

“version”: 1,

“inputs”: {

“log”: {

“type”: “Any”

}

},

“outputs”: {

“log”: {

“type”: “Any”

}

},

“tasks”: [

{

“name”: “Write Log”,

“action”: “LogManager”,

“inputs”: {

“log”: “log”

},

“outputs”: {

“log”: “log”

},

“script”: {

“language”: “javascript”,

“content”: “log.write(‘Hello, World!’);”

}

}

]

}

“`

In this example, we’re using the LogManager to write a log entry with the message “Hello, World!” Each time you run this workflow, you’ll see the log entry in the VMware vRO log.

To view the full contents of the ‘log’ object, simply output it. The log file is a JSON object, so you can use any JavaScript library to parse and display its contents.

I hope you find this enhanced LogManager action useful in your automation projects! If you have any questions or feedback, please don’t hesitate to reach out. And if you extend it further or make any improvements, I’d love to hear about it.

Download the LogManager Package Here

Happy automating!

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).

vRA

vRA, vRO, and the Mystery of the Missing VMs

As an IT professional, I’ve dealt with my fair share of unexpected issues and head-scratching problems. But last week, I encountered something that really had me stumped. A customer had an environment consisting of vSphere, vRA, and vRO, with the usual suspects of IAAS roles duplicated and sitting behind a load balancer.

While rewriting some vRO workflows and adjusting blueprints for them, I noticed something strange happening. When I destroyed test VMs through vRA, they weren’t always deleted from the vSphere inventory. Sometimes, the VMs would be moved to a folder in the inventory with the current date and time stamp appended as a suffix to the VM name.

I have to admit, this baffled me. I spent some time digging into the issue, only to find that the solution was quite simple once I knew what to look for. The customer had multiple Windows boxes with the IAAS/Web/Dem roles separated across them, and they had this setup duplicated and sitting behind their load balancer. The setting doDeletes had been configured on just one of the IAAS role boxes.

So, depending on which box serviced the request, the VM either got deleted or got moved. It was a simple fix, but it definitely caused some temporary head-scratching!

This experience reminded me of the importance of thoroughly reviewing and understanding all aspects of the environment before implementing any changes. It’s easy to overlook seemingly minor details, only to have them cause major issues down the line.

In this case, the solution was straightforward once I knew what to look for. But, it could have easily been a more complex issue that required a lot more time and effort to resolve.

I hope that by sharing this experience, others can learn from my mistake and avoid similar head-scratching situations in their own environments. As always, thorough planning and testing before implementing any changes is essential to ensure a smooth and successful outcome.

Paul Davey is CIO at Sonar, Automation Practice Lead at Xtravirt, and guitarist in The Waders. He loves IT, automation, programming, and music.

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.

Unlocking the Power of Infrastructure As Code

Infrastructure as Code (IaC) is a practice that involves managing and provisioning infrastructure resources such as virtual machines, networks, and storage through code and configuration files, rather than through manual processes. This approach provides several benefits, including:

1. Version Control: IaC allows you to manage your infrastructure configurations in version control systems like Git, which enables collaboration, tracking changes, and rolling back to previous versions if needed.

2. Consistency: By defining your infrastructure as code, you can ensure consistency across different environments and deployments, which helps to reduce errors and improve reproducibility.

3. Reusability: IaC content can be reused across different environments and applications, which saves time and effort compared to manual configuration.

4. Faster Deployment: With IaC, you can automate the deployment of your infrastructure, which speeds up the process and reduces the risk of human error.

5. Improved Security: By defining security policies and access controls in code, you can ensure that your infrastructure is secure and compliant with regulatory requirements.

6. Better Governance: IaC provides centralized control over development, testing, and release of your infrastructure, which improves governance and reduces the risk of unauthorized changes.

7. Reduced Downtime: With IaC, you can quickly recover from outages by redeploying your infrastructure, which minimizes downtime and improves availability.

8. Improved Collaboration: IaC enables IT teams to collaborate more effectively by providing a common language and set of tools for managing infrastructure.

9. Cost Savings: By reducing manual effort and improving efficiency, IaC can help you save costs compared to traditional manual configuration methods.

However, adopting IaC also requires some investment in terms of learning the technology and changing business processes. Additionally, there may be an initial cost associated with licensing commercial versions of IaC solutions. Despite these factors, the benefits of IaC far outweigh the negatives, making it a worthwhile investment for organizations looking to improve their infrastructure management practices.

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!

Terraform

Infrastructure as Code (IaC) is a powerful concept that has revolutionized the way we manage and provision infrastructure. Terraform is an open-source tool that enables us to use IaC to define and manage our infrastructure. In this blog post, we will explore the basics of Terraform and how it can help us automate and streamline our infrastructure management processes.

What is Terraform?

Terraform is an open-source tool that allows us to define and manage our infrastructure using IaC. It provides a simple and declarative way to describe our infrastructure, and it automatically provisions and updates the resources based on the definitions we provide. Terraform supports a wide range of cloud and on-premises infrastructure providers, including AWS, Azure, Google Cloud, and VMware vSphere.

How does Terraform work?

Terraform works by using IaC to define our infrastructure. We write our definitions in plain text files, which makes it easy to learn and use. These definition files describe the blueprint of our infrastructure, including the resources we need, their properties, and how they should be configured. Terraform reads these definition files and creates a plan that outlines all the changes that need to be made to our environment. We can then apply the plan to provision or update our infrastructure.

Terraform provides several benefits over traditional infrastructure management methods. It allows us to define our infrastructure in a declarative way, which makes it easy to understand and maintain. It also enables us to version control our configurations, which makes it easier to track changes and roll back to previous versions if needed. Additionally, Terraform provides a graph that outlines all the components and settings in our plan, which allows it to map dependencies and execute as much of the plan as possible in parallel. This ensures that infrastructure changes can be carried out quickly and efficiently.

What are the key features of Terraform?

Some of the key features of Terraform include:

1. Infrastructure as Code (IaC): Terraform allows us to define our infrastructure using IaC, which makes it easy to manage and version control our configurations.

2. Declarative configuration: Terraform provides a simple and declarative way to describe our infrastructure, which makes it easy to understand and maintain.

3. Automated provisioning and updates: Terraform automatically provisions and updates our infrastructure based on the definitions we provide, which saves time and reduces errors.

4. Version control: Terraform allows us to version control our configurations, which makes it easier to track changes and roll back to previous versions if needed.

5. Parallel execution: Terraform creates a graph that outlines all the components and settings in our plan, which allows it to map dependencies and execute as much of the plan as possible in parallel.

6. Provider integration: Terraform supports a wide range of providers, including AWS, Azure, Google Cloud, and VMware vSphere. This enables us to use the same tool to manage multiple environments.

7. Custom provider development: If we need a provider that is not available, we can write our own to bridge the gap.

Conclusion

In conclusion, Terraform is a powerful tool that enables us to use IaC to define and manage our infrastructure. It provides a simple and declarative way to describe our infrastructure, and it automatically provisions and updates the resources based on the definitions we provide. With its support for multiple providers and custom provider development, Terraform is a versatile tool that can be used to manage a wide range of environments. In future posts, we will explore how to use Terraform in a VMware vSphere environment.

Mastering Terraform and vSphere

Getting Started with Terraform in a vSphere Environment – Part 1

In this series, we will explore how to use Terraform to automate the creation and configuration of a virtual datacenter in a vSphere environment. In part one, we will focus on setting up Terraform and creating the basic definitions for our infrastructure.

To follow along with this series, you will need to have the following already set up and configured:

* The basic folder structure for this series (as shown below)

* Terraform downloaded and installed on your system (available for Windows, Linux, and macOS)

* The Windows x64 version of Terraform will be used in this series

Once you have the basic setup complete, open a command prompt and navigate into the deploy_datacenter folder. Type “terraform version” and hit enter to verify that Terraform is installed correctly and to see the version you are running.

Next, we will create some stub files to define our infrastructure. We will create the following files, then edit each one in turn to provide connection details, credentials, and our infrastructure (defined in code):

* provider.tf

* provider_variables.tf

* main.tf

* variables.tf

In the provider.tf file, we will define the provider type we wish to use, along with the information that it requires. The provider_variables.tf file will declare variables that will be used to pass in our connection details and credentials. The main.tf file will tell Terraform what object we are going to manipulate (either create, amend or destroy). In this case, we will specify a ‘vsphere_datacenter‘ resource to create. The variables.tf file will describe the value we wish to pass into the main.tf file; in this case, the name of our datacenter.

Here is an overview of each file and what it contains:

* provider.tf: This file defines the provider type we wish to use and the information that it requires.

* provider_variables.tf: This file declares variables that will be used to pass in our connection details and credentials.

* main.tf: This file tells Terraform what object we are going to manipulate (either create, amend or destroy). In this case, we will specify a ‘vsphere_datacenter‘ resource to create.

* variables.tf: This file describes the value we wish to pass into the main.tf file; in this case, the name of our datacenter.

Once you have created all of the files, let’s start by editing our provider.tf file. The provider.tf file is going to define the provider type we wish to use, along with the information that it requires. You may be wondering where we are going to find this information out from. It just so happens that the documentation Terraform provides is very detailed and everything we need to know can be found here.

We will continue our journey in part two of this series, where we will generate a plan, apply the plan, and create our datacenter object. Stay tuned!

Note: This article was written by Paul Davey, CIO at Sonar, Automation Practice Lead at Xtravirt, and guitarist in The Waders. He loves IT, automation, programming, music, and is passionate about helping others learn and grow. Copyright AutomationPro 2018.

Terraforming Your vSphere Environment

In part two of this series on getting started with Terraform in a vSphere environment, we will focus on initializing the Terraform folder and producing a plan of the changes our definition will make. Before we can execute our plan, we need to ensure that the required providers exist within our project structure.

To initiate the Terraform process, we open a command prompt and navigate into our `terraform/deploy_datacenter` folder. Once in the folder, we run the command `terraform init`. This command processes the files in the current folder, looking for references to providers. In our case, it will find a reference to the vSphere provider and download it directly from Hashicorp.

Once the provider is downloaded, we have everything we need to execute our first Terraform run and create a new datacenter in our vSphere inventory. However, it’s good practice to run a plan in advance to check what will happen before we apply the changes. To do this, we save the plan output so we can run the `apply` command later, passing in the plan file.

To generate the plan, we execute the command `terraform plan -var “datacenter=our_new_datacenter” -out=newDC.plan`. This tells Terraform to create a plan recording the changes that will take place, with the datacenter variable set to our_new_datacenter. The `-out` flag specifies the output file name as `newDC.plan`.

If we check the folder, we will now see the `newDC.plan` file. However, if we try to open this file in a text editor, we won’t be able to read it! Luckily, Terraform allows us to output the plan to JSON. To do this, we use the command `terraform show -json newDC.plan`.

This will output the plan as JSON, which we can redirect to a file (e.g., `terraform show -json newDC.plan > newDC.plan.json`) and then paste the contents into our favorite JSON viewer to make viewing easier.

Now that we have our plan file saved, we can apply the plan, creating our datacenter object. We will do this in part three of this series.

In conclusion, this blog post has covered the initializing of the Terraform folder and producing a plan of the changes our definition will make before applying them to create a new datacenter in our vSphere environment. In the next part of this series, we will apply the plan and create the datacenter object.

VMware Security Alert

Hello there! If you’re here, it’s likely because you’re looking for information on the Response Matrix and its impact on various VMware products. As an IT expert, I’m here to give you the lowdown on what you need to know.

First things first: what is the Response Matrix? It’s a list of vulnerabilities in VMware products that have been identified by the CVSS (Common Vulnerability Scoring System) rating system. The ratings range from 5.3 to 9.8, with higher numbers indicating more severe vulnerabilities.

Now, let’s talk about the Response Matrix. This is a table that shows which products are affected by each vulnerability, as well as the recommended course of action for each one. The matrix is divided into three sections: Access, Identity Manager, and vRealize Automation.

For Access, the matrix lists two versions – 21.08.x and 20.10.x. For Identity Manager, there is only one version listed – 3.3.x. And for vRealize Automation, there are two versions listed – 8.x and embedded vIDM.

Now, here’s the important part: if you’re using vRealize Automation 8.x or embedded vIDM, you need to apply the fix for the vulnerabilities listed in the matrix. But wait, there’s more! If you’re using vRealize Automation 7.6, you need to apply the fix only if you have also installed vIDM.

So, which products are impacted by these vulnerabilities? Well, it’s a mix of Response Matrix Components and other affected products. The good news is that there are fixes available for all of them. You can find more information on the security advisory page.

In conclusion, if you’re using any of the affected VMware products, it’s important to take action as soon as possible to address these vulnerabilities. By applying the fixes listed in the Response Matrix, you can ensure the security and integrity of your system. So, what are you waiting for? Head over to the security advisory page now and get started on fixing those vulnerabilities!