Sunday, February 25, 2018

How to find and install VMware PowerCLI Module

As most of us would be already aware that, VMware PowerCLI is now available as a PS module and can be installed directly from Microsoft Powershell Gallery, in this post I'll summaries the process of online and offline installation of PowerCLI.

PS commands to be used:

Get-Module : To list the available/already installed modules on you local machine
Find-Module : To find the available modules in an Online PS Gallery
Install-Module : To download and install the specified module from an online gallery
Save-Module : To download and sad save a PS module for offline use

Online installation of PowerCLI : To install the PowerCLI from Microsoft PS gallery, follow these steps,

  • If you are not sure about the name of the actual VMware PowerCLI module, use below cmd to find the same,

Find-Module -name *VMware*

  • Once you have identified the module name, use Install-Module CMD to install it.
          Here we will install VMware "VMware.PowerCLI"

Install-Module -Name VMware.PowerCLI


Press Y [yes] or A[yes to all], when prompted.

Depending upon your internet connection speed, it would take some time in downloading and installing the requested PS module, once done then close the current Powershell sessions and restart it, now newly installed PowerCLI module will load and you can use it.

In case if you want to limit the scope of this module to current-user only then use following command instead, 

Install-Module -Name VMware.PowerCLI –Scope CurrentUser

Offline installation of PowerCLI: To download and install VMware PowerCLI Module follow these steps,
  • On a a system which is connected to internet, you can save the VMware PowerCLI module to your desired location using Save-Module cmd.
  • Now, we can copy this module (downloaded folders) to a system which is not connected to internet, and place them in a location where PowerShell can find them, modules folders can be confirmed by typing $ENV:PSModulePath at the PowerShell prompt.
Local User: $home\Documents\WindowsPowerShell\Modules 
All Users: $pshome\Modules


Once you copied these folder to the the modules folders and restarted the PowerShell window, the modules will automatically load this time and you can use them now.


That's it... :)


Thursday, February 22, 2018

How to reset iLO login password from within ESXi Shell

This is something could be useful if you are unable to recall the HP iLO login password.

Follow these steps to reset iLO password from esxi host
Create a file named reset_ilo_pwd.xml in tmp folder under root with the below info and add the new password in the password section:

<ribcl VERSION=”2.0″>
<login USER_LOGIN=”Administrator” PASSWORD=”password“>
<user_INFO MODE=”write”>
<mod_USER USER_LOGIN=”Administrator”>
<password value=”YOUR-NEW-PASSWORD”/>
</mod_USER>
</user_INFO>
</login>
</ribcl>

Alternatively you can create this file by copying these lines to notepad and then saving it as reset_ilo_pwd.xml file, now upload it to /tmp directory of your ESXi host using any ftp client like Winscp.

Now use the following command to commit the administrator password information from the file (reset_ilo_pwd.xml) to iLO using the below command

 
./hponcfg -f /tmp/reset_ilo_pwd.xml

This is it, now you should be able to login to iLO of your ESXi host using the password specified in the above xml file.

Additional Info: HPE offers support for the iLO features available on ProLiant servers with the HP Online iLO Configuration aka HPONCFG utility. HPONCFG can be used to set up and reconfigure the iLO (Integrated Lights-Out) management controller of a server.

HPONCFG is an online configuration tool used to set up and reconfigure iLO without requiring a reboot of the server operating system. The utility runs in a command-line mode and must be executed from an operating system command line on the local server. HPONCFG enables you to initially configure features exposed through the RBSU or iLO.
You can also use HPONCFG to reset the ILO from ESXi host and many other things.
Browse to /opt/hp/tools and execute the below command to reset the HP ILO configuration.

./hponcfg -r 

Before using HPONCFG, the iLO Management Interface Driver must be loaded on the server. HPONCFG displays a warning if the driver is not installed.
In case if its not already present on the server, you may download and install from following links: 
* HPE ESXi Utilities Offline Bundle for VMware vSphere 6.0 *

* HPE ESXi Utilities Offline Bundle for VMware vSphere 6.5 *


That's it... :)


Wednesday, February 7, 2018

How to reset HP iLO over ssh or remotely

Lately I faced this issue, where I was unable to login to iLO of one of my HP ProLiant server instead there was a ssh connection related error on login page.


I had seen this error during the iLO firmware upgrade in past but not any other time.

As I did upgrade this ProLiant server’s Firmware/Drivers last day using the latest HP Service Pack forProLiant (aka HP SPP) so, it had the latest iLO firmware ver 2.55 installed and I was sure everything was working as expected post SPP upgrade.

We tried few things to resolve the issue and eventually resting the iLO fixed the issue, as iLO web login was not available so we had to reset it via command line by connecting to iLO over ssh.

You would be able to access iLO over ssh only if you didn’t disable it during the initial iLO configuration (By default iLO ssh access is enabled).

The steps to reset the HP iLO over ssh are follows:-
  1. Open Putty (or any other ssh client) and connect to the iLO controller using its IP address or FQDN
  2. Login with iLO administrator credentails (or an account with equivalent rights)
  3. Once connected to iLO, issue the following command:
   cd /map1

Press Enter
  1. Then type
   Reset

Press Enter

Command and its output would be something like this on CLI:

hpiLO-> cd /map1

status=0
status_tag=COMMAND COMPLETED

hpiLO-> reset

status=0
status_tag=COMMAND COMPLETED

Resetting iLO.

CLI session stopped

The iLO controller will begin to reset itself. Resetting the controller fixes a lot of hung-up and freezes issues on the interface.

Note: In case of any issue, HPE always recommends upgrading the firmware on the iLO controller as the first thing and as it doesn’t require reboots or downtime so can be done anytime.

Additional resources:   

That's it... :)


Saturday, February 3, 2018

Extended LUN size but unable to increase the datastore size from vCenter

You might have seen this issue where in vCenter managed environment, you want to expand the datastore size and Storage team has confirmed that they have increased the respective LUN size and the same is reflecting in datastore properties under Device capacity however when you click on increase under Volume Properties, there is no extent available.


I had seen such issue in past but when adding additional extents, not when increasing datastore size.

vCenter Server calls a specific function to get all the available extents for that datastore. After getting extents, vCenter Server displays the extents as available if they meet these criteria filters:
  • LUNS are not used as datastores on that host or on any other host (with exceptions to force mounted volumes).
  • LUNS are not used as Raw Device Maps(RDMs) on that host or any other host.
vCenter Server applies these filters to stop any possible data corruption on already used LUNs by other host.
VMware recommends you to not to turn off the filters. Before making any changes to the LUN filters, contact the VMware Support team. 

When you connect directly to the ESX host, these filters do not exist and hence you can see the extents.
  
To work around this issue, you need to connect to the ESXi directly using 'root' credentials and then increase the volume size from there, once done then re-scan all ESxi hosts for storage. 
Once you do that the expended datastore would be visible to all other ESXi hosts as well. 

Related VMware KB article :- 1011754


That's it... :)


Conflicting VIBs error during ESXi upgrade using ISO image

You might have came across this error where, trying to upgrade the ESXi host using OEM provided Custom ESXi image or may be with VMware provided ESXi image and the upgrade got aborted with the CONFLICTING_VIBs ERROR.


In order to successfully complete the ESXi upgrade, one need to to do the following:

  • Connect to host over ssh using putty and run the following command find the exact name of vib

       # esxcli software vib list | grep “displayed conflicting vib”
  •  Once you identified the exact vib name, then just remove it by using following command

       #esxcli software vib remove -n “actual name of conflicting vib”

Note: Please do an impact analysis before you proceed with vib removal.

Now you boot up the host using ESXi ISO image and complete the upgrade (this time you shouldn’t see earlier previous conflicting vib error).


That's it... :)