Working with the vCenter Server Simulator 5.5 – configuring custom ESXi hosts

Working with VCSIM (vCenter Server Simulator)

 

William Lam has done some excellent blog posts on using the simulator included with the VCSA (vCenter Server Appliance), to setup a simulated vSphere environment. Just the other day at VMworld Europe, he presented a session for vBrownBag entitled “NotSupported Tips/Tricks for vSphere 5.5“. In this session he introduced the new simulator, he dubs “VCSIM 2.0”, which is the latest iteration included with the VCSA 5.5 appliance.

I had previously had a brief look at the VCSIM included with 5.1, but after seeing its limited functionality, did not pursue its use for development testing. However, after learning about the features introduced in VCSIM “2.0”, I just had to take a further look…

To see how to setup and start VCSIM, have a read of Will’s blog post here. However, at a high level, this is what you need to do to start the simulator with defaults:

  • Deploy and fully configure the VCSA 5.5 appliance. Make sure DNS (forward and reverse) is working and the embedded database is properly configured, otherwise the vpxa service will have trouble intialising
  • Ensure you have no issues with the embedded DB being reset (i.e. don’t do this on a production VCSA!)
  • SSH in to the appliance
  • issue command:ย vmware-vcsim-start default

 

Customising the default VCSIM ESXi host model

 

Today, I needed to replicate a certain condition in our lab environment. Specifically, I needed the ESXi hosts to have 32 CPU cores. By default the ESXi hosts that are simulated have 8 cores. I did a bit of digging around in theย /etc/vmware-vpx/vcsim/model folder and figured out which files were referenced when launching the simulator with the default option. By default, the host model in the ESX50 folder is used, so naturally, in order to configure custom ESXi hosts, we need to edit the files within this folder.

Initially, I found one file, “HostHardwareInfo.xml” and changed the CPU core count value to 32. This appeared to work – starting up the sim, and looking at the Web Client, I saw that the simulated hosts were now showing 32 CPU cores. I also changed the RAM up to 32GB (from the default of 16) just to test another option, and this was also showing up. However, upon loading up the MOB (Managed Object Browser), and navigating to the these hosts, I saw that the properties under the host summary->config->hardware were telling another story – they were still set to 8 cores and 16GB RAM. A little more digging revealed that another file, “HostListSummary.xml” also needed to be updated.

So in order to setup your custom ESXi host models for the default VCSIM profile, make sure you update both of these files.

The files to update your default ESXi model
The files to update your default ESXi model

 

Here is the small change I made to increase the Host core count to 32 cores.

<cpuInfo>
    <numCpuPackages>2</numCpuPackages>
    <numCpuCores>32</numCpuCores>
    <numCpuThreads>4</numCpuThreads>
    <hz>2999654793</hz>
 </cpuInfo>

And the data reflected in the MOB:

ESXi Host Hardware Summary

 

Changes as seen in the vSphere Web Client:

vSphere Web Client Host Hardware Summary

Make sure you backup these files before changing them, so that you can roll back if you need to. There are other ways of creating your own profiles for the simulator, but I could not find any documentation on how to create custom hosts. The only bits I could find were relating to creating your own datastores. You can also use the default profile template to create your own profile in it’s entirety, and this is a better long term solution, however to get things up and running quickly with the default profile, the above works nicely.

Note that all properties and methods pertaining to each managed object found in the API appear to be set up and created when using the VCSIM, so this makes a great development/testing/lab tool. Kudos to VMware for releasing this with the VCSA, and thanks to William Lam for pointing it out and blogging about it!

VMworld Europe 2013 – PowerCLI Best Practices – A Deep Dive session

PowerCLI at VMworld

powercli-logo

Alan Renouf and Luc Dekens led a more advanced PowerCLI session first thing on Thursday morning. There was a good turn up, even after the VMworld Party the night before. This session was of more interest to me, covering off the more advanced features of PowerShell and PowerCLI.

Some of the content I found of interest was:

  • Event filtering with PowerCLI and the handy GUI/utility Alan/Luc have made to help navigate the events objects. (Event objects in the vSphere API start off on a base object “Event” type, with different derivatives that inherit from this base type for different kinds of events). Interesting for me, as I have actually written an iPhone (iOS) application that uses the VMware SDK to filter out and display information about different kinds of events from your vSphere infrastructure.
  • VMware Fling called “Web Commander” – this is a web application which appears to be running off PHP as far as I could tell. It gives end users the ability to easily call various PowerShell / PowerCLI scripts from a UI – which is great for operators, or those that are less comfortable playing with a shell ๐Ÿ™‚ I can see a good use case for this in just about any environment. It allows users to call scripts and use textboxes to pass parameters over to your scripts.
  • PowerShell remoting and PSSession creation/disconnection and reconnection to help improve execution times for scripts. Luc showed a nice way to setup a remote machine which can initialise PSSessions, and allow them to be reconnected at a later stage.
  • New vSAN cmdlets coming out with the newer PowerCLI iterations

You can find more information about the session from Luc and Alan’s personal blogs:

Virtu-al.net and LucD.info

Issues with authentication when running vSphere 5.5 with AD and SSO server on Windows Server 2012

This week I spent a considerable amount of time trying to first of all upgrade a vSphere 5.1 environment to 5.5, and then trying to build a new 5.5 environment up from scratch.

In both cases, the core environment was configured as follows:

 

  • Windows Server 2012 AD
  • Windows Server 2012 vCenter Server 5.5 + SSO
  • Windows Server 2012 with SQL Server 2012 for vCenter database

 

The upgrade process went fairly smoothly as expected. However, every time I tried to login to vCenter as a domain user via the vSphere Web Client, I would receive a message stating “cannot parse group information“. I did not find too much in terms of helpful messages in any logs, and the SSO log file that existed with vCenter 5.1 under the C:\ProgramData\VMware…\… folder does not seem to exist anymore (who knows where this went!)

However, after much struggling, I finally got the authentication working for users. Here is my authentication source configuration:

ad-ldap-source

The critical bit I found needed to actually login to the vSphere web client or the vSphere client (C# windows app) was that the format for usernames needed to be:

username@domainname.lan

 

For example:

vsphere-client-55-login-example

 

Any other format for the username that you would expect to work (like mydomain\username) would just fail, and in the web client you would see the error “cannot parse group information”.

 

This morning I saw that VMware had announced an issue specifically with this kind of configuration (AD on 2012 with SSO on 2012 server), and have posted a workaround. I have not yet tested their official workaround and patch yet, but found that the above worked for me. All my logins needed to be in the above format though – PowerCLI, VMware 3rd party apps, vSphere client etc…

Fun tweets relating to the experience:

Looks like the beta testing of vSphere 5.5 failed to pick up on this scenario then.

Ebook – VMware Workstation – No Experience Necessary

A little while back I got involved with Packt Publishing to help with the publishing of a book called “VMware Workstation – No Experience Necessary”. I was helping in the capacity of a technical reviewer – this meant reading and reviewing each chapter and suggested changes or improvements where necessary whilst the book was in development.

The book has now been published, and you can grab yourself a copy / support the author (Sander van Vugt) over at the Packt website: Link to ebook. This is a great book if you are new to VMware Workstation, and being fairly short (around 100 pages), it reads well and is to the point. It contains information on every aspect of setting up Virtual Machines, their configuration, networking and other tasks such as snapshots and remote management using Workstation so it really does a great job of getting the beginner up to speed.

 

vmware_workstation_ebook_cover

It is also available on Amazon in Paperback and Kindle editions

Regarding the actual work involved, I was purely interested in the review process and thought it would be an interesting project to help with – none of the book sale proceeds come my way.

vPi – a Raspberry Pi for VMware presentation on vBrownBag EMEA

Last week I hosted a session talking about vPi. vPi is an image for the Raspberry Pi based on Raspbian, specifically targeted at VMware integration. Many great things can be done with this solution, including some very nifty automation, scripting and reporting.

The session was hosted on the weekly vBrownBag EMEA webinar. Take a look at the embedded Vimeo video below to watch through. Here is a basic breakdown of what the session covers:

  • Introduction / about
  • Basic intro to Raspberry Pi
  • Basic intro to vPi
  • Live demo
    • Demonstration of various VMware utilities included with vPi, such as ESXCLI, the RVC fling, vmkfstools, etc…
    • Very cool provisioning script demo using Python and Perl to deploy Virtual Machines by users sending a simple e-mail through to a designated mailbox (audience participation)
    • Quick demo of a home automation script that integrates with Foursquare, Facebook, and local Weather channels to announce various statuses/states
  • Conclusion

Remember to switch to HD mode so you can read the text in the presentation and PuTTy session I had open. Also a big thanks to Gregg Robertson (co-worker and fellow saffa) for inviting me to present on last week’s vBrownBag EMEA session.

 

httpvh://vimeo.com/71875957

 

Slides are available for download here, but it probably makes more sense to check the whole presentation out on Vimeo, as the demo is the bulk of the session:

[download id=”26″]