Sunday, 17 January 2016

Fresh installation of a 5.5 vCenter: Simple Install

Written by Suhas Savkoor



In this article we will see how to install a fresh instance of 5.5 vCenter. Then proceeding further we will be upgrading this vCenter to 5.5 U3b and then to 6.0. This 5.5 installation is a simple install, where all the vCenter components like Single Sign On, Web Client, Inventory Service and vCenter Server reside on the same machine. 
The database being used here is a SQL Server 2008 R2 SP2. Before you proceed with any installation, there are a couple of pre-requisites that has to be satisfied. These are:
  • Make sure the hardware and software requirements for vCenter are met. This can be found in this link here.
  • The next thing you need to question is what type of database are we using. If it is an embedded SQL express, then it comes pre-packaged with the vCenter ISO and there is no need to worry about the compatibility. If you are using an external SQL then you need to check if the SQL version you are using is compatible with the vCenter version being deployed. You can use VMware Interoperability Matrix to check the compatibility of database. 
  • Next, the Windows machine being used for vCenter deployment should be added to a domain, and the Forward and Reverse Lookup Zone must be configured for this machine.
Step 1:
Creating The vCenter Database.

**If you are using SQL Server (External) then you will have to follow this step to create a database and establish the connection. If it is a SQL express, then the DB is installed automatically during vCenter installation**

Login to SQL management studio, right click Database and select New Database. 


It will prompt you to enter a name for the database and provide the name for the vCenter database. Once created, expand the database section and verify that you can see your database in there


Step 2:
Create an ODBC connection

**The Open Database Connectivity (ODBC) is required to be created on the vCenter machine, so that the vCenter can talk to its respective external SQL database. vCenter uses a 64 bit Data Source Name (DSN)**

**The SQL Native Client that is being chosen should be 10. A lower version of SQL native client will result in failure during vCenter installation wizard**

Login to the Windows machine being prepared for vCenter Installation. Click Start > Run, and type ODBC. Open the 64 bit ODBC. Click System DSN.

  • Click Add and select a SQL native client version and click Finish. Now we will have to enter the ODBC configuration details. 
  • The Name for the DSN can be any user defined name, if required you can enter a Description.
  • The Server would be the SQL server that you are connecting to. Click Next

Here you will have to provide an authentication mode for the database. As in the first step I am using the sa account as the DB user, I will provide the sa authentication for my vCenter database. The user that you are going to use to setup your ODBC connection must have sysadmin rights on your database end, else the installation of vCenter will fail at the ODBC wizard page.


In the Next page you will have to check the "Change the default database to" option and from the drop-down select the database that you created earlier. Keep the other options to default and proceed Next. In the next option, change the language if needed, otherwise keep all the options to default and proceed to Finish.


Once finished, you can review your settings and then click Test Connection. This should result in Test completed Successfully message. Do not proceed further if the test fails. 


This takes care of setting up to connectivity of vCenter to database part. 

Step 3:
Installation:
Download the required version of vCenter 5.5 from the VMware download portal and mount this ISO on to this windows machine. Since this is a simple install (All vCenter components residing on the same machine), the installation order is Single Sign On > Web Client > Inventory Service > vCenter Server.



SSO Installation:
The first component as discussed would be to install the Single Sign On. On the ISO that is mounted, under custom install, select Single Sign On. You can also proceed with the Simple Install option, which will automate the installation of all the components and prompt you when each component is being installed.


Click Next and accept the End User License Agreement.



Click Next and it will check if the machine has met the pre-requisites. Like joining a domain, and having a resolvable DNS entry.


Once the pre-requisites are met, click Next. Here it will ask you for the SSO deployment type. If this is a first instance of Single Sign On that is being deployed and if it is being deployed for a single vCenter, then select Standalone Single Sign On.


Click Next and it will ask you to create a new password for the SSO administrator user. Provide this credentials and document this, as this will be required for future management.


Click Next, and it will ask for a site name. This site name can be anything, however, this has to be documented, because during link mode setup of the vCenter it will ask for this site name.


Click Next and you will come across the port used for SSO service. This port has to be open on the machine and firewall in order for SSO to work.


Click Next and then you will be asked for a directory where you want to install the Single Sign On component. Select a directory, or leave it for default values. Click Next, review the configuration and proceed to Install the SSO component.



Web Client Installation:
The next component would be install vSphere Web Client which would be a web interface to manage your vCenter environment.
From the same ISO, if the installtion mode is Simple Install, then you will be automatically prompted at this point. If it is custom, then select Web Client and click install.


Select a directory where you want to install the Web Client.


Now, the default https port for web client is 9443. If you want to provide a custom port, then change the https port value, however, record this port number as it is necessary to access the web client. If you do not want to change the port number now, and would like to do so in the future, then you will have to follow this article.


Provide the SSO password that was created during the Single Sign On setup.


The web client needs certificates for authentication as well. VMware installs default certificates for Web Client. If needed, you can replace them later either with CA Signed Certificates or from a third party CA authority. Wild card certificates are not supported in VMware.


Finish the installation of the Web Client component.

Inventory Service Installation: 
Inventory Service stores vCenter Server application and inventory data, which lets you search and access inventory objects across linked vCenter Server instances. If your search is not working in vCenter, then there is probably some issue with Inventory Service database.


Accept the EULA and proceed Next



Choose a directory as to where you want to install this component. Click Next



Enter the vCenter's FQDN for which this Inventory Service needs to be registered.



Review the ports being used for this service. Again, if being changed, then you will have to make a note of the custom port numbers.


Select an Inventory size, this depends upon your environment size. Choose accordingly.
You can change your JVM size after installation as well, again, if required!


Click Next. Provide the SSO credentials for authentication and begin the installation.


vCenter Server Installation:
This would be the last core component to be installed for a VMware vCenter environment setup. Accept the EULA and proceed Next.


You can enter a license key during the installation or you can enter the license key once the vCenter is setup.


Since we are using an external SQL database, we will choose the second option " Use an existing supported database "  and then from the drop-down select the DSN name that was created under 64 Bit ODBC. If you do not see your DSN listed under drop-down, then enter it manually proceed Next. If you are using an express SQL, then you will not follow the initial steps in this article for creating a vCenter database. You will check this first option which will proceed with installation of SQL express and creating a database, all by itself.


When you click Next you will be asked for database authentication. Provide the same user which was used to create the DSN (Must have sysadmin privileges)


In the next page enter the information for VMware vCenter Server service. This can be a local authentication or a domain authentication. If your SQL service is domain then it's best to have a domain authentication for vCenter Server service as well.


If this is a fresh deployment of a vCenter then select " Standalone instance " If you are setting up another vCenter and want to join these two vCenters in linked mode, then the second option has to be chosen. You can also join two vCenters in linked mode even after two standalone instances are deployed.


Check the ports required for vCenter services and make sure these are open and proceed Next



Again, select the inventory JVM size for vCenter server component.


Provide the SSO credentials for authentication.


Now, you will get an option to choose the SSO user name. You can give administrator@vsphere.local or any other name. Please make sure that you do not give your existing domain name as your SSO username, as this will cause issues during adding users to vCenter.


Since vCenter is dependent on Inventory Service, the IS was installed first and the URL for IS was created and auto-populated in the next step.


In the final step, provide a directory to install vCenter component and begin the installation.



Once the installation completes, the vCenter deployment is complete. From the same ISO install vSphere Client. After installtion, open the vSphere Client and enter the IP address of the vCenter, SSO username/password and login to verify the setup is working good.
Open a browser and navigate to Web Client URL, https://<vcenter_IP>:9443 to verify Web Client is functioning good!

That's all!

Friday, 15 January 2016

Unable To Delete vSwitch Or Remove Up-links from the vSwitch: A Specified Parameter Was Not Correct

Written by Suhas Savkoor



Today, I was working with a customer on a case where he had set up a new host and had configured a vSwitch for VM port-groups, vMotion and management, all on the same vSwitch. He also had created one additional switch and assigned couple of NICs to it. However, we did not need this vSwitch and we were trying to delete the vSwitch and we were being returned with an error. Removing the up-link, or even moving the up-link to unused state returned the same error. The error message was:

"A specified parameter was not correct. Vim.Host.VirtualSwitch.LinkDiscoveryProtocolConfig "

Resolution: (Applicable for 4.x and 5.x environment)

1. Take a SSH (Putty) session to this host.
2. Run the command:
# esxcfg-vswitch -B both <vSwitch> 
<vSwitch> is the name of the vSwitch which is returning the error.

The Switch -B has couple of values: 

-B --set-cdp Set the CDP status for a given virtual switch. To set pass one of "down", "listen", "advertise", "both"

"down" - means it will not participate in CDP
"listen" - means it will only listen for CDP
"advertise" - means it will advertise the CDP info
"both" - is a combination of listen and advertise

Any of the above parameters can be used

3. Refresh the network settings in the vSphere Client
4. Remove the up-links for the vSwitch. It should be now removed without any errors. 
5. Remove the vSwitch


Tuesday, 12 January 2016

Upgrade: VCSA 6.0 Embedded PSC to 6.0 U1

Written by Suhas Savkoor



Previously we saw how to perform a fresh installation of Embedded appliance 6.0

This article discusses how to upgrade your existing 6.0 vCenter Server Appliance to 6.0 U1 hosted on an embedded PSC. With 6.0 GA we do not have the VAMI page for VCSA management, so the upgrade should now be performed through the command line of the appliance.

Step 1:
Download the vCenter 6.0 U1 appliance from this link here
The second option is the appliance ISO

Download this ISO and attach it to the existing 6.0 appliance virtual machine.

Step 2:
  • Before proceeding with the upgrade, take a snapshot of your existing 6.0 appliance, so that we will have a restore point to revert to in case something goes wrong.
  • Since this is an embedded PSC install, take a SSH (Putty) session to the appliance which has the Update 1 ISO already mounted. 
  • Login with root credentials that was setup during the install. 

Choice 1:
To apply the patches immediately, run the below command:
software-packages install --iso --acceptEulas


Reboot the appliance and the upgrade is completed successfully.

Choice 2:
You can stage patches and do the upgrade later at a convenient time as well. This works in three steps:
  • Stage the patches to the appliance
  • Review the staged patches
  • Apply the staged patches to appliance
To stage patches, run the following command:
software-packages stage --iso --acceptEulas


To Review staged patches, run the below command:
software-packages list --staged


To apply the staged patches, run the below command:
software-packages install --staged


Once the upgrade is done, reboot the appliance.
Now, this being a 6.0 update 1, we have our management web GUI back. So after the upgrade, go to: https://<vcenter_ip_or_fqdn>:5480



Login with root credentials to verify everything is running fine.
You can also see that from here onward, you can perform the patching and update from the GUI of the appliance.


That's all there is to it!


Finding Lock On A File

Written by Suhas Savkoor



If we want to determine which ESXi host is holding a lock on the file, we usually end up following this KB article. The classic command we use is vmkfstools -D /path/to/the/file

I came across another command, which is pretty good and also saves the time for us in finding out which host corresponds to the MAC address that is locking the particular file. From the SSH of the host, browse the virtual machine directory. 

Once you are inside the virtual machine's directory run the following command against the file, that you want to check for lock. 
vmfsfilelockinfo -p <file_name> 
For example:
# cd /vmfs/volumes/52a62585-b8e592b8-3570-005056030027/CentOS7 
# vmfsfilelockinfo -p CentOS7-flat.vmdk 

The output is as follows:

vmfsfilelockinfo Version 1.0
Looking for lock owners on "CentOS7-flat.vmdk"
"CentOS7-flat.vmdk" is locked in Exclusive mode by host having mac address ['00:50:56:03:0d:38']
Trying to make use of Fault Domain Manager
----------------------------------------------------------------------
Found 3 ESX hosts using Fault Domain Manager.
----------------------------------------------------------------------
Searching on Host 192.168.1.177
Searching on Host 192.168.1.176
    MAC Address : 00:50:56:03:0d:38

Host owning the lock on the vmdk is 192.168.1.176, lockMode : Exclusive
Total time taken : 0.02 seconds.


This tells us the MAC address of the host having the lock on the file, as well as which host corresponds to that MAC address even if the SSH session is conducted through a different ESXi host.

This will again not work for NFS!


vSphere Install and Upgrade Series

Written by Suhas Savkoor



Welcome to VMware vSphere Install and Upgrade Series. This section will discuss about fresh installation as well as upgrading VMware vCenter from 5.1 to 5.5 to 6.0 (Embedded and External PSC) on both appliance as well as Windows vCenter level. It also discusses about fresh installations of 5.x and 6.x version of vCenter.

**Note** This article will be updated with new links as and when the setup is completed.

Fresh Install Series:

1. Fresh installation: Embedded PSC deployment of a 6.0 vCenter Server Appliance
2. Fresh Installation: Simple Install of a 5.5 vCenter Server (Windows)
3. Fresh Installation: External PSC deployment of a 6.0 vCenter Server Appliance

Upgrade Series

1. Upgrade: vCenter Server Appliance from 6.0 to 6.0 U1 with embedded PSC
2. Upgrade: vCenter Server Appliance from 6.0 to 6.0 U1 with external PSC


Installing vCenter Appliance 6.0 with Embedded PSC

Written by Suhas Savkoor



vCenter appliance as you know is a SUSE Linux alternative to Windows based vCenter. This article talks about Embedded PSC deployment of a new 6.0 appliance. The embedded PSC has both the PSC node and the management vCenter node on the same machine.

More about vCenter deployment models can be found in this link

Step 1:
Download the vCenter 6.0 appliance ISO . Click here for the download link
Second option in the download section is the appliance ISO

Pre-requirements:

  • You will need a Windows machine which acts as a mount point for the vCenter appliance ISO. Using this mount point you can deploy the appliance on to an ESXi host, or a vCenter (if you already have one)
  • The forward lookup and reverse lookup for the appliance name should be added in your DNS manager. If this is not done, the installation fails in mid progress. 
  • So, plan out a name for your appliance and an IP address for the same. Go to your DNS manager and enter this name and the IP address for your forward lookup zone and the network ID for the reverse lookup zone. 
  • Make sure that there is sufficient space on the datastore.
Step 2:
  • Mount the ISO on the Windows virtual machine. 
  • Open the Drive and you will see the following contents. Here, the Client Integration Plugin has to be installed first as the web browser is going to be used for the installation 
  • Open the VCSA folder. 

Inside this you will have the Client Integration Plugin setup .exe file. Run this file. 


You will come across the installation wizard of the Plugin. This is a simple installation; accept the EULA and proceed to install. 


Step 3:
Once the plugin installation is done, go back to the root directory of the vcsa disk drive and you will find vcsa-setup.html file. 
Open this file to continue further with installation.


You will now come across the install/upgrade web page. 


Click Install to begin the setup and deployment of the 6.0 appliance.

Step 4:
Accept the End User License Agreement and click Next


Step 5:
Here, we need to provide the details of the ESXi host on which you want to deploy your new appliance. 
  • Provide ESXi host's IP address or Fully Qualified Domain Name
  • Username for the ESXi, root
  • And the respective password

If it asks for a Security Thumbprint, click Yes to proceed.

Step 6:
Here you will provide your appliance details. 
  • For appliance name: Enter any name for this appliance. However, make sure that this name is added to the Forward Lookup Zone in your DNS manager. 
  • Provide a password for the " root " user of the appliance. 
*Note* Document this password as this would be required for upgrading the appliance in future. 


Step 7:
Since here we are doing an Embedded PSC install. Choose the first (default) option.


Step 8:
Since this is a fresh install, we will be creating a new SSO domain. The details to be filled are:
  • Password: Enter a new password for the SSO user. This user is used to manage your Identity sources, users and groups configuration for your vCenter appliance. Please document this password as well, as it is necessary.
  • SSO domain name: This has to be a unique domain name. It can be anything, here I am using the "vsphere.local" as my SSO domain. The SSO user then would be administrator@vsphere.local
*Note* If you have an existing domain in your active directory, say, xyz.com, DO NOT use this domain as your SSO domain. This will prevent you from adding users under to xyz.com domain to the vCenter for management. 
  • The SSO Site Name: This can be any user defined site name. 

Step 9:
Choose the appliance size depending on the number of hosts and VMs you have in your inventory.


Step 10:
Select a datastore where the appliance files must reside. 


Step 11:
Choose a database type:
  • If it is embedded, a vPostgres DB is installed
  • If you have an external Oracle DB, this can also be specified. 

Step 12:
Here you will enter the network settings for the appliance:
  • Select the port-group where this appliance must reside on the ESXi networking
  • Enter an IP address to this appliance. This IP address should correspond to the appliance name that was added in the Forward Lookup Zone of the DNS manager
  • The FQDN of the appliance, the appliance name and your domain name
  • Subnet mask, gateway and DNS server details.
  • If you have a separate server for your NTP, then check "Use NTP Servers" and paste the IP in the below box.

Click Next, review the settings and Finish to begin the installation/deployment. 

Once the installation is complete, you will see the following screen with a link to Web Client. Click the link and login with SSO credentials to verify everything is working good.


That's pretty much about installation of an embedded PSC appliance 6.0