Posts

Migrating an ESXi Host and VMs from one vCenter to Another

One of my customers was transitioning into a cloud service provider, and as such their ESXi infrastructure needed to be changed around to support this decision.  A fairly standard design element of a provider datacenter is to break up the environment into 2 vCenter environments; one for management elements and one for customer VMs.  As such, we stood up the second vCenter server... but then we had the challenge of how do we move the exiting customers into the new customer resource vCenter? It wasn't that hard, although it took a little planning to ensure that we didn't cause any service disruption to the VMs that were already running.  Adding to the complexity of the move was the fact that Distributed vSwitches were in use at this site.  Given that vCenter owns the Distributed vSwitch, we weren't sure how the system would behave if we simply took over ownership of the ESXi servers into the new vCenter, so we settled on the following procedure: Remove vShield com...

Orphaned VMDK Files

(8/10/2015)  Update:  Unfortunately, some backend things have changed since I originally cobbled this script together and it doesn't work any more.  I'll fix it if I get the chance, but in the meantime, there's a free utility called  RVTools  that can identify orphaned VMDK files (which are entertainingly called Zombie VMDKs on the vHealth tab of the application).  That's a great application to be aware of anyway, as it makes it very easy to get access to a lot of important information that the vSphere client obscures. (11/9/2015) Update: I went ahead and put together a post detailing how I used RVTools and a helper script to identify, rename and then delete orphaned VMDK files . Every organization has to wrestle with orphaned VMDK files.  What is an orphaned VMDK file, you ask?  It's a VMDK file that's sitting on your SAN, consuming expensive storage, but isn't actually being used by any VM.  They're notoriously hard to find (especially...

VM NIC Hardware Failure Issue

A few customers have been hit by an intermittent issue where virtual machines seem to reject their network adapters.  In Windows, this shows up as the guest OS reporting a hardware failure on the NIC (which, given that the NIC is virtual, is bit of a hard sell).  So, while the VM has a network adapter attached to it and it is connected to the network, the VM doesn’t get any network access.  If you open up device manager, the “general tab” for the network adapter will show an error (error 10 if memory serves).  When you try to update the driver on the NIC, it will fail to install it.  I’ve only ever seen this with the vmxnet3 adapter, but I’ve heard that it can affect e1000 as well. Typically, the VM’s network connectivity can be restored by some combination of removing the vNIC from the VM and adding it back (well, it’s technically a new one as it will have a new MAC address), reinstalling the VMTools and/or removing nonpresent NICs from the guest OS.  T...

PowerCLI Script to Edit ESXi Host NTP Settings

Here's another quick one.  A customer of mine recently had to change their NTP settings across every ESXi host in their environment.  Given that they have a lot of clusters with different storage and network settings, host profiles didn't seem to be the best solution available.  Fortunately, PowerCLI has a few nice easy cmdlets to make life easier.  After a bit of quality time on google and the PowerCLI Cmdlet Reference Page , I was able to put together the following quick script.  It goes through every ESXi host in the environment, removes all configured NTP servers, adds whatever servers are specified in the $NTPServers array, sets the service to "on" (this site had some inconsistent configurations there) and restarts the service to ensure that the settings take effect. If you want to make use of any of this, just change the variables near the top to be a list of your NTP Servers of choice.  If you want to limit the scope of the script, you can change t...

View 5 Network Flows with Unidesk

Image
Simon Long put together an amazing View 5.2 Network Flows diagram  a few months ago.  I recently had a customer doing a View + Unidesk deployment, so I figured that I'd put together a version that shows how such an environment works.  I didn't cover all of the View 5.2 features that Simon did, but I made sure to show how the various Unidesk components link into and talk to the VMware components, as well as how those VMware components work between themselves.  Since this was inspired (and largely informed) by Simon's work, I figure that it's only fair to post it here.

Quick and Easy Datastore Usage Discovery

Have you ever had a full datastore and needed to easily discover which folder was the main culprit?  I’m sure that there are a thousand ways to do this, but one easy one is available from the ESXi host command line.  Either pull up the local console (with the local Shell enabled) or open an SSH session remotely (I know, we’re not supposed to do that anymore!).  Then, navigate to the datastore that you wish to examine with a command like: cd /vmfs/volumes/MyDatastore Once you’re on the datastore, use the “du” command to display disk usage.  If you use the command by itself, it will recursively display the disk usage of all folders/subfolders from your current location in kilobytes.  While that’s useful, it’s not the most user friendly thing in the world.  Instead, I like to use this command: du –m –d 1 That will display the disk usage in megabytes (it would be nice if it had a gigabytes option, but oh well) and will only display the total s...

View Security Server Pairing

Ok, this one is going to be another short one - "just a few paragraphs" short, at least.  I was configuring some View Security Servers for a customer today and came across a bit of difficulty.  Of course I had to tweak the physical firewall (I always forget to enable bidirectional esp), so I had to stop the process, make the new rules and then start up the installer again.  No big deal.  I got to the pairing point and, since the prior install had begun, I figured that I'd better make a new pairing password, which I did and promptly entered into the security server. "Invalid Password" the error box glibly told me. Ok, must've been a typo, so I tried another password.  Still, no dice.  4 failed pairing passwords later, I'm starting to think that I've either lost my ability to type or made some fundamental ID:10T error (trying to pair with the wrong Connection Server, setting the pairing password on the wrong Connection Server... something like tha...