Sunday, 8 November 2015

Reset Forgotten VMware ESXi Password.

Written by Suhas Savkoor




We don't always remember everything, correct? We have a password for our Facebook, a password for our email IDs, and passwords for our ESXi hosts.
Naturally, we tend to forget the ESXi password.

Now, if we ask VMware about how to reset a forgotten password for ESXi, the recommended solution would be to re-install. As quoted by our Knowledge Base article any other means might result in a host failure due to complex nature of the ESXi architecture.
kb.vmware.com/kb/1317898

Of course this is not recommended for our production environments where we have critical VM's running, and the must solution is to re-install. However, why not play around in our lab? Why perform a re-install for your test ESXi hosts.

There are multiple ways to reset the forgotten password, but my favorite choice would be using the Host Profiles.
Why? It's simple! And I like GUI.

Let's take a look at the steps to do this:

1. Login to your vCenter and Right Click the host which requires a password reset.
2. Select Host Profile and choose the Create Profile From Host option. This ESXi becomes the reference host for your profile. This can be applied later for multiple hosts (If required). Because you have forgotten the password for all!
3. In the Window that pops up, let's give it a name. Say ESXi_Password_Reset and a description if required.
4. Click Next > Review and Finish.

A host profile is now ready. Now, time to configure this.

1. In your vCenter Select Home > Host Profiles
2. Right click the newly created profile and select Edit profile.
3. Now, there's a bunch of options that can be configured here. But, in our case, we will select the Security Configuration (Passwords duh!) and expand it. Well, choose the Administrator password option.
4. Under the option, 'What should the administrator password be', select Configure a fixed administrator password.
5. Enter the new password and confirm it and click OK.
6. Right click the Profile again and select the option Enable or Disable profile Configuration.
7. Here out of the big list of settings, let's choose our required option, which is? You are right! Security Configuration and Click OK.

Well, we got the configuration done. Time to apply:

1. Put the host into maintenance mode. This means power off all the VMs on it, or migrate them off to a different host.
2. Go back to the hosts and clusters view and right click the ESXi host > Host Profiles > Manage profile
3. If you have multiple host profiles, carefully select the ESXi_Password_Reset profile and click OK
4. Right Click the host, again! Host Profile > Apply profile.
5. Review the changes and there we go, Click OK and we got ourselves a new password.

Time to verify:

1. Take a SSH to the host.
2. Login with root and of course, our new password.

esxcli away.