Posts

Showing posts with the label Scratch

Setting up Persistent Scratch Space for an Arbitrary Number of ESXi Hosts

We've been configuring a large number of ESXi servers that don't have local hard drives.  As such, we need to set up each system's scratch location on persistent storage, as per that KB article from VMware. That KB Article has a great section devoted to performing the process from PowerCLI and it basically takes you through the whole thing, soup to nuts, for a single ESXi host.  That's all well and good, but what if you've got 16 hosts?  Or 32?  Or 64?  Well, with a few minor changes to the procedure that they've outlined, you can very easily target every ESXi host in an environment.  Bear in mind that this process does require a host reboot, so make sure that you have your ducks in a row (and preferably do this before you place any VMs onto the cluster). Instead of their step 6, I used this command to create a folder for all ESX hosts in the inventory: get-vmhost | foreach {new-item ".$($_.name)/scratch" -itemtype directory} Instead of their s...

PowerCLI Wildcards

It seems like every day I'm reminded just how helpful PowerShell (and specifically PowerCLI) is during normal server administration.  Sure, you can do those tasks in the GUI with a few mouse clicks (and a moderate amount of waiting for the web interface to draw windows...), but PowerCLI can get it done so much faster! For example, one of my customers had a collection of ESXi hosts that needed to be moved into a cluster.  Rather than dragging each one into it, I looked up the PowerCLI command (get-vmhost ESXiServer | move-vmhost -destination ClusterName).  Once you can do it for one host, it takes even fewer characters to do it to all hosts (get-vmhost | move-vmhost -destination ClusterName).  The part that made me smile was that it was also trivial to select the specific range of hosts that I wanted to move by simply using: get-vmhost *esx0[1-8]* | move-vmhost -destination ClusterName. What that command did, for anyone who isn't familiar with that syntax, is to m...