Tag Archives: Automation - Page 2

Pre-installed ESXi 6.0 on SD Cards or Flash Drives

Many ESXi installations are running on SD Cards or flash drives. In my opinion, it's a good practice. The hypervisor itself requires about 150MB, and the full installation on a SD Card is less than 1GB, without diagnostic partitions. VMware recommends using a 4GB or larger USB/SD device. When you want to install ESXi and you don't use auto-deploy, install servers or other automation tools you typically have to mount an ESXi ISO file to your server management system (iLO, iDRAC,...) or work with a physical installation media. This is somewhat slow and uncomfortable, but there is a little trick to make the installation faster.

You can prepare the USB/SD device with the ESXi installer, plug it into your server and install it to the device itself by overwriting the installer. You can also use customized installers when your hardware requires special drivers. Read more »

vSphere 6.0 - How to use ESXCLI Commands in PowerCLI

PowerCLI, a set of PowerShell extensions for vSphere, is a great tool for automating VMware configuration and management tasks. It allows you to change a lot of ESXi host and vCenter settings. One powerful cmdlet is Get-EsxCli which allows you to run ESXCLI tasks from your PowerCLI console. ESXCLI is the main configuration command on an ESXi host. This post explains how to use the Get-EsxCli cmdlet.

get-esxcli

Read more »

Unattended VMware vSphere Client Installation (One-Click Install)

The VMware vSphere Client has an unattended install feature. This feature allows to install the client automatically without interaction. I wrote a little batch file which automatically downloads and installs all versions of the vSphere Client with one click.

vsphere-client-one-click-install

Download: install-vsphere-client.zip

Ensure that you run the script as administrator:
run-as-administrator
install-vsphere-client-all.bat

@echo off
bitsadmin.exe /transfer "4.1" http://vsphereclient.vmware.com/vsphereclient/1/6/5/1/0/2/3/VMware-viclient-all-4.1.0-1651023.exe %tmp%\VMware-viclient-all-4.1.0-1651023.exe
bitsadmin.exe /transfer "5.0" http://vsphereclient.vmware.com/vsphereclient/1/9/1/7/4/6/9/VMware-viclient-all-5.0.0-1917469.exe %tmp%\VMware-viclient-all-5.0.0-1917469.exe
bitsadmin.exe /transfer "5.1" http://vsphereclient.vmware.com/vsphereclient/2/3/0/6/3/5/6/VMware-viclient-all-5.1.0-2306356.exe %tmp%\VMware-viclient-all-5.1.0-2306356.exe
bitsadmin.exe /transfer "5.5" http://vsphereclient.vmware.com/vsphereclient/1/9/9/3/0/7/2/VMware-viclient-all-5.5.0-1993072.exe %tmp%\VMware-viclient-all-5.5.0-1993072.exe
bitsadmin.exe /transfer "6.0" http://vsphereclient.vmware.com/vsphereclient/VMware-viclient-all-6.0.0.exe %tmp%\VMware-viclient-all-6.0.0.exe

start /wait %tmp%\VMware-viclient-all-4.1.0-1651023.exe /q /s /w /L1033 /v" /qr"
start /wait %tmp%\VMware-viclient-all-5.0.0-1917469.exe /q /s /w /L1033 /v" /qr"
start /wait %tmp%\VMware-viclient-all-5.1.0-2306356.exe /q /s /w /L1033 /v" /qr"
start /wait %tmp%\VMware-viclient-all-5.5.0-1993072.exe /q /s /w /L1033 /v" /qr"
start /wait %tmp%\VMware-viclient-all-6.0.0.exe /q /s /w /L1033 /v" /qr"

del %tmp%\VMware-viclient-all-4.1.0-1651023.exe
del %tmp%\VMware-viclient-all-5.0.0-1917469.exe
del %tmp%\VMware-viclient-all-5.1.0-2306356.exe
del %tmp%\VMware-viclient-all-5.5.0-1993072.exe
del %tmp%\VMware-viclient-all-6.0.0.exe

If you need one specific version only:
install-vsphere-client-5-5.bat

@echo off
bitsadmin.exe /transfer "5.5" http://vsphereclient.vmware.com/vsphereclient/1/9/9/3/0/7/2/VMware-viclient-all-5.5.0-1993072.exe %tmp%\VMware-viclient-all-5.5.0-1993072.exe
start /wait %tmp%\VMware-viclient-all-5.5.0-1993072.exe /q /s /w /L1033 /v" /qr"
del %tmp%\VMware-viclient-all-5.5.0-1993072.exe

install-vsphere-client-6-0.bat

@echo off
bitsadmin.exe /transfer "6.0" http://vsphereclient.vmware.com/vsphereclient/VMware-viclient-all-6.0.0.exe %tmp%\VMware-viclient-all-6.0.0.exe
start /wait %tmp%\VMware-viclient-all-6.0.0.exe /q /s /w /L1033 /v" /qr"
del %tmp%\VMware-viclient-all-6.0.0.exe

How to Create a Cron Job on vMA

The vMA (vSphere Management Assistant) is a virtual appliance provided by VMware that allows to manage vCenter Server or ESX Hosts and run scripts. You can also use it to run script periodically with cron. It is a small linux appliance delivered with all necessary tools out of the box. I usually deploy a vMA on each platform. This post describes how to prepare scripts to be used with cron and how to create cronjobs. The process is very similar on all vMA versions from vSphere 4.0 to vSphere 5.5.

Read more »

Unattended ESXi Installation from an USB Flash Drive

I was asked if it is possible to create an USB Flash Drive that can install ESXi on a server automatically. ESXi has a Scripted Install feature which allows to put all installation parameters into a Kickstart file to run unattended Installations. This post explains how to create an USB Flash Drive that does unattended ESXi installations. You can plug it into a Server, power it on and ESXi will be installed automatically.

Read more »

Create a Bootable ESXi Installer USB Flash Drive

For servers without CD drive or remote KVM you might want to use an USB Flash Drive to install ESXi to the hardware. This post explains how to create a bootable ESXi Installer USB Flash Drive in less than 2 minutes. The Flash Drive will work totally identical to an Installable CD.

esxi-installer-rufus

Read more »

Howto: ESXi SSH Public Key Authentication

Shell access to an ESXi host provides essential maintenance, configuration and troubleshooting commands. It can be used in cases that cannot be handled through the standard vSphere Client. In my case, I tend to have SSH activated by default. From a security perspective it is recommended to keep SSH disabled, but with the management network behind a firewall I feel secure.

If you are using SSH daily I am sure that you are familiar with the public key authentication. PKI is an authentication method that relies on a generated public/private keypair and enables the login without entering a password. This method is faster and more secure than entering a password manually because every administrator can have his own public/private keypair.

This post explains the methods how to enable and automate public key authentication with ESXi Hosts.

ssh-esxi-pki

Read more »

VM Export/Import PowerCLI Script

I wrote this little script snippet to export and import virtual machines from one vCenter to another. This might help for migrations where you have to add virtual machines from a datastore manually to the vCenter inventory. This script does not export any virtual machine disks or configuration files. It's only supposed as replacement for adding virtual machines from an existing datastore the the inventory.

Read more »

Howto use ESXCLI in PowerCLI

PowerCLI, a set of PowerShell extensions for vSphere, is a great tool for automating VMware configuration and management tasks. It allows you to change a lot of ESXi host and vCenter settings. One powerful cmdlet is Get-EsxCli which allows you to run ESXCLI tasks from your PowerCLI console. ESXCLI is the main configuration command on an ESXi host. This post explains how to use the Get-EsxCli cmdlet.

get-esxcli

Read more »

Ruby vSphere Console Namespace Diagram

Ruby vSphere Console (RVC) is a new interactive object oriented command line utility. The vSphere inventory is presented as a tree structure. It is a new tool allowing you to do basic administrative tasks more efficiently. To get an overview I've created a diagram containing all namespaces. I hope it can help you to get an overview of the command tree.

ruby-vsphere-console-rvc-namespaces