Sunday, September 13, 2015

Mini VMware vSphere 6 Homelab on VSAN with Shuttle DS81

Finally I have a homelab to support my study on VCAP-DCA and my job. My current work often requiring me to test a complex upgrade or a complex setup. VMware Hands-on Lab and VMware Product Walkthrough are great to learn how to configure specific features. But not all products and features available and the lab does not provide walkthrough from scratch - for example installing ESXi host, vCenter Server, etc.

It was not easy for me because I need to submit and present to my CFO - my wife, WAF (Wife Acceptance Factor) is one of the design factors that need to be considered plus there are also some technical constraints. I can only submit a Purchase Order after the BoQ has been approved by CFO.
- Total budget is $2,000USD
- Low watt. Apartment's maximum watt is 1,300W, there are fridge, aircons, TV, lights, etc. We are looking at lab that draws up to 200W max 300W.
- Compact and small form factor. Apartment's size is only 33m2, there is not much free space left.

Looking at above lists, I was not sure if I can get a homelab that can meet above requirements and constraints so I look for a cloud that can provide a lab with bunch of VMs with nested ESXi. I found ravello systems but I'm not sure if I can rely online labs and still prefer physical labs.
I was visiting Jason Langer's blog and read his post on replacing homelab with ravello systems.
I'm interested in the Physical Design lab on Micro-ATX w/ Lian-Li Case and Intel NUC. The Micro-ATX based lab can provide 32GB RAM per host, but the power supply is 400W. So I need to go with Intel NUC w/ 16GB RAM.

I was planning to get a small 4-bays storage for SOHO/SMB like Synology DS415+ but it is quite expensive.  Alternative for 4-bays in Synology w/ lowest price is DS414slim. But again still quite expensive and I'm not sure if the total budget is sufficient. So I decided to go with VMware VSAN.

To build a VSAN with NUC, I will need NUC that support multiple disks (1 SSD and 1 HDD). Apparently there are a lot of model for NUCs and I wanted something that can run vSphere 6. Florian Grehl's has an article on ESXi 6.0 Image that works with NUC. Most of local electronic/IT shops here sell the complete set NUC and in the end the memory & disks will be useless since I will replace it to 16GB RAM and at least 120GB SSD + 1TB HDD. NUC with Intel vPro is cool because it provides a KVM Remote Control. I agree with Mike Tabor as he pointed on his article Intel NUC i5 5th Generation an ESXi lab improvement, the best suite would be NUC5i5MYHE - 5th Gen Processor, 2 internal disks, and Intel vPro. So I contacted a local Intel's distributor to ask for a BoQ on NUC5i5MYHE / D54250WYKH2 / NUC5i5RYH, they only sell Intel stuff so I need to buy memory, disks, etc from different shops and build my own. The total cost is above $2K and it is quite troublesome to purchase from different shops, one of the risk the warranty and support are separate and there could be compatibility issue if I'm not picking up the correct brand and model.

I was looking for alternatives for Intel NUC and Shuttle DS81 looks promising.
 
Below are some links that has Shuttle DS81 for homelabs
Ultrasmall computers for your VMware lab - Intel NUC and Shuttle DS81 preview: https://www.youtube.com/watch?v=ullzf3TqhoE
The Perfect vSphere 6 Home Lab | Ryan Birk – Virtual Insanity:
http://www.ryanbirk.com/the-perfect-vsphere-6-home-lab/
Build a new home lab VMGuru: https://www.vmguru.com/2015/02/build-new-home-lab/
Building a ESXi 5.5 Server with the Shuttle DS81: https://globalconfig.net/building-esxi-5-5-server-shuttle-ds81/

It can runs vSphere 6 only need to inject Realtek 8111G VIB drivers to ESXi 6 image with PowerCLI 6 or using v-Front ESXi-Customizer by Andreas Peetz. The drivers can be found from one of the above links on Shuttle DS81 for homelabs. Although it is slightly bigger than Intel NUC, the advantages of Shuttle DS81 are it comes with a dual-NIC GigabitEthernet and processor speed is higher than the NUCs. I decided to order 3xShuttle DS81 from local distributor with the following hardware specifications:
Intel® Core™ i3-4170 Processor (3M Cache, 3.70 GHz)
Kingston 8GB 1600MHz DDR3 (PC3-12800) SODIMM Memory
Samsung 850 EVO 120 GB mSATA 2-Inch SSD
HGST Travelstar 7K1000 2.5-Inch 1TB 7200 RPM SATA III 32MB Cache Internal Hard Drive SanDisk 16GB Class 4 SDHC Memory Card

For the switch, I start with TP-Link 8-Port Gigabit Easy Smart Switch TL-SG108E first. It support VLANs, IGMP Snooping, Link Aggregation, and its low watt. I also buy a small UPS/AVR CyberPower BU600E. I use an energy/watt meter to validate all of the above configurations as the CFO would very much like to validate herself. For all 3 nodes Shuttle DS81 + 8-Port GbE TP-Link switch + UPS, it turns out that the total wattage are only between ~65W up to 160W :)

To install ESXi 6 on USB/SD Card, we can install it to USB/SD as a destination directly (with Workstation/Fusion) or have it as a source installer. You can read the details in Vladan's post here. To  create ESXi 6 bootable ISO along with automatically using a static IP Address when the custom ISO first boots up, we can use a ks.cfg, read more about it in William Lam's post here or you can also create kickstart for VSAN. I'm using SD card for the ESXi boot ISO but unfortunately VMware Fusion cannot detect Mac's Internal SD card reader. So I will need to create an ESXi installer on USB. Then install to SD card using USB. After the ESXi hosts are ready, I cannot install vCenter because there is no VMFS Datastore and we need a vCenter Server to configure a VSAN. There's an article on how to bootstrap a VCSA to a single VSAN node. Since I'm using Mac, I cannot use the Client Integration Plug-In to deploy VCSA and need to use the vcsa-cli-installer. To install using vcsa-cli, read Romain Decker's article here.

At the moment, I only install VCSA 6.0u1 with Windows 2003 as AD, DNS, DHCP. I used Win 2003 because of it small size and hardware specification/requirements. With 3 nodes of 120 GB SSD & 1TB HDD I get 2.7TB VSAN datastore in total as below screenshot.

I'm planning to continue to install NSX 6.2 by following Thomas Beaumont's blog post here.

Friday, March 20, 2015

NSX Host Preparation Not Ready

ShortURL to this blog post: http://vexpert.me/nsxhostpreptshoot

One of the steps required to install NSX-v is preparing clusters or hosts for NSX which will install three new VIBs to ESXi hosts (in the Kernel space) and the process will be done per cluster not per host.
The steps are quite straight forward, after you have your NSX Manager registered to your vCenter Server and get your NSX Controllers deployed, you just need to go to Host Preparation Tab > choose your desired cluster > hit Install


More about preparing clusters for NSX can be found from below links:
Getting Started Guide for NSX vSphere
NSX will send a request to EAM to calls vCenter Server to install the three VIBs.
ESXi downtime or reboot is not required for this but Upgrade or Uninstall requires a reboot, if you have DRS and vMotion networking setup, it will automatically set some of your hosts to maintenance and reboot it so there will be no downtime to your workload VMs.
Upon successful installation, the Installation Status column will display the NSX version and Firewall column Enabled.
But if not successful, the Installation Status column will display a red warning icon says Not Ready and Resolve.
Try clicking the resolve button to repush NSX request to install the VIBs, if nothing changed and still saying Not Ready you might need to check your setup and also check some logs.
Below are 2 log files that you can check:
  1. /var/log/esxupdate.log in ESXi host
  2. eam.log in vCenter Server. ProgramData/VMware/VMware VirtualCenter/Logs/ for Windows vCenter or /storage/log/vmware/vpx/eam.log for Linux vCenter
Below are the most common issues:
  1. DNS configuration on your vCenter Server, ESXi host, NSX Manager, and DNS forward + reverse records on your DNS servers
  2. Time Sync on ESXi Hosts and NSX Managers, use NTP server whenever possible
  3. TCP ports, check if any of required firewall ports are blocked. See the NSX Hardening Guide to check all required ports for NSX
  4. Verify if vCenter Server Managed IP is set and correct. See KB 1008030 on how to check this.
  5. Update Manager service is stopped or having issues if you have VUM installed. 
If you have error log under eam.log similar to below, you might have some issues on your Update Manager or connection to your Update Manager
“com.vmware.vim.vmomi.client.exception.ConnectionException: org.apache.http.conn.HttpHostConnectException: Connection to https://<vCenter_Server_Hostname>:8084 refused”
A workaround for this is to temporarily bypass VUM so EAM can continue to install the VIB. The steps are similar to KB 2053782 but instead of setting it to false, set it to true.

Below are the complete steps:
  1. Open a browser to the MOB at:
    https://vCenter_Server_IP/eam/mob/
  2. Log in with Administrator privileges.
  3. Select an agency from the agency list. This is usually agency-0. If not, select the appropriate agency.
  4. Click Config. This should be a URL where agency-0 is replaced by your local agency ID.
    For example:
    https://vCenter_Server_IP/eam/mob/?moid=agency-0&doPath=config
  5. Set the bypassVumEnabled flag to true:
  6. Using the agency ID identified in Step 3, change the browser URL:
    https://vCenter_Server_IP/eam/mob/?moid=agency-<0>&method=Update
  7. In the config field, change the value from false to true. Change the existing configuration options to match this:
    <config>
    <bypassVumEnabled>true</bypassVumEnabled>
    </config>

  8. Click Invoke Method and go back to the previous link to check if the value gets updated.
  9. Back to NSX Host Preparation Tab and click Resolve. You should be able to proceed with the VIBs installation now. Note: if you have multiple clusters, you would need to set the bypassVumEnabled flag to true per cluster since the agency-# will be created per cluster
Below are some related links that are helpful to understand NSX Host Preparation and help you further to troubleshoot:
 If you are still not able to resolve your issue, you can always contact VMware Support


Saturday, April 26, 2014

Solution - VMware vSphere Datastore is not accessible or not detected after unplanned PDL

I would like to share some KB & solutions related to PDL.
Some explanations on storage connectivity problems - PDL (Permanent Device Loss) and APD (All Path Down) is available in VMware Documentation here
Identifying Device Connectivity Problems
Permanent Device Loss (PDL) and All-Paths-Down (APD) in vSphere 5.x (2004684)

Some of my customers experiences PDL, unplanned PDL, where they can no longer access the datastore but storage team has confirmed that they have presented the LUN to the hosts & clusters.
However, the datastore is not detected or not accessible from vSphere.
Below are some of the scenario and its resolution.


1. After unplanned PDL, vSphere can see the Datastores. However, when we try to browse the datastore the Datastore Browser is just loading ... no response.
Solution: Follow this KB VMware KB: Cannot remount a datastore after an unplanned permanent device loss (PDL) or just simply reboot the ESXi host

2. After unplanned PDL, Datastore is gone from vSphere. Storage team confirmed that they have presented the LUN to the hosts & clusters. However, the datastore is not detected as existing datastore and also not detected as new LUN.
Solution: Check storage devices from the host, see if you found any detached devices

If you found any, check the naa id/LUN# if it is the LUN that you are looking for. Select the device then attach and rescan. The datastore you are looking for will normally appear in the list of datastore



3. After unplanned PDL, Datastore is gone but you can see it when you want to add new Datastore (detected as if it is a new Datastore).
You do not want to reformat the datastore but the options to keep or resignature VMFS only are greyed out. The available option is only to format VMFS.

Solution: Follow this KB VMware KB: Cannot remount a datastore after an unplanned permanent device loss (PDL)  or just simply reboot the ESXi host


4. After unplanned PDL,You want to remove inactive datastore because of PDL, but all options are greyed out
Delete it from vCenter Database, the steps are explained in this KB: VMware KB: Unable to remove a datastore from the vCenter Server 4.x / 5.x inventory
or you can also reboot the affected ESXi host

To avoid these issues follow the proper way/best practices for removing a LUN from ESX host
VMware KB: Unmounting a LUN or detaching a datastore/storage device from multiple VMware ESXi 5.x hosts
Best Practice: How to correctly remove a LUN from an ESX host | VMware vSphere Blog - VMware Blogs

Wednesday, April 16, 2014

VMware vCenter SQL Database Maintenance Best Practices

People often ask on what are best practices on maintaining vCenter SQL Database.
One of the VMware Best Practices (listed in VMware Health Check/HealthAnalyzer tool) is to periodically perform database maintenance tasks on the vCenter database.
When vCenter server service is stopped and cannot be started, most of the problem is because the disk which stores the DB data is full.
This is why monitoring the disk space and utilization is important to ensure that the database has sufficient space for growth.
We also should schedule regular backups of the vCenter database. The backup for vCenter Server should also include the SSL certificates and licenses from the vCenter Server.

vCenter stores configuration, tasks, events and performance data records in Database, the configuration record usually do not grow or changing most of the time, only happens when we change the setting of a cluster, adding host to cluster, etc. Tasks, events, and performance data records do grow over time and will populate table rows in Database as time goes by.

vCenter Server has a Database Retention Policy setting that allows you to specify when vCenter Server tasks and events should be deleted. vCenter has mechanism to purge the database so that it does not overgrow. There is some built-in vCenter SQL DB automated jobs in Microsoft SQL Server to clean performance data, tasks and events records in Database. Since the retention policy does not affect performance data records, it is still possible to purge or shrink old records from the database using the scripts available in this KB
Reducing the size of the vCenter Server database when the rollup scripts take a long time to run
http://kb.vmware.com/kb/1025914

To access the Database Retention Policy setting in the vSphere Client: Click Administration > vCenter Server Settings > Database Retention Policy.
If it's not set, then it means there is no imitation on how long vCenter will keep tasks and events records in the database, this can also lead to database overgrowth. The default setting is 180 days, so vCenter will purge old data after 180 days.

vCenter performs basic statistics operations of insert, roll up, and purge. Higher statistics levels require that more work be performed by the vCenter Server for these operations, which can impact the performance of the vCenter Server database.
Higher statistics levels also increase the size of the vCenter database. You can use the database sizing estimator when changing the statistics level to make sure that you have adequate space in the vCenter database.

vCenter statistics levels:
  1. vCenter statistics level 1 includes the basic metrics but does not include statistics for devices.
  2. vCenter statistics level 2 includes all the metrics including statistics for devices.
  3. vCenter statistics level 3 includes all the metrics and all of the counter groups.
  4. vCenter statistics level 4 includes all the metrics supported by vCenter Server.
To prevent performance data from growing so large, we can set the stats collection level to 1.
It is recommended that the vCenter statistics level is kept at level 1 or 2. Level 2 gives more comprehensive vCenter statistics than the default setting.
When increasing level statistics from default level 1, monitor closely the vCenter database growth.

Consider upgrading to vCenter 5.1+ if you are still using vCenter version prior v5.1.
vCenter Server 5.1 introduces some significant improvements to the statistics subsystem. The improvements are especially important for vCenter Server 5.1 deployments running at-scale inventory. The database is therefore a critical component of vCenter Server performance. Because the statistics data consumes a large fraction of the database, proper functioning of statistics is an important consideration for the overall database performance. Thus, statistics collection and processing are key components for vCenter Server performance.

VMware vCenter Server 5.1 Database Performance Improvements and Best Practices for Large-Scale Environments: https://www.vmware.com/files/pdf/techpaper/VMware-vCenter-DBPerfBestPractices.pdf

Below are some references & KBs related to vCenter Database Maintenance: