Skip to content

HewlettPackard/vlcm-precheck-configurator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Overview

This PowerShell script automates the process of connecting to a VMware vCenter server, retrieving a list of ESXi hosts in a specified cluster (or a single host), and running a series of commands on each host to create application accounts using HPE iLO credentials. It is designed for use in HPE/VMware environments where automated account setup and configuration is required.

Features

  • Prompts for vCenter, ESXi, and iLO credentials interactively.
  • Connects to vCenter using VMware PowerCLI.
  • Retrieves all ESXi hosts in a specified cluster or operates on a single ESXi host by IP.
  • Automatic Server Generation Detection: Detects whether the server is Gen12 with iLO7 or Gen10/Gen11.
  • Uses SSH (via Posh-SSH module) to run commands on each ESXi host based on server generation:

Gen12 Servers (iLO7)

  • Creates SUT application account on iLO 7
  • Sets iSUT mode to AutoDeploy
  • Checks if AMS application account exists before creating
  • Starts AMS service using amsdv

Gen10/Gen11 Servers (iLO5/iLO6)

  • Sets iSUT mode to AutoDeploy

  • Starts AMS service

  • Outputs a summary table of results for each command on each host (including server generation).

  • Disconnects from vCenter at the end of execution.

Prerequisites

  • PowerShell: Run the script in Windows PowerShell with administrative privileges.
  • VMware PowerCLI: Must be installed and imported. Download PowerCLI
  • Posh-SSH Module: PowerShell SSH module for secure connections to ESXi hosts.
  • ESXi/iLO Credentials: You will need valid credentials for vCenter, ESXi root, and iLO.

Installing Posh-SSH Module

Run the following command in PowerShell to install the Posh-SSH module:

Install-Module -Name Posh-SSH -Force -Scope CurrentUser

Usage

  1. Open PowerShell as Administrator.
  2. If the script is blocked after downloading, unblock it first:
    Unblock-File -Path .\precheck-script\precheck.ps1
  3. Ensure Posh-SSH module is installed:
    Get-Module -ListAvailable Posh-SSH
    If not installed, run:
    Install-Module -Name Posh-SSH -Force -Scope CurrentUser
  4. Run the script:
    .\precheck-script\precheck.ps1
  5. Enter the required credentials and target cluster/host when prompted.

Example Workflow

  • The script will prompt for:

    • vCenter hostname or IP
    • vCenter username and password
    • ESXi root password
    • iLO username and password
    • Cluster name or ESXi host IP
  • It will then:

    • Connect to vCenter
    • Retrieve the list of ESXi hosts
    • Detect server generation for each host using esxcli hardware platform get (Product Name)
    • Run generation-specific commands on each host via SSH:

    For Gen12 (iLO7):

    • sut appaccount create -u <iLO user> -p <iLO pass>
    • sut -set mode=AutoDeploy
    • /opt/amsdv/bin/amsdCli appaccount check (if account found, skip create)
    • /opt/amsdv/bin/amsdCli appaccount create -u <iLO user> -p <iLO pass> (only if not found)
    • /etc/init.d/amsdv start

    For Gen10/Gen11 (iLO5/iLO6):

    • sut -set mode=AutoDeploy

    • /etc/init.d/amsd start

    • Output a summary table of results with Host, Generation, Command, and Result columns

    • Disconnect from vCenter

Output Example

Host            Gen      Cmd              Result
----            ---      ---              ------
192.168.x.x     Gen10/11 SUT Set Mode     Mode already set to AutoDeploy
192.168.x.x     Gen10/11 AMS Start        (service started)
192.168.x.y     Gen10/11 SUT Set Mode     Mode already set to AutoDeploy
192.168.x.y     Gen10/11 AMS Start        (service started)

Notes

  • Security Warning: The script converts secure strings to plain text for SSH command execution. Do not use in production without securing credential handling.
  • Host Key Handling: The Posh-SSH module automatically accepts host keys with the -AcceptKey -Force options.
  • Troubleshooting:
    • Ensure PowerCLI and Posh-SSH modules are installed
    • Run Get-Module -ListAvailable Posh-SSH to verify Posh-SSH is installed
    • Check permissions and network connectivity to vCenter and ESXi hosts
    • If SSH connection fails, verify ESXi SSH service is enabled

References

Copyright

© Copyright 2026 Hewlett Packard Enterprise Development LP

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors