Request a vSphere Lab?

One of the advantages of my job is: unprecedented access to vendors and resources! If there is a specific lab you would like to see, just comment on this post and I will try to get it done!

I am approaching a long bit on-the-road (until January 25th!), so no promises as to how quickly I can complete and post a lab. I can work remotely, though, so go ahead and request!

Install ESXi 6 to a physical server with IPMI

ESXi 6 on a HP Blade Server with iLO

We are going to install ESXi 6 on a physical server using HP’s IPMI interface known as iLO to perform the install. iLO is considered best-in-class for IPMI consoles, but still can take some getting used to. IPMI out-of-band interfaces collectively have the advantage of allowing users to:

  • Power servers on and off
  • Connect to ISO and FLP media
  • Input commands and view the console interface, including blue, purple and red screens that would not be visible with an in-band console

image002

First we are going to choose Image (by the picture of the CD/DVD)

image004

Then connect to the HP customized ESXi image that we just downloaded. Always use the vendor customized ESXi image for physical installs, when one is available

image006

Now click on the power icon and choose: Momentary Press

iLO Momentary Press

Wait a good long time to even see this

image010

And another good long time before the CD/DVD starts to load. When installing ESXi 6, the DVD will load to RAM (which is what you see happening below) and then the hypervisor will start.

image012

When the hypervisor has started, the screen will become yellow and grey, like below. The process speeds up from here.

image014

[Enter]

image016

[F11]

image018

Wait, just a few seconds (usually).

image020

[Enter]

image022

Select your choice here. The default is “Upgrade ESXi, preserve…” but we want a fresh install, so we chose “overwrite” [Enter]

image024

Choose your keyboard [Enter]

image026

Set a password [Enter]

image028

This next step may actually take a few minutes

image030

[F11]

image032

Wait, but since the binaries are all loaded by this point, this goes quickly.

image034

Disconnect the ISO from IPMI and then press [Enter]

image036

ESXi 6 on a HP Blade Server with iLO

Initial Configuration of an ESXi Host with the vSphere Client

There are certain basic settings you will want/need to configure before your ESXi host is suitable for use in production, or even in a lab environment. At the very least, you will need to give your ESXi a hostname and IP address.

Now, I could press [F2] here and configure my ESXi host using the Direct Console User Interface (DCUI), but the DCUI provides a limited set of options, and using an IPMI interface such as iLO (even though iLO is one of the best of its kind), is not always a user-friendly procedure. Besides, we covered using the DCUI in: http://www.johnborhek.com/vmware-vsphere/building-a-vsphere-home-or-learning-lab-2/

Instead, I will show you how to make these initial configurations using the VMware vSphere Client for Windows (sometimes called the vSphere Desktop Client or the vSphere C# Client), which is the only viable client for a standalone host.

Open the vSphere Client for Windows and enter the DHCO IP address you saw on the previous screen. You will use the User name: root and the password you assigned during the install.

Just click Ignore here. Installing this certificate would be useless, as we are going to change the IP.

You may have to click Home to see this screen

Now choose the tab: Configuration and choose the option: Networking

Click on Properties of vSwitch0. Be careful as there are two “Properties” links on this screen. You want the one right by the vSwitch

Highlight the: Management Network and choose: Edit

We probably won’t need to change any of the settings here.

Choose the tab: IP Settings

Now select: Use the following IP settings and don’t forget to click: No IPv6 Settings

Now remember, as soon as you apply this, your client session will become invalid because the IP is now different.

Enter the new IP you assigned, along with the username: root and you password

vSphere Client for Windows

Now is the time to “Install this certificate….” as well as: Ignore

Click on the tab: Configuration

Choose the option: DNS and routing and then: Properties

This is (probably) not the correct information, as it is supplied by DHCP.

Enter the correct hostname and domain, as well as the search domains (“Look for hosts in the following domains”)

You may see this if you left IPv6 enabled.

You are now finished with initial configuration of your ESXi Host and may proceed to set up storage, networking and everything else.

Backing up and restoring the vCenter Server Appliance 6 database

One extremely important advantage of the VMware vCenter Server Appliance (VCSA) is its native PostgreSQL (vPostgres) database. With the embedded database and VCSA, it is now possible to support installations which scale to the maximum capability of vCenter, without additional Operating System or Database licensing costs.

Incumbent with the use of VCSA, however, comes a certain degree of responsibility for backing up the PostgreSQL database embedded with the vCenter Server Appliance. A good backup of the VCSA database makes the following tasks much easier:

  • In-place restore of VCSA database
  • Migration to a different installation of VCSA
  • Protection of vCenter tasks & events for auditing purposes

The process is actually very simple and detailed in VMware KB: 2091961, however typical to VMware, there are few actual procedural details which might help an admin who was not intimately familiar with Linux procedures, for example:

  • How do you create the folder you want to keep database backups on the VCSA?
  • How do you transfer the vCenter vPostgres backup and restore package linux_backup_restore.zip to the VCSA?
  • How do you extract a ZIP archive on a Linux system?
  • How do you retrieve the database backup from the VCSA once it is created?

I will answer these questions in a simple, step-by-step procedure with screenshots and suggestions for applications and settings to use in the process.

Preparing to back up the vCenter Server Appliance (6.X) Database

Open the VMware KB: 2091961 and scroll down to locate the attachment: linux_backup_restore.zip

Save the file to an appropriate folder on your local Windows system

Install WinSCP

Now, if you don’t already have it installed, go get the WinSCP Installation Package. WinSCP is free and one of the most useful utilities with vSphere in general, but there are some WinSCP settings specific to vSphere and the VCSA.

Get the Installation Package so you can save settings specific to your environment

Run as administrator

image005

Choose your language and then: OK

Next

Accept and then Install

Choose to donate and/or Finish

Enable SSH on the VMware vCenter Server Appliance 6

Using a vSphere Client, open a Virtual Machine Remote Console window to your VCSA installation to make sure SSH is enabled.

image010

 

This works just like it does in ESXi:, press F2 to log-in

The password you specify here will be the OS password you set when installing the VCSA.

Using the up/down arrow on your keyboard, scroll down to: Troubleshooting Mode Options then press: Enter

Now, using the up/down arrow, highlight: Enable SSH and press: Enter to toggle SSH for your VCSA installation. NOTE: it is not necessary at this time to enable the BASH Shell, we will do that from Putty

When set correctly, this is how it looks:

Press: Esc to exit

Log in to the vCenter Server Appliance Linux console as root

Open Putty (I am going to take for granted that you already have this one!) and type in the IP address of your VCSA installation (in my example above, it is: 192.168.153.110)

Yes to accept

Enter the username: root and the password that you set for your OS installation.

Now, type (or copy & paste) the two commands to Enable BASH Access and Launch BASH Shell on your VCSA

You will find yourself at the root of the VCSA installation

Now, create a folder to store the PostgresSQL backups, at least until you are able to transfer them off the system. Run the command: mkdir db_backups

Now, list that folder with permissions by typing: ls –la to list the root folder

We can now see the permissions for: db_backups as: drwx (or just rwx for the User)

The Linux permissions listing works as follows:

Read Write eXecute Read Write eXecute Read Write eXecute
d r w x

so the fact that our directory “db_backups” shows “drwx” means that the user (that’s us) has Read, Write and eXecute on this folder.

Change directory into the: db_backups folder

Connecting to VCSA with WinSCP

Using WinSCP successfully with the VMware vCenter Server Appliance requires one of two things to occur:

1.Reconfigure VCSA

–OR-

2.Reconfigure the connection on WinSCP

I universally choose to re-configure WinSCP to work with my vCenter Appliance!

Enter your basic connection parameters in WinSCP and click: Advanced

Now choose: SFTP and enter the following value as SFTP Server: shell /usr/lib64/ssh/sftp-server

Now click: OK and then: Login

Yes

Continue

And you are in

Now locate the location you saved: linux_backup_restore.zip (on the left) and the folder you create on VCSA (on the right)

and drag-and-drop the file to copy to your VCSA

Extract the ZIP on the VCSA

List the contents of the directory: db_backups with the command: ls –la

Unzip: linux_backup_restore.zip

List the contents of the directory: db_backups with the command: ls –la

Neither of the scripsthas eXecute permissions, so add eXecute for the User with the command: chmod +x *.py

List the contents of the directory: db_backups with the command: ls –la (again)

The *.py have become eXecutable!

Backup the VMware vCenter Server Appliance PostgreSQL (vPostgres) database

Run the: backup_lin.py script, provide a filename: python backup_lin.py –f 11112015_VCDB.bak

Now use WinSCP to transfer the backup to a different location

You will have to refresh the folder listing in WinSCP (Ctrl+R) to see the files created

Drag the database backup to your chosen folder on Windows

Restore the VMware vCenter Server Appliance PostgreSQL (vPostgres) database

First, use WinSCP to upload the appropriate backup file. WinSCP will prompt you to overwrite, if a copy of that file exists. Make your choice.

Stop the vCenter Server with: service vmware-vpxd stop

Stop the vCenter Datacenter Content Library Service with: service vmware-vdcs stop

Restore the vCenter database with: python restore_lin.py –f 11112015_VCDB.bak (or whatever the name of your file)

There may be numerous “NOTICE” lines referencing parts of the vCenter Server Appliance which simply don’t exist in your configuration. Just ignore these and look for the ultimate message: Restore completed successfully

Now start the vCenter with: service vmware-vpxd start

Now start the vCenter Datacenter Content Library Service with: service vmware-vdcs start

And you should be in business!