Recently I was contacted and asked if there was a way to retrieve information about the NVMe Drives in an ESXi host, this information is easily accessible via ESXCLI using the “nvme” namespaces.
Through PowerCLI this can be easily called and then each feature can be called under this namespace to give you detailed information on the NVMe devices in your ESXi host. The reason they wanted to do this was to first check the firmware on all the NVMe devices in a cluster to see if they are at the latest revision. Another reason they wanted this script was in case one of the NVMe devices was behaving differently than the others it would be an easy way to compare the devices.
You can see an example of the script running below:
This year at VMworld SFO and BCN I was involved in organizing a couple of great hackathons with the @VMwareCode guys and William Lam, these were highly successful and I have to say the highlight of both my VMworlds. The teams were great, the end projects were fantastic and most of all, everyone that attended told me they learned something, this if you ask me was the main objective for the hackathon.
If you attended I do want to extend a huge thanks for joining in, having fun and learning with us.
To put the hacakthon together we needed to build up some environments for people to use, William came up with the idea of using Intel NUCs as these were easily transportable and packed a punch for their size, the equipment we purchased is listed below:
For the hackathon we needed to build a lot of these units, whilst we did some parts of it manually William and I recently took the time to complete the automated deployment of these units, in fact the script is not specific to these units, it will work on any ESXi host with 2 disks, one for performance and 1 for capacity. Of course you can also adjust the script to use more disks if you have them!
Once you have ESXi on a USB insert it into the machine and configure it to boot from the USB, after the ESXi machine is on the network you can alter the configuration settings in the start of the script and run the script in the Deployment Script section of this blog to automate the following:
- Configure VSAN in a single node configuration (Unsupported)
- Use the smaller SSD for performance
- Use the larger SSD for Capacity
- Configure NTP on the ESXi Host
- Enable SSH on the ESXi Host for debugging
- Configure the Syslog settings on the ESXi Host
- Deploy the VCSA on the ESXi Host
- Enable VSAN Traffic on the Management Network
- Create a Datacenter
- Create a Cluster
- Create a subscribed content library for William Lams Nested ESXi Library
- Enable Autostart so the VCSA VM starts when the ESXi machine powers on
- Enable SSH on the VCSA Server
Recently I was asked by someone how they could do rolling automated updates from ESXi 5.1 to ESX 5.1 Update 1 in their environment using PowerCLI, obviously there are a number of ways to achieve this and William Lam did a great job of showing these in this blog including a piece of sample PowerCLI code.
I figured I would share the code I used to perform this so that others may gain from this experience…
I noticed that in PowerShell V3.0 some CIM cmdlets were introduced which allowed PowerShell to be able to interact with CIM providers and gather information, when importing the CIM Cmdlets into my session you can see we have a number of new cmdlets to work with:
Even though I know PowerCLI 5.1 R1 (Current release on 29th Oct 2012) does not support PowerShell v3.0 I thought I would check out what I could do with these and what information I could receive using the CIM cmdlets.
As a reminder, Carter Shanklin did some work in this area a long time ago and he ended up writing a function to be able to pull CIM information from ESX hosts, this can be found here, he also includes some links to documentation on the CIM providers the VMware hosts can provide: http://blogs.vmware.com/vipowershell/2009/03/monitoring-esx-hardware-with-powershell.html
As you will see from the video below the new cmdlets cut out most of the hard work Carter had to do and allow us to pull CIM information from the ESXi hosts with ease.
Using PowerShell v3.0 CIM Cmdlets with VMware ESXi Hosts from Alan Renouf on Vimeo.
For your reference, here is the code I used during this demo:
$ipaddress = "10.20.177.15"
$HostUsername = "root"
$CIOpt = New-CimSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -Encoding Utf8 -UseSsl
$Session = New-CimSession -Authentication Basic -Credential $HostUsername -ComputerName $Ipaddress -port 443 -SessionOption $CIOpt
Get-CimInstance -CimSession $Session -ClassName CIM_Fan
Just released on the VMware Flings site is a fling which is designed to help when you make the move from ESX to ESXi, this tool will help you check hardware software and also that there are no lingering scripts or locally stored VMs etc.
A great tool to download and run against your environment to ensure you have caught everything before the move to the next version of ESXi. Continue reading
During VMworld most people I talked to were either moving to ESXi or excited by the new features of vSphere 5 and were investigating what they would need to do to upgrade and get the latest and greatest.
Those who attended the Hands on Lab were lucky enough to grab a poster bought to you by VMware Technical Marketing, this year VMware were giving out two posters, the first is the “VMware Management with PowerCLI 5.0” poster which can be downloaded here.
The second was a new poster which was designed to help you move to ESXi 5.0, this is called the “VMware ESXi 5.0 Reference” poster, it includes handy quick references to advise people of common tasks like upgrading to the latest version…
ESXi is based on a system image, VMware used to call this a firmware but some people found this misleading, most people still refer to it as firmware but in this post I will refer to it as a system image.
The system image is a unified image which is the same whether booting from USB, Hard Disk, PXE or any other media. The logic in the first boot will provide auto configuration based on the kind of installation you have.
One thing to remember about ESXi is that it is memory based, so once booted the system image is entirely loaded into memory, ESXi doesn’t care if the original media disappears after boot, there is no reliance on the boot device for running after booting.
ESXi is essentially made up from a number of tardisks (VM TAR files) or archives, these tardisks are mounted into the empty root filesystem in order of enumeration, one of these is called the state tardisk or state.tgz.
The state tardisk is made up of any file in /etc which is marked as sticky, VMware uses the sticky bit to flag the files which are to be included as part of this tardisk but only if they reside under /etc, these are files like esx.conf, inetd.con, passwd…. These are the files which will be persisted after boot.
I received an email recently from a gentleman asking if it was possible to export the support bundles for each host on a daily basis, this can be useful for not only having an archive of your system logs to help resolve problems and work out when they started but also useful for auditing purposes.
At the moment he was doing this manually every day by using the virtual infrastructure client as can be seen below – you can imagine how long this was taking !
Exporting the logs from the vCenter Client
1. Select the File menu and then Export, Export System Logs…
2. Select the hosts which you want to download the system logs for and click OK
Ok, I have been living under a rock a little recently, I have had so much going on that my blog and my hands on time has been suffering, sorry for that.
Whilst delivering a presentation on the new features in vSphere 4.1 – Of which there are tons (should have been 4.5 in my opinion), I came across the ability to be able to enable SSH from the DCUI (Direct Console User Interface).
And last in this series of presentations given in London on the 8th October but by no means least is Advanced performance troubleshooting using esxtop, this was an absolutely fantastic presentation by a guy who blew my mind, the best bit was when someone asked him a question and he told the audience member where to find the information on the system and how to decode it from the hex file it was written in – A serious Guru !
Unfortunately there was an issue getting the audio of this session so it looks like we will have to stick with the slide deck but please do not be disappointed as this is 59 deep dive slides on esxtop including some of the new counters only relevant to 4.1, please check it out its great stuff.