How To

PowerCLI Basics – Create custom vCenter Server role

A quick post on how to create a custom vCenter Server role using PowerCLI. Cmdlets and reference pages used in this example can be found here: New-VIRole Get-VIPrivilege Create custom vCenter Server role Open PowerCLI and connect to you vCenter Server: PowerCLI C:\> Connect-VIServer <IP_or_FQDN> Enter the Administrator credentials and login. Create a custom vCenter Server role by entering the following command: PowerCLI C:\> New-VIRole -Name “<Role_Name>” -Privilege (Get-VIPrivilege -Id <Privilege A>,<Privilege B>…<Privilege X>) Press Enter. PowerCLI should […]

unhide recovery partition
PowerCLI

PowerCLI Basics – Backup and Restore ESXi Configuration Data

Here is a quick post on how to backup and restore the ESXi configuration data using PowerCLI. Cmdlets used and the corresponding reference page: Get-VMHostFirmware Set-VMHostFirmware Backup First, connect to the vCenter Server with the PowerCLI C:\> Connect-VIServer command and enter your credentials. Backup the configuration data with PowerCLI C:\> Get-VMHostFirmware -VMHost <IP_or_FQDN> -BackupConfiguration -DestinationPath <Path> For example: PowerCLI C:\> Get-VMHostFirmware -VMHost 10.10.10.21 -BackupConfiguration -DestinationPath D:\Configs\esx03 The backup file will be saved as a .tgz […]

unhide recovery partition
How To

PowerCLI Basics – Create custom ESXi ISO image

Here is a quick post on how to create a custom ESXi ISO image using PowerCLI. Cmdlets used and the corresponding reference page: Add-ESXSoftwareDepot New-EsxImageProfile Export-EsxImageProfile First, connect to the vCenter Server: PowerCLI C:> Connect-VIServer <IP_or_FQDN> Next, add the ESXi offline bundle to the depot: PowerCLI C:> Add-EsxSoftwareDepot C:VMware-ESXi-5.5.0-1331820-depot.zip Add a custom driver to the depot. I used the iSCSI Driver for Emulex: PowerCLI C:> Add-EsxSoftwareDepot C:be2iscsi-10.0.727.44-offline_bundle-1525244.zip Clone the ESXi image: PowerCLI C:> New-EsxImageProfile -CloneProfile […]

unhide recovery partition
PowerCLI

PowerCLI Basics – Import Host Profile

A quick post on how to import a host profile into vCenter Server using vSphere PowerCLI. Here is the link to the cmdlet reference page. Open PowerCLI and connect to you vCenter Server: PowerCLI C:> Connect-VIServer <IP_or_FQDN> Next, use the following to import the profile: PowerCLI C:> Import-VMHostProfile –FilePath <Path> -Name <Profile_Name> -ReferenceHost <ESXi_host_Name> For example: PowerCLI C:> Import-VMHostProfile -FilePath D:HostProfilesDefault.vpf -Name Default -ReferenceHost host-01.dr-lab-e.local Done. As you can see the host profile is now […]

unhide recovery partition
Dump Collector

ESXCLI Basics: Configure Dump Collector Host

Another basic command, but may be useful in stateless environments with no local disk usable for a diagnostic partition. Here is a quick how-to. Connect to your host through SSH or open the DCUI. Setup the VMkernel interface, remote server IP address and port: # esxcli system coredump network set -v vmk0 -i 10.10.10.10 -o 6500 Enable the remote dump collector host: # esxcli system coredump network set -e true Verify the settings: # esxcli […]

unhide recovery partition
ESXCLI

ESXCLI Basics: Configure Syslog Host

Another basic command, but essential for health monitoring of your hosts when using a Syslog Server. Here is a quick how-to. Connect to your host through SSH or open the DCUI. Setup the target Syslog Server and place logs in an unique subdirectory: # esxcli system syslog config set –logdir-unique true –loghost=udp://10.10.10.10:514 Open the ports for Syslog on the firewall: # esxcli network firewall ruleset set –e true –r syslog Apply the configuration with: # […]

unhide recovery partition
ESXCLI

ESXCLI Basics: Setup SNMP on ESXi 5.x

This is really basics stuff, but here is a quick how to. Connect to your host through SSH or open the DCUI. Setup the target SNMP server, port and community string: # esxcli system snmp set –t <ip_or_fqdn>@/<community_string> Enable SNMP: # esxcli system snmp set –e yes Logout. Done! 🙂 Verify the snmpd service is running and check if the ports are open on the host though vSphere Client or vSphere Web Client. Please note […]

unhide recovery partition
ESXCLI

ESXCLI Basics: Troubleshooting Management Network Connection on ESXi 5.x

Another quick post about ESXCLI basics. Here is a procedure how to quickly recover the Management Network functionality on your ESXi host. First, login through iLO or iDRAC or iRMC, whatever remote management solution your server is equipped with. Press F2 on Direct Console UI, provide the root password and enable ESXi Shell via Troubleshooting Options. Press ALT+F1 and log in. List vmkernel interfaces: # esxcli network ip interface list Remove vmkernel interface(s): # esxcli […]