Orphaned Files Revisited

In my Orphaned files and folders – Spring cleaning post from way back, I provided a script to find orphaned VMDKs. This week there was a post in the VMTN PowerCLI Community that had a request to find all orphaned files. Time for a revisit of my old post!

file-orphan

I took my old script, massaged it a bit and gave it a more contemporary look and feel.
Just for info, the SearchDatastoreSubFolders method is relatively slow. So scanning a couple of datastores for orphaned files might take a bit of time. Be patient 🙂

Continue reading Orphaned Files Revisited

VMFS Datastores – Expand and Extend

We all know, and love, PowerCLI‘s New-Datastore and Set-Datastore cmdlets to create and manipulate VMFS datastores. But when we look at the functionality available through the Web Client, there is one interesting feature for manipulating VMFS datastores that is missing from the PowerCLI cmdlets. The Increase button, which allows us to Expand or Extend an existing VMFS datastore*.

DS-Increase

Recently there were a couple of threads on this subject in the VMTN PowerCLI Community, so I decided to streamline my quick-and-dirty scripts into something more presentable, and create a PowerShell module to bundle the functions. I present the VMFSIncrease module!
The VMFSIncrease module will also be my first contribution to the PowerCLI Community Repository! More on that further on in this post.

 

 

* The expand and extend functions for a VMFS datastore depend on the availability of free space on the VMFS datastore extents and/or the availability of free LUNs

Continue reading VMFS Datastores – Expand and Extend

Remove old VM monitor dump files

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:

  • vmware64-core*.gz
  • vmware-vmx-zdump.*

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 😉

Continue reading Remove old VM monitor dump files

Find free SCSI LUNs

Another post that comes from a VMTN PowerCLI Community question. Jeff wanted to find the free SCSI LUNs in his environment.
While answering that thread I was amazed there was no PowerCLI function written yet to provide this functionality. At least that was what my friend Google told me 😉

Since there exists a SDK method that makes retrieving free SCSI LUNs quite easy, the function I came up with isn’t too complex.

But it should help you in further automating the setup of your datastores.

Continue reading Find free SCSI LUNs

Monitor the size of your vDisks

In a recent thread on the VMTN PowerCLI Community someone asked if it is possible to get historical hard disk statistics. I referred the user to my Datastore usage statistics post, where I showed how to use the “disk” metrics to get that information.

But getting the individual vDisk statistics is a bit more tricky compared to getting the datastore statistics, as I showed in that post. The “disk” metrics hold the information, but the Instance that points to the MoRef value of a VM makes it a bit more tricky to retrieve.

Be forewarned, the “disk” metrics hold usage data for all the vDisks that a specific VM has on a specific datastore. You will not be able to get individual vDisk statistics, unless the vDisks are stored on different datastores !

On the positive side, the “disk” metrics will allow you to see how your vDisks increase in size over time. For your Thick vDisks that increase will be by expanding them, and for your Thin vDisks it will also show the natural growth.

Continue reading Monitor the size of your vDisks

Test if the datastore can be unmounted

Lately I have been playing around with the new Storage related features in vSphere 5. One of the novelties is that you can now unmount a VMFS datastore and detach a SCSI LUN through the API.
To be able to unmount a datastore, some conditions have to be met. In the vSphere Client you get an informative popup that tells what is prohibiting the datastore unmount. If not all conditions are met, you can not continue with the unmount.

Nice feature, but what for those of us that want to automate this ?

Update October 28th 2012: Take into account that the datastorecluster is not connected to a host that is part of a cluster. Skip the HA heartbeat test.

Update April 23th 2012: Use the RetrieveDasAdvancedRuntimeInfo method to find the actual datastores that are used for the heartbeat.

Continue reading Test if the datastore can be unmounted

vSphere 5 Top 10 – VMFS5

Continuing my Dutch VMUG Event 2011 presentation series with a post on the VMFS5 feature. This feature clocked in at position 8 in the Top 10.

With VMFS5 comes a bunch of new features. Just to name a few:

  • 64TB VMFS Volumes in 1 extent
  • 64TB physical RDM
  • Unified block size of 1MB
  • Support for more files (> 100000)

For a complete list of the features that VMFS5 introduces, have a look at Cormac‘s post, called vSphere 5.0 Storage Features Part 1 – VMFS-5.

Continue reading vSphere 5 Top 10 – VMFS5

vSphere 5 Top 10 – HA

The second post originating from our presentation at the Dutch VMUG Event 2011 is about HA. vSphere High Availability appeared in the 2nd place of the vSphere 5 features Top 10. For the HA feature we showed how you could find out the FDM master and slaves in your cluster, and how to find the heartbeat datastore.

Continue reading vSphere 5 Top 10 – HA

Storage Views – Datastores

In the vCenter Client, since vSphere 4, you can find a Storage Views tab on several of the VI containers. The data in these Storage Views is collected and provided by the vCenter Storage Monitoring plug-in.

Have a look at David Davis‘s post, called Using VMware vSphere Storage Views, for more information on what you can do with the Storage Views.

Some time ago I got a question from Andrew how the Multipathing Status presented in the Storage Views could be detected and reported upon by a PowerCLI script. What looked rather simple at first, turned out to be a bit more difficult than I anticipated.

Continue reading Storage Views – Datastores

Datastore usage statistics

An interesting question came up in the PowerCLI Community. Can one extract the datastore statistics, that are used for the space utilization graphs in the vSphere Client, with PowerCLI ? The graph in question, which you find in the Datastores Inventory view under the Performance tab, looks something like this.

Continue reading Datastore usage statistics