• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

powershell

The uncrowned king of PowerCLI is Alan Renouf

Duncan Epping · Nov 5, 2009 ·

No, I am not exaggerating. Alan Renouf truly is the uncrowned king of PowerCLI. Although I’ve seen some amazing scripts from other people as well Alan always seems to bring that little extra to make him stand out. No this is not an Alan Renouf appreciation blog article, although he deserves one, this article is about his two latest additions.

The first one is the Virtu-Al VESI & PowerGui Powerpack. If you are like me, not a powercli hero, this is what you were looking for all along. Alan has bundled all his script into a Powerpack which enables you to import all his scripts at once and run them with a single click. All scripts are placed into categories which makes them easy to find. Not only can you use them you can also modify them to your needs. Of course if you do improve these scripts give some feedback to Alan so that he might be able to incorporate it into the Powerpack.

The second one is Version 3 of the daily report or vCheck as it is called as of v3. I wrote about version 1 and many people have downloaded it and are using it in their environment. The script just got better and a whole set of new features have been added. Alan was smart enough to ask around in the community what his report was lacking and incorporated all these tips in Version 3 of vCheck(previously known as the Daily Report). Again, if you feel there is anything missing don’t hesitate to leave a comment and ask Alan if he can add it… Here’s the list of new features:

  • Status report to screen whilst running interactively
  • At the top of the script you can now turn off any areas you do not want to report on (this makes it faster to run)
  • VMs on Local storage has been changed to report VMs stored on datastores attached to only one host
  • VM active alerts
  • Cluster Active Alerts
  • If HA Cluster is set to use host datastore for swapfile, check the host has a swapfile location set
  • Host active Alerts
  • Dead SCSI Luns
  • VMs with over x amount of vCPUs
  • vSphere check: Slot Sizes
  • vSphere check: Outdated VM Hardware (Less than V7)
  • VMs in Inconsistent folders (the name of the folder is not the same as the name)
  • Added the number of issues to each title line

Carter can you please hand over your crown to Alan?! Thanks,

Slot sizes

Duncan Epping · Oct 6, 2009 ·

I’ve been receiving a lot of questions around slot sizes lately. Although I point everyone to my HA Deepdive post not everyone seems to understand what I am trying to explain. The foremost reason is that most people need to be able to visualize it; which is tough with slot sizes. Just to freshen up an outtake from the article:

HA uses the highest CPU reservation of any given VM and the highest memory reservation of any given VM. If there is no reservation a default of 256Mhz will be used for the CPU slot and the memory overhead will be used for the memory slot!

If VM1 has 2GHZ and 1024GB reserved and VM2 has 1GHZ and 2048GB reserved the slot size for memory will be 2048MB+memory overhead and the slot size for CPU will be 2GHZ.

Now how does HA calculate how many slots are available per host?

Of course we need to know what the slot size for memory and CPU is first. Then we divide the total available CPU resources of a host by the CPU slot size and the total available Memory Resources of a host by the memory slot size. This leaves us with a slot size for both memory and CPU. The most restrictive number is the amount of slots for this host. If you have 25 CPU slots but only 5 memory slots the amount of available slots for this host will be 5.

The first question I got was around unbalanced clusters. Unbalanced would for instance be a cluster with 5 hosts of which one contains substantially more memory than the others. What would happen to the total amount of slots in a cluster of the following specs:

Five hosts, each host has 16GB of memory except for one host(esx5) which has recently been added and has 32GB of memory. One of the VMs in this cluster has 4CPUs and  4GB of memory, because there are no reservations set the memory overhead of 325MB is being used to calculate the memory slot sizes. (It’s more restrictive than the CPU slot size.)

This results in 50 slots for esx01, esx02, esx03 and esx04. However, esx05 will have 100 slots available. Although this sounds great admission control rules the host out with the most slots as it takes the worst case scenario into account. In other words; end result: 200 slot cluster.

With 5 hosts of 16GB, (5 x 50) – (1 x 50), the result would have been exactly the same. To make a long story short: balance your clusters when using admission control!

The second question I received this week was around limiting the slotsizes with the advanced options das.slotCpuInMHz and/or das.slotMemInMB. If you need to use a high reservation for either CPU or Memory these options could definitely be useful, there is however something that you need to know. Check this diagram and see if you spot the problem, the das.slotMemInMB has been set to 1024MB.

Notice that the memory slotsize has been set to 1024MB. VM24 has a 4GB reservation set. Because of this VM24 spans 4 slots. As you might have noticed none of the hosts has 4 slots left. Although in total there are enough slots available; they are scattered and HA might not be able to actually boot VM24. Keep in mind that admission control does not take scattering of slots into account. It does count 4 slots for VM24, but it will not verify the amount of available slots per host.

To make sure you will always have enough slots and know what your current situation is Alan Renouf wrote an excellent script. This script reports the following:

Example Output:

Cluster        : Production
TotalSlots     : 32
UsedSlots      : 10
AvailableSlots : 22
SlotNumvCPUs   : 1
SlotCPUMHz     : 256
SlotMemoryMB   : 118

My article was a collaboration with Alan and I hope you find both article valuable. We’ve put a lot of time into making things as straight forward and simplistic as we possibly can.

Alan Renouf’s, the powershell guru, Daily Report

Duncan Epping · Jul 16, 2009 ·

Alan Renouf is definitely on of the most active bloggers when we are talking about Powershell/PowerCLI. His posts are always educational and of a high quality. I love the one-liners but nothing, absolutely nothing, beats this awesome Daily Report script that Alan has just published. I’m not going to repost his full article because I think all of you should visit Alan’s website and give him feedback on the script so he can improve it.

There is a configurable section at the start of the script where you can set how many days old you would like your snapshots to be allowed in your infrastructure, anything over this will show in the report, it will even resolve the name ( the machine running the script must be part of an Active Directory Domain) so that you can forward this email on to them and ask them if they still need the snapshot.

The outcome of the script also contains:

  • Datastores that have less than x% free space
  • VMs which have been created in the last x days and who created these
  • VMs which have been deleted and who deleted them
  • Any Virtual Center Events which have been logged during the given timeframe
  • Any VM’s which have no VMtools installed
  • The state of all VMware services on the vCenter server
  • Any Windows events from the Virtual center server which are related to VMware
  • Any VMs which have CD-Rom or Floppy Drive’s connected
  • Any hosts in Maintenance Mode
  • Any Hosts in a disconnected state

Schedule it and email it to your helpdesk on a daily base and let them check the outcome and archive it. It might come in handy sometime when you need to troubleshoot your environment, believe me it will… Thanks Alan, keep it up.

PowerCLI: Upgrading vHardware to vSphere Part 1: Templates

Duncan Epping · Jun 27, 2009 ·

One of the blogs I’ve always enjoyed reading is ICT-Freak.nl. ICT-Freak is maintained by Arne Fokkema. Unfortunately Arne used to mix Dutch and English posts which means his blog is not aggregated on Planet V12n. This is why I wanted to point you out to the following awesome article:

With the release of vSphere VMware introduced a new hardware level for VM’s. De upgrade process to the new hardware level is already described on Scott Lowe’s blog: http://blog.scottlowe.org/2009/06/01/vsphere-virtual-machine-upgrade-process/.

I wanted to see if I could script this process with PowerCLI. My first goal was to upgrade al my templates.

The script does the following:

  • Export template names to CSV
  • Convert templates back to VM’s
  • Check the vHardware version of the VM. If the hardware version is version 4 start the VM
  • When the VM is ready check the VMware Tools version. If the VMware Tools are old, the script will install the new version.
  • When the VMware Tools are Ok the VM gets a shutdown.
  • When the VM is down, the vHardware will be upgraded
  • The final step is converting the VM back to a template.

I stripped out the link to his script, please visit the source article and download the script over there.

Code Central

Duncan Epping · Jun 24, 2009 ·

I visit the VMTN Communities daily and recently noticed a new section called Code Central. I didn’t pay attention to it cause I thought it was a private section but apparently it is not. Nava Davuluri introduced this new section and his role within VMware recently in a blog article:

I’m Nava Davuluri, a new hire into Product Marketing. This is my third month at VMware and things are off to a great start! One of the highlight events at my job so far includes attending the new vSphere launch, where I got to see business leaders in computer technology talk about how VMware products are increasing efficiency(performance, power and hardware) control( security and service levels) and choice (hardware, OS and application architecture) for the next-generation of cloud computing. This has given me a perspective on how important these products are and also made me realize the importance of my role.

I was hired to manage the sample code arena for developers and system administrators that make up the majority of VMware developer community. My biggest goal here is to make your life easier. Yes!, by creating a community based sample code site where it will be easy to create, collect and share sample codes in one single straight forward page.

Some people have started adding scripts to this new section of the community already, take a look and contribute!

http://communities.vmware.com/community/developer/codecentral
http://blogs.vmware.com/codecentral/

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 5
  • Go to Next Page »

Primary Sidebar

About the author

Duncan Epping is a Chief Technologist in the Office of CTO of the Cloud Platform BU at VMware. He is a VCDX (# 007), the author of the "vSAN Deep Dive", the “vSphere Clustering Technical Deep Dive” series, and the host of the "Unexplored Territory" podcast.

Upcoming Events

May 24th – VMUG Poland
June 1st – VMUG Belgium

Recommended Reads

Sponsors

Want to support Yellow-Bricks? Buy an advert!

Advertisements

Copyright Yellow-Bricks.com © 2023 · Log in