In fact I was amazed there obviously is no cmdlet nor scripts available to perform this rather basic task. Luckily I had some code snippets laying around that did the job. Basically, I followed KB1010821 to do the ESXi 5.x host rename. But I decided it would be better to provide a real function to do the job.
One of the questions, related to working with vSphere events and tasks, that often appear in the PowerCLI Community, is how do we know which events to select for a query.
To make that task a bit easier, I wrote the Event-O-Matic script. It’s a GUI that allows you to pick a number of events, and the script will generate the PowerShell code, and place it in the clipboard. The Event-O-Matic script was mentioned during our VMworld 2013 US session VSVC4944.
One of the new features that came with PowerShell v3 was the introduction of “robust” or “persistent” sessions. This is, imho, a huge improvement on the concept of remote sessions who were introduced in PowerShell v2.
In short, before robust sessions, you had to keep the the client, that created the session, open to keep the remote session alive. With robust sessions, the client side can be closed, and you can reconnect to the robust session, even from another client.
This new remote session concept is something that can be used to solve a number of known PowerCLI “issues”.
Siw stands for Server in Waiting. We selected that term since we liked the sound of it, no double entendre should be suspected
During last year’s VMworld #NotSupported sessions one of the hot topics was William Lam‘s vInception talk. “Nested ESXi” has since then become indispensable in the homelab of everyone tinkering with virtualisation !
As a follow-up to that session, William posted several blog posts on the subject. You can find them all in a handy overview.
But as much as I like his clear instructions on how to set up nested ESXi, I wanted to automate the process In my homelab I create, and remove, ESXi VMs on a regular basis. So with the “If you do it more than once, automate it” in mind, I decided to create a function for the process.
In my homelab I try to automate as much as possible. I have a number of scripts and functions that help me setting up test environments in my homelab. Since I got quite a number of requests on this, I decided to start a series on my homelab tools.
One of the tasks I automated is the provisioning of VMs. Quite easy when you have a vCenter that manages the cloning process. But in layer 1 of my homelab I’m running ESXi standalone on a PaaS provided server, so no vCenter.
With the Copy-DatastoreItem cmdlet it is easy to clone the files of a VM, but this kind of copy doesn’t know about the different types of VirtualDisk you can have in a VM. As a result, your Thin vdisks become Thick vDisks in the clone. The function in this post avoids that problem by using the VirtualDiskManager for copying the VMDK.
Note that there are a couple of prerequisites: the master VM needs to be powered off and have no snapshots. And till now I only tested this with VMs that run a Windows guest OS.
But why not use the TaskHistoryCollector and it’s methods ? It provides many filtering options, and since this filtering is done in vSphere itself, this way of working is inherently much faster than using a filter in your script.
Another interesting question in the PowerCLI Community today. David wanted to know if it was possible to track which VMs had been failed over to another ESXi host by HA.
With the Get-VIEventPlus function from my Get the vMotion/svMotion history post it is easy to get that informatiom from the Tasks and Events that are kept in the vCenter database.
When you need to move the content of one or more datastores, you sometimes stumble upon files that you didn’t know where there. One such type of files are dump files that are stored in a VM’s directory on the datastore.
The files I encountered were named like this:
There isn’t a lot of information available on what exactly these files are used for, besides that they seem to be created when the VM Monitor encounters a crash or a serious problem.
Since these files were quite old, and since I didn’t have any open tickets with VMware, I decided to remove these files. But of course in the PowerCLI way with a function
The availability of vMotion and svMotion, provided you have a license that allows it, in vSphere are some of its key features.
The DRS and SDRS functionality will use vMotion and svMotion to better use the available resources.
And you as a vSphere administrator can use it to facilitate your work. Just think of how easy patching or datastorecluster maintenance becomes with the help of these two features.
But as an administrator you want to be able to report on what vMotion and svMotion have been doing over a specific time interval in your vSphere environment.
In the past I already provided a vMotion reporting tool in Events – Part 8 – vMotion history, but now it was time to provide a universal (s)vMotion reporting feature.
Update October 29th 2013: added additional parameters to the Get-VIEventPlus function
User: one or more users for which to return the events
System: a switch to return all system user events
ScheduledTask: return all events for a specific Scheduled Task