Skip to content

Tag: VMware

Upgrading the Home Lab

Home labs are always a hotly contested topic. Do you need one, do you not? Can you host it or should it be physical? Can you make do with hand-me down gear or should you buy new? Will it stay powered on or only powered on for lab work? And this goes on and on until you’re absolutely tired of thinking about it.

In my case, I’ve had a home lab for around 4 or 5 years now. I went the new physical route. I found a Dell tower (T110) with a Xeon processor and 16GB RAM for pretty cheap and made it work. It was good enough for multiple VCAPs, a bunch of blog posts, and enough learning to earn a couple new social designations.

However, slowly over the years, my home lab was being shutdown less and less. There were things now running in it which had an uptime requirement (mostly self-imposed) and that 16GB of RAM was almost always over-subscribed.

This all means that it was time for a home lab upgrade! There were lots of characteristics to take into account such as the lab’s footprint, cooling, power, connectivity, noise, and so forth. After a couple months battling back and forth between the new Intel NUCs and SuperMicro Xeon-D systems, I ended up going the SuperMicro route. I also decided to go with the rackmount option. The rackmount cases have slightly less depth than most closet shelves and plenty of space to adding in a bunch of extra drives or PCIe devices.

Next was choosing the board. This offers its own complexity because the X10SDV boards have gained popularity over the years and there’s a bunch of different combinations. I ended up landing on the board with the Intel Xeon D-1528 processor. It has 6 cores (12 threads), goes up to 128GB RAM, and only requires 35W of power. I also skipped the sticker shock of going straight to 128GB right away and went with 64GB.

The Build

Primary Components:
SuperMicro CSE-505-203B Case – LINK
Intel X10SDV-6C+-TLN4f Motherboard – LINK
Samsung 32GB DDR4 RAM x 2 – LINK

Accessories:
I/O Shield – LINK
40x28mm fan x 2 – LINK
Fan Hold x 2 – LINK
Hard Drive Retention Bracket – LINK

As the links indicate, I used WiredZone for the purchase. They’re an authorized reseller and had everything in stock. I would definitely order from them again.

Assembly

Couple days later the parts started arriving and it was time for assembly! This was a little more frustrating than I anticipated. Pain points were the power connection and the fans.

The power problem was due to the case PSU including a 20-pin connection while the motherboard had a 24-pin power connection. I had read a couple places that these boards could be powered multiple ways, one through the 24-pin connection and the other through a 4-pin connection. However, they should NOT be used at the same time. After some discussion on the OpenHomeLab slack group with Mark Brookfield, we got it sorted how the power should be on pins 1 through 10 and 13 through 22. Big thanks to the OpenHomeLab folks and Mark especially. I was also able to confirm this configuration through WiredZone, whom responded back in less than 24 hours.

PSU Connection
Motherboard Power Connected using 20 of 24 Pins

The other issue was with the fans. I ordered some fans since the server would be sitting on a shelf somewhere in my house. Basically, the more fans to move the hot air out the better. The fun with the fans was because there’s not really any instructions on what to do with them or the fan holders. The fan holders did end up connecting together and then they basically sit on top of these pins. From that point, the fans literally just sit in the holders and are connected to the fan accessory ports on the motherboard. The case top is what helps hold everything together. Certainly not what I expected, but it’s moderately better than zip tying the fans to the case.

SuperMicro Dual Fan Holder Assembled
SuperMicro Dual Fan Holder Assembled

Fan Holder Pins Inserted
Fan Holder Pins Inserted in the Case

Holder and Fans Installed
Fans and Holder Installed in the Case

Everything else was extremely straight forward. Only other wish, the case could use some extra room for better cable management. You’ll see why in the assembly images below.

505-203B Case
SuperMicro 505-203B Case

Case and Motherboard Installed
SuperMicro 505-203B Case and Intel X10SDV-6C+-TLN4f Motherboard

IO Shield Installed
IO Shield Installed

Install Completed
Installation Completed

In Action

It’s all cabled up and I can finally hit the power button and watch it spring to life, which it did with no fuss.

First thing I did afterwards was configure the BIOS settings as per Paul Braren‘s advice over at TinkerTry: Recommended BIOS Settings for Supermicro SuperServer SYS-5028D-TN4T

Next up, install ESXi to an attached USB thumb drive. I did this by way of the motherboard’s KVM and it was quite easy, just like it would be via an HP iLO or Dell DRAC.

Lastly, install the VIB to make the 10GbE ports work properly. Paul has a great write-up on that as well over at TinkerTry: How to download and install the Intel Xeon D 10GbE X552/X557 driver/VIB for VMware ESXi 6.x

I had the system running for 90 days straight before I shut it down to start the upgrade to vSphere 6.5. No hiccups or any issues whatsoever. I’ve been extremely happy with the purchase, almost to the point of wondering why I hadn’t done it sooner.

Server Running Status via ESXi
Home Lab Server running for 88 days!

Server Installed
Current Living Quarters for my Home Lab

If you have any questions as you’re reading this, feel free to use the comments or find me on Twitter. Also check out the OpenHomeLab site and their slack channel, and definitely browse through Paul Braren‘s blog TinkerTry. Paul has done an immense amount of research and countless hours of hands-on work with these SuperMicro motherboards.

Now to start thinking through the next home lab upgrade whether I should do vSAN or upgrade my Synology…

PoSh – vCenter License Handling

It’s that time of year again for vExperts… Time to replace the NFR licenses the vExpert program has graciously supplied us.

Was given a gentle reminder of this the other day while preparing for a vBrownbag presentation:
Expiring Licenses

I’ve been on a big Powershell module making binge lately and noticed there really isn’t much for handling vCenter’s licensing, so I created one and published it out on Github.

An overview of what’s currently included in the module:

Function Name Description
Get-VILicenses Gathers information on all VI licenses availabe in the vCenter Server
Get-VILicenses
Get-VILicenseInfo Gathers information on the supplied license key
Get-VILicenseInfo
Add-VILicense Adds the supplied license key to the vCenter Server license inventory
Add-VILicense
Remove-VILicense Removes the supplied license key from the vCenter Server license inventory
Remove-VILicense
Set-VILicense Sets the supplied license key to the desired VI Object
Set-VILicense
Get-VILicense Gathers information on the supplied license key from the VIObject
Get-VILicense

A general walk-through of what’s occurring within each function is Powershell interfacing with the License Manager object via VMware’s SDK.

Requirements:
PowerCLI modules and/or PSSnapins
Active connection to a vCenter Server

An automated way of downloading the files into a dedicated directory and importing the module into the current session:

Note: this was a script that worked in my environment. There is no warranty or support with this script, please use at your own risk.

PowerCLI – Quick Stats Not Up To Date Error

Recently rebooted one of my vCenters and came across an error on my ESXi hosts stating “Quick stats on *vmhost* is not up-to-date”. A couple seconds worth of googling brought me to VMware KB2061008 which helped to resolve the issue.
Quick Stats Error Message

However, the KB only went through the GUI process of adding in the requisite parameters but there’s no fun in clicking through the GUI so I came up with a short script that’s applicable to vCenter 6.0 which can also accomplish performing the parameter creation/updates for the KB’s workaround.

Once you run the script, you’ll still need to restart the vCenter service on your VCSA or Windows server. If you happen to be in the web client:
Go to “Administration” then to the “Deployment” area to select “System Configuration”
Select “Services”, then select “VMware vCenter Server”
Select “Actions” followed by “Restart”

Once the service is back up and running the error will no longer be present.
vCenter Service Restart

Note: this was a script that worked in my environment. There is no warranty or support with this script, please use at your own risk.

PoSh – NSX Module Update

A new update has been published to the NSX Module which I previously published on GitHub: https://github.com/kmruddy/Powershell/tree/master/Modules/NSXModule

A reference to the first blog post I made concerning the module, including some screenshots of it actually in use: http://thatcouldbeaproblem.com/?p=823

The module has now grown to 31 of the following cmdlets:

Cmdlet Description
Get-NSXController Gathers NSX Controller details from NSX Manager
Get-NSXControllerUpgrade Gathers NSX Controller Upgrade details from NSX Manager
Get-NSXEdge Gathers NSX Edge Node details from NSX Manager
Get-NSXEdgeDefaultRoute Gathers NSX Edge Node default route details from NSX Manager
Get-NSXEdgeFeatures Gathers NSX Edge Feature details from all nodes within NSX Manager
Get-NSXEdgeFirewall Gathers NSX Edge Node firewall details from NSX Manager
Get-NSXEdgeInterfaces Gathers NSX Edge Node’s Interface details from NSX Manager
Get-NSXEdgeNATs Gathers NSX Edge Node NAT details from NSX Manager
Get-NSXEdgeRoutingOverview Gathers NSX Edge Routing Overview details from all nodes within NSX Manager
Get-NSXEdges Gathers NSX Edge Node details from NSX Manager
Get-NSXEdgeStaticRoute Gathers NSX Edge Node static route details from NSX Manager
Get-NSXEdgeUplinks Gathers NSX Edge Uplink details from all nodes within NSX Manager
Get-NSXIPPools Gathers NSX IP Pool details from NSX Manager
Get-NSXIPSets Gathers NSX IP Set details from NSX Manager
Get-NSXLogicalSwitches Gathers NSX Logical Switches and their details from NSX Manager
Get-NSXManager Gathers NSX Manager details
Get-NSXManagerComponents Gathers NSX Manager component details
Get-NSXManagerSSH Gathers NSX Manager SSH component details
Get-NSXScopes Gathers NSX Scopes and their details from NSX Manager
Get-NSXSSOConfig Gathers NSX SSO details from NSX Manager
New-NSXIPPool Creates an NSX IP Pool within NSX Manager
New-NSXIPSet Creates a new NSX IP Set within NSX Manager
New-NSXLogicalSwitch Gathers NSX Logical Switches and their details from NSX Manager
Remove-NSXEdge Deletes an NSX Edge Node from NSX Manager
Remove-NSXIPPool Removes an NSX IP Pool within NSX Manager
Remove-NSXIPSet Removes an NSX IP Set within NSX Manager
Remove-NSXLogicalSwitch Gathers NSX Logical Switches and their details from NSX Manager
Remove-NSXSSOConfig Removes NSX SSO config from NSX Manager
Restart-NSXManager Configures the NSX Manager for reboot
Set-NSXManagerSSH Configures NSX Manager SSH component
Update-NSXEdge Updates the NSX Edge via Update parameter

If you need an automated way of downloading the files into a dedicated directory and importing the module into the current session please see the following:

Note: this was a script that worked in my environment. There is no warranty or support with this script, please use at your own risk.

PoSh – Finally Testing PernixData!

My home lab has been in need of some upgrades lately. One of the easiest, and cheapest, was the addition of PernixData and their FVP Freedom edition release.

Couple of caveats I feel I should cover if you’ve never been exposed to PernixData’s FVP product:

  • FVP, the normal offering, cannot activate a Freedom license.
  • FVP Freedom edition cannot be installed and used in trial mode.
  • FVP Freedom edition can only use RAM as an acceleration resource and requires a minimum of 4GB free per host.
  • FVP Freedom edition can only be used for read only acceleration (ie. write through mode).
  • FVP Freedom edition cannot be used with more than one cluster.

With that said, I ended up going with the regular FVP edition in trial mode because I don’t have an additional 4GB of RAM available. The install was extremely easy using SQL Express. vSphere Web client plugin installed to my VCSA instance properly and creating the first FVP Cluster was equally as easy. However this isn’t about the install and config, so let’s jump to the Powershell module!

First, if you’re on the management server, import the module:
Import-Module PrnxCli

If you don’t happen to be on the management server, you’ll want to copy/paste the “Program Files\PernixData\FVP Management Server\Client\PSModule” directory over to the desired system and then point the import cmdlet at the “PrnxCli.dll” file. Pointing the import cmdlet at the “PrnxCli.psd1” file produces an error stating it can’t find the nested modules:
import-module prnxcli.dll

Second, connect to the PernixData Management server:
($creds variable is the result of the Get-Credential function used to store credentials)
connect-prnxserver

Since I already setup an FVP cluster, lets explore an existing FVP cluster by the name of “Home”. The “Get-PrnxFVPClusterDetail” cmdlet shows all of the objects within the Home FVP cluster:
get-PrnxFVPClusterDetail

Displaying the current acceleration policy for a specific object via “Get-PrnxAccelerationPolicy” for the “probcosplx” VM:
Get-PrnxAccelerationPolicy

Some other cmdlets that can be used to explore the environment include: “Get-PrnxNFS”, “Get-PrnxScsiLUN”, “Get-PrnxVM”, and “Get-PrnxVMFS”. However if you’re in a smaller environment, you can get a sum of all of those cmdlets by running the “Get-PrnxObject” cmdlet. It’s also worth noting that all of the cmdlet responses have quite a bit more information under the covers such as auth level, support status, stats, policies, etc. Run the cmdlet with a ” | select *” to see the rest of the information being returned.
Get-PrnxObject

The last thing that we haven’t looked at in the exploratory phase would be statistics! Those are pulled by way of the “Get-PrnxObjectStats” cmdlet:
Get-PrnxObjectStats

Now that we have the exploration piece done, let’s modify an object to change their Acceleration Policy. This is accomplished by way of the “Set-PrnxAccelerationPolicy” cmdlet:
Set-PrnxAccelerationPolicy

Overall, it’s a pretty comprehensive module where anything you can do in the GUI can be done via Powershell. However there are some things, as minor as they are, that I wouldn’t mind seeing added to the module in a future release:

  • Get-PrnxAccelerationPolicy – Show the name of the object information is received about, auto-population of the “Type” parameter, and a better way to decipher if an object is accelerated or not (currently an un-accelerated object shows up with an empty FlashCluster but still shows a policy of “Write Through”)
  • Adding some functionality around piping output into new cmdlets.

Lastly, I figure I should show off some of the stats as they really are quite impressive. Here’s what FVP did for me in just 3 days in my home lab:
Awesome Pernix Stats

PowerCLI 6.0 R2 – Announcing vROps Integration!

For those that have been requesting some vCOps and/or vROps integration into PowerCLI, as I have been, we finally have our solution! PowerCLI 6.0 R2 brings that to the table in the form of a new module: VMware.VimAutomation.vROps

The following functions are featured in the module:
Connect-OMServer
Disconnect-OMServer
Get-OMAlert
Get-OMAlertDefinition
Get-OMAlertSubType
Get-OMAlertType
Get-OMRecommendation
Get-OMResource
Get-OMStat
Get-OMStatKey
Set-OMAlert

Here’s a couple tips to get started using it:
To begin pulling stats you will need to authenticate to the vROps instance via Connect-OMServer:
Connect-OMServer

After getting connected, and being connected to an associated vCenter, check out the resources via Get-OMResource by piping it a VMHost, VM, or so forth:
get-omresource

As you can see, I pulled the resources for a VMHost. Some of the basic, higher level, information is in there such as Health status and value, whether or not vROps is receiving any data about it, and how far back data has been collecting for the resource.

The following is pulling the same information for the vROps VM in my lab environment:
get-omresource

If you want to go straight to the stats, I don’t blame you one bit. However just running the Get-OMStat command is going to fill your PoSh window with every single stat available for that resource at all the time points available. Overwhelming would be putting it lightly, so you’ll want to also familiarize yourself with Get-OMStatKey. This function allows you to see what all stats you can actually pull:
get-omstatkey

Couple things I feel the need to point out:

  • Include both the AdapterKind and ResourceKind objects when calling this function, it returns every possible stat key possible without it… All 17,646 of them.
  • Even when including the AdapterKind and ResourceKind, I would highly recommend filtering out what what you’re looking for. The HostSystem ResourceKind has 2225 stat keys alone.

Finally, lets select a stat key and pull some detailed stats by way of the Get-OMStat function. In this scenario, I’m pulling CPU Ready Summation values:
Get-OMStat

Some of the other functions included surround alerting.

The Get-OMAlert function pulls all of the vROps alerts:
get-omalert

Since there happens to be some alerts, let’s check out two abilities of the Set-OMAlert function. The first option being cancelling of an alert:
set-omalert -Cancel

If you notice in the example, the alert still exists but it’s status is changed to “Inactive”.

Next up, let’s check out the suspend function of the Set-OMAlert function:
Set-OMAlert -SuspendMinutes

Overall, the new module definitely gets my stamp of approval! Thanks to the Automation and PowerCLI team for listening to the users and getting this integrated!

Additional information is available at the following link: https://blogs.vmware.com/PowerCLI/2015/09/powercli-6-0-release-2-is-now-generally-available.html

PoSh – Gathering VMware NSX Info via API

I’ve been lucky enough to get a chance to do some work involving VMware’s NSX product lately. Having watched a bunch of VMworld sessions, live demos and messed around with it in the VMware Hands on Labs I was fairly comfortable in an existing environment. However I’ve gotten fairly used to using Powershell to do most of my work and there doesn’t appear to be much out there in the way of cmdlets or functions.

Chris Wahl has some really good resources regarding using Powershell to do API calls with NSX to both gather controller information (Creating NSX API Calls with PowerShell – Wahl Network) and create/remove virtual network tiers (Leveraging PowerShell to Deploy Virtual Network Tiers with VMware NSX – Wahl Network).

Thanks to Chris’ first post, I’ve taken what he created and built out a couple additional functions and even dumped them all into module form.

An overview of what’s currently included in the module:

Function Name Description
Get-NSXController Will inventory all of your controllers from NSX Manager
Get-NSXController
Get-NSXEdges Will inventory all of your Edge Nodes from NSX Manager
Get-NSXEdges
Get-NSXEdgeFeatures Will inventory all of your Edge Nodes’ Features from NSX Manager
Get-NSXEdgeFeatures
Get-NSXEdgeInterfaces Will inventory the selected Edge Node’s Interfaces from NSX Manager
Get-NSXEdgeInterfaces
Get-NSXEdgeNats Will inventory all of your Edge Node’s NATs from NSX Manager
Get-NSXEdgeNATs
Get-NSXEdgeRoutingOverview Will inventory all of your Edge Nodes’ Routing Overview details from NSX Manager
Get-NSXEdgeRoutingOverview
Get-NSXUplinks Will inventory all of your Edge Nodes’ Uplinks from NSX Manager
Get-NSXEdgeUplinks

A general walk-through of what’s occurring within each function is Powershell using the Invoke-WebRequest cmdlet against the NSX Manager’s REST API and formatting what’s returned into an easy to consume format that is a similar match to what’s returned back by way of the “Networking and Security” plugin.

Requirements:
Powershell 3.0 or better: Invoke-WebRequest first appeared in Powershell version 3.0, so anything less won’t work.
NSX Manager Admin credentials: All of the information is being pulled directly from the NSX Manager
Import the module by way of the .psd1 file: while not really a requirement, it certainly helps with the formatting of the output

Example of how the formatting is handled, first with the .psd1 file then with the .psm1 file:
Loading NSX PSD1 vs PSM1

Link to the GitHub repo location: https://github.com/kmruddy/Powershell/tree/master/Modules/NSXModule

An automated way of downloading the files into a dedicated directory and importing the module into the current session:

Note: this was a script that worked in my environment. There is no warranty or support with this script, please use at your own risk.

PowerCLI – View – Pool Health Check Report

I’ve been given the chance to work with View a little more here recently and focus in on some of the gaps that are missing, specifically around reporting and alerting. vC Ops and the View adapter are in use, however the alerts leave much to be desired. I’m glad to be able to say that the gaps are filled in with the new version, and new title, of vR Ops and the View adapter but this environment is not yet to that point.

Examples of the vR Ops alerts which are included by default:

vR Ops Default View Alerts

What gaps am I referring to? I’m aiming specifically at the View Pool state, provisioning state and the amount of available desktops compared to the headroom configuration.

To do this, I enlisted the help of the View PowerCLI cmdlets and the View Connection server ADAM database to create the script below that creates an output similar to this:
(Note: the asterics around the value that caused the report to be sent)

View Pool Report Output

Before getting to the script, lets cover some of the requirements of the script:

  • This script is to be run from a Connection server.
  • This script is currently formatted to have the report be consumed by way of email.
  • The email variables need to be filled in to match the environment it’s being run in.
  • The email is sent only if the following criteria are met:
    • A Pool’s state is false.
    • A Pool’s provisioning state is false.
    • A Pool’s available desktops are less than the headroom setting by the amount set in the desktopthreshold variable.
  • The default desktop threshold is meant to be a percentage and is set to a default of 90%, or 0.9. This is easily modified on line 22.

Note: this was a script that worked in my environment. There is no warranty or support with this script, please use at your own risk.

PowerCLI – Automate the vROps OVA Deployment

For those that haven’t heard, vCenter Operations (known better as vC Ops) has been not only updated but renamed. It’s new name is vRealize Operations (or, probably, vR Ops) and it is officially version 6.0. Previously the system was deployed in a vApp containing a UI VM and an Analytics VM. The new systems incorporates a roles for the VMs such as Master, Master Replica, Data and Remote Collecter.

However, this blog post isn’t to focus on what’s been updated. It’s to take a look at making the deployment a little easier since most installs will have at least two nodes. If you would like some further information on the update, please check out VMware’s website: http://www.vmware.com/products/vrealize-operations

After running the script below, you’ll find an output similar to the following:

vROps-Deploy

Before getting to the script, lets cover some of the assumptions and requirements made in the script:

  • The OVA has already been downloaded and is placed somewhere available to the system running the script. (Example: local disk, SMB or DFS share, etc.)
  • The VM is being placed in a resource pool.
  • The local system is able to successfully run and resolve the VM name via Resolve-DnsName cmdlet which is available in PowerShell v4.
  • The subnet being used is a /24 or 255.255.255.0. This is easily modified on line 126.
  • The VLAN ID is based on the third octet of the system’s IP address. This information is set on line 128 and the portgroup is set on line 133.
  • The gateway ends with ‘.254’. This is easily modified on line 129.
  • DNS should be modified to match your environment which is based on line 130.

Note: this was a script that worked in my environment. There is no warranty or support with this script, please use at your own risk.

PowerCLI – Process of Adding Notes to VMs

Documentation is a good thing. No matter how big or small. One of the easiest methods of documentation is to use the built in annotation section for “Notes”.

Annotation Notes

What I’ve come up with is a fairly basic script to go through all the VM objects that do not contain notes and allow the user to insert notes on a line by line basis. Here’s an example:

Running the script

Here’s the script to accomplish it:

If a one-liner is more your speed, give this one a go… Note: you’ll have to specify your own cluster, if that’s a desired use.

Note: this was a script that worked in my environment. There is no warranty or support with this script, please use at your own risk.