Replacing vRealize Automation 7.x Software components with VMware Aria Automation (formerly vRealize Automation) and cloudbase-init using Microsoft PowerShell
search cancel

Replacing vRealize Automation 7.x Software components with VMware Aria Automation (formerly vRealize Automation) and cloudbase-init using Microsoft PowerShell

book

Article ID: 326035

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Use Case

  1. Run install scripts.
  2. Reboot VM.
  3. Run configuration scripts.


Symptoms:
  • You are familiar with and use the Software Component agent in vRealize Automation 7.x to manage application lifecycles on Windows-based deployments.
  • You are migrating to VMware Aria Automation 8.12+ or vRealize Automation 8.11 and prior.
  • You have Microsoft Windows devices leveraging the reboot functionality from 7.x and need to properly handle these reboots using cloudbase-init and PowerShell.


Environment

VMware vRealize Automation 8.x
VMware Aria Automation 8.12.x

Resolution

Instructions

  1. Install cloudbase-init per Windows Automation Assembler image for vSphere (vmware.com)
  2. Set allow_reboot=True in cloudbase-init.conf
  3. Apply the workaround as described in this Issue Network is in a disconnected state when using cloudbase-init and Static IP network assignment · Issue #38 · cloudbase/cloudbase-init · GitHub
  4. Add the below example to a blueprint / Cloud template.image.png
    1. The PowerShell script must be idempotent
    2. This script has 3 stages.
      1. Stage 1: Creates C:\reboot directory, runs a PowerShell command, and exits with code 1003.
      2. Stage 2: Exit code 1003 triggers a reboot. Cloudbase-init reruns userdata plugin (idempotent requirement)
      3. Stage 3: The script runs another PowerShell command.
  5. Submit a new VM build request using this template.
  6. Examine there are three reboots within the provisioned VM.
    1. Reboot from sysprep
    2. Reboot from winlogon.exe
    3. Reboot from python.exe
  7. Examine script output and errors in <InstallDir>:\Program Files\cloudbase solutions\cloudbase-init\log\cloudbase-init.txt
    1. See example below:image.pngimage.png​​​​​


Additional Information

Cloudbase-init Reference
https://cloudbase-init.readthedocs.io/en/latest/tutorial.html

See the Attachments section of this article for a Sample Cloudbase-init Cloud template.

Multipart Userdata example

Attachments

SampleCloudbaseinitCloudTemplate get_app