VM Management Automation (Part 3)

9/12/2015

Practical Automation Use Cases

The true value of VMware vRealize Orchestrator (vRO) becomes evident when repetitive administrative tasks are transformed into reusable workflows. Instead of developing a unique workflow for every operational request, organizations can create a generic Remote Script Execution workflow and simply provide different scripts as inputs.

This section walks through common enterprise maintenance tasks that infrastructure teams routinely perform across hundreds of Linux and Windows virtual machines.


Use Case 1 – Changing the Root Password Across Linux Virtual Machines

Scenario

Following a quarterly security audit, the Information Security team requests immediate rotation of the root password across all production Linux servers.

Manually logging into hundreds of servers is impractical and increases the risk of inconsistencies.

Using vRO, administrators can execute the password change simultaneously across all selected virtual machines.


Workflow

Administrator



Select Linux Folder



Provide New Password



Execute Password Rotation Script



Capture Output



Generate Summary Report

Bash Script

#!/bin/bash

echo "Updating root password..."

echo "root:NewPassword@123" | chpasswd

if [ $? -eq 0 ]
then
    echo "Password updated successfully."
else
    echo "Password update failed."
fi

Expected Output

Server : APP-LINUX-001

Status : SUCCESS

Password Changed

----------------------------------

Server : APP-LINUX-002

Status : SUCCESS

Password Changed

Use Case 2 – Changing an Application User Password

Many enterprise applications run using dedicated service accounts.

Examples include:

  • oracle
  • weblogic
  • tomcat
  • jboss
  • mqm
  • appuser

Changing these passwords manually is time-consuming and often overlooked.


Bash Script

#!/bin/bash

echo "Changing application password..."

echo "appuser:Application@2025" | chpasswd

echo "Completed"

Typical Execution Flow

Get Linux VMs



Authenticate



Upload Script



Execute



Log Success



Continue

Use Case 3 – Deploying Security RPM Packages

One of the most common enterprise maintenance activities involves deploying updated RPM packages to address newly identified security vulnerabilities.

Instead of manually copying RPM files to every server, administrators can automate the process.


Example

Security Advisory



openssl-1.0.2.rpm



Copy Package



Install RPM



Verify Installation



Generate Report

Bash Script

#!/bin/bash

echo "Installing RPM..."

rpm -Uvh /tmp/openssl.rpm

echo "Installation Completed"

Verification

rpm -qa | grep openssl

Expected Output

VM : WEB-101

RPM Installed

-------------------------

VM : WEB-102

RPM Installed

-------------------------

VM : WEB-103

Already Updated

Use Case 4 – Operating System Hardening

Many organizations maintain standard hardening scripts based on security policies.

Examples include:

  • Disable root SSH login
  • Configure password complexity
  • Remove unused packages
  • Disable unwanted services
  • Configure audit logging
  • Update login banners

Rather than implementing these changes manually, administrators execute one standard hardening script.


Sample Script

#!/bin/bash

echo "Disabling Telnet..."

systemctl disable telnet

systemctl stop telnet

echo "Disabling FTP..."

systemctl disable vsftpd

systemctl stop vsftpd

echo "Completed"

Typical Workflow

Select Production Linux Folder



Execute Hardening Script



Collect Output



Generate Compliance Report

Use Case 5 – Restarting Middleware Services

Application support teams frequently request middleware service restarts after deployments.

Examples include:

  • Apache
  • Nginx
  • Tomcat
  • WebLogic
  • JBoss

Bash Script

#!/bin/bash

echo "Restarting Apache..."

systemctl restart httpd

systemctl status httpd

echo "Completed"

Result

APP01

Apache Restarted

------------------

APP02

Apache Restarted

------------------

APP03

Failed

Reason:

Service Not Installed

Use Case 6 – Cleaning Temporary Files

Large application servers often accumulate temporary files that consume disk space.

Example cleanup script:

#!/bin/bash

echo "Cleaning Temporary Files..."

rm -rf /tmp/*

yum clean all

echo "Cleanup Completed"

Output

Server

APP01

5.3 GB Recovered

----------------

APP02

7.1 GB Recovered

Use Case 7 – Executing Batch Scripts on Windows Virtual Machines

Windows administrators can execute Batch files using the same workflow.


Batch Script

@echo off

echo Server Name

hostname

echo.

echo IP Configuration

ipconfig

echo.

echo Completed

Execution Flow

Authenticate



Upload BAT File



Execute



Collect Console Output



Delete BAT File

Output

WIN-APP01

Completed Successfully

----------------------

WIN-APP02

Completed Successfully

Use Case 8 – Executing PowerShell Scripts

PowerShell provides greater flexibility than Batch scripts and is widely used for Windows automation.


Example

Write-Host "Hostname"

hostname

Write-Host ""

Get-Service spooler

Write-Host ""

Write-Host "Completed"

Sample Output

Hostname

WIN-APP01

Status

Running

Completed

Use Case 9 – Rebooting Project Virtual Machines

Project teams often request scheduled reboots after monthly maintenance.

Instead of rebooting servers individually, vRO can identify all virtual machines belonging to a project and reboot them automatically.


Workflow

Select Project Folder



Verify Power State



Notify Users



Reboot Virtual Machines



Verify Availability



Generate Report

Linux Reboot Script

#!/bin/bash

echo "Rebooting..."

shutdown -r now

Windows Reboot Script

shutdown /r /t 30 /f

Example Report

Project

SAP Production

----------------------

Servers

25

----------------------

Successful

25

----------------------

Failed

0

----------------------

Completed

18 Minutes

Use Case 10 – Executing Emergency Maintenance

Critical vulnerabilities occasionally require immediate action across every virtual machine.

Examples include:

  • Updating OpenSSL
  • Removing vulnerable packages
  • Deploying new certificates
  • Updating monitoring agents
  • Restarting affected services

Instead of developing a new workflow, administrators simply upload a new script to the existing Remote Script Execution workflow.

The same workflow continues to be reused regardless of the maintenance activity.


Sample Enterprise Execution Dashboard

-------------------------------------------------------

Workflow

Remote Linux Script Execution

-------------------------------------------------------

Target Servers

250

Completed

243

Failed

7

Execution Time

32 Minutes

Average Time Per VM

7 Seconds

-------------------------------------------------------

Failures

SSH Authentication : 3

Powered Off : 2

Network Timeout : 1

Disk Full : 1

-------------------------------------------------------

Benefits Observed in Production

After implementing a reusable Remote Script Execution workflow, operations teams typically experience measurable improvements:

  • Reduced maintenance windows from several hours to under one hour.
  • Standardized execution across Linux and Windows environments.
  • Improved compliance through consistent script execution.
  • Faster response to security vulnerabilities.
  • Centralized logging and audit reporting.
  • Elimination of manual SSH and Remote Desktop sessions for repetitive tasks.
  • Reusable workflows that support a wide range of operational activities with minimal modification.

By treating scripts as interchangeable inputs to a generic workflow, vRealize Orchestrator becomes a powerful automation platform capable of supporting day-to-day infrastructure operations at enterprise scale.


Coming Up in Part 4

The final section focuses on scaling workflows for large environments, optimizing parallel execution, handling failures gracefully, implementing operational best practices, and sharing lessons learned from real-world enterprise deployments using VMware vRealize Orchestrator.