View Only
  • 1.  Get-Datastorecluster

    Posted Apr 26, 2012 02:25 PM


    Last year I wrote a script that uses some basic forms to deploy multiple VM's based upon inputs. It works fine on our old 4.1 cluster.

    We are getting ready to deploy some new hardware with some 5.0 clusters on it and and am in the process of converting my little script to take advantage of some of the things we are doing on the new clusters.

    One of thos things is we want to deploy to datastore clusters. In my script I do a couple of things like suck down a list of the datastores and then verify that that datastore is accessible from the host you are trying to deploy to. I do it (clumsily) like this.

    $dsonhost = Get-Datastore -VMHost $Hostdropdown.Text | Select-Object -ExpandProperty Name
    if ($dsonhost -notcontains $storedropdown.Text)
    $msg = [System.Windows.Forms.MessageBox]
    $msg::Show("The datastore you choose does not exist on the host. Please check your selections.")

    Well there doesnt seem to be a way to the same thing with a ds cluster.

    Am I missing something?


  • 2.  RE: Get-Datastorecluster

    Posted Apr 26, 2012 02:30 PM

    You are not missing anything, as far as I know, there are currently no Datastore Cluster Cmdlets.

  • 3.  RE: Get-Datastorecluster

    Posted Apr 26, 2012 02:36 PM

    Uggg..thats what I thought but was hoping I was wrong. Get-datastorecluster appears pretty limited.

    Thanks for the confirmation!

  • 4.  RE: Get-Datastorecluster

    Posted Apr 26, 2012 03:39 PM

    While you're waiting for the DatastoreCluster cmdlets to become available, you could use some functions from vSphere 5 Top 10 – Storage DRS.

    What exactly are you trying to do ?

  • 5.  RE: Get-Datastorecluster

    Posted Apr 26, 2012 04:16 PM

    Hi LucD.

    First of all let me thank you. What I wrote last year works as well as it does because I spent many hours reading your stuff.

    I did look at your article and its actually opened in another tab as I write this.

    What I have is a form that allows my co-workers to enter in a bunch of parameters around a new VM (or multiple) they want to create. When they hit go it will gen up the vm's based on template and customizations they choose and the servers will build, boot, patch, add to domain, etc. They can queue up 20 new servers, hit go, head to lunch and come back with a fully functional enviroment for whatever project they are working on.

    To make it easier on them I do things like prepopulate drop down lists with things like networks, hosts, datastores, etc. They are read in when the script starts.

    One thing I do before the build execution is do a sanity check on their selections like does the network live on that host (I used some of your stuff for the vds queries), ip-gw-mask all proper, stuff like that.

    One of the checks is that the datastore chosen is accessible from the host they choose. Now we have dsclusters with groups of those datastores that are only accessible to certain hosts. It was easy to check that connectivity before (see my slop above), but its doesnt seem as straightforward now.

    I suppose I could go at it backwards and see if I could figure out the datastores in the dscluster then loop then through one at a time against the host they choose. Not sure how I would even go about that though.


  • 6.  RE: Get-Datastorecluster

    Posted Apr 26, 2012 05:43 PM

    There is a simple trick to get the datastores in a datastorecluster.

    $dsc = Get-DatastoreCluster MyDsc | Get-View
    Get-View $dsc.ChildEntity | Select Name

    With the list of datastores you should be able to do your sanity check I suppose

  • 7.  RE: Get-Datastorecluster

    Posted Apr 26, 2012 05:49 PM

    I will give that a shot.