Home > Blogs > VMware PowerCLI Blog

What’s new in PowerCLI 5.1–Datastore Clusters

As with previous releases of PowerCLI we constantly improve the number of cmdlets and enable the ability to work with some of the latest features.  With the recent release of PowerCLI 5.1 we have introduced the ability to work with Datastore Clusters.  This can be useful for the following scenarios:

  • Setting up new datastore clusters
  • Adding multiple datastores to datastore clusters
  • Adding multiple VMs to a datastore cluster
  • Removing datastore clusters
  • Configuring datastore clusters on mass
  • Automating the testing of datastore clusters

New Datastore Cluster Cmdlets

The following datastore cluster cmdlets are available for use:

Name Synopsis
Get-DatastoreCluster Retrieves datastore clusters.
New-DatastoreCluster Creates a new datastore cluster.
Remove-DatastoreCluster Deletes the specified datastore clusters.
Set-DatastoreCluster Modifies the configuration of the specified datastore cluster.

As well as these datastore cluster cmdlets you can also use the Move-Datastore cmdlet to move datastores into datastore clusters, an example of this can be seen below:

$myDatastoreCluster = Get-DatastoreCluster -Name “MyDatatoreCluster”

Get-Datastore “MyDatastore1”, “MyDatastore2” | Move-Datastore -Destination $myDatastoreCluster

Additional to this, the VM cmdlets have been adjusted to receive a datastore cluster as well as a datastore so when a VM is created or altered these can use datastore clusters, the cmdlets can also be used to define storage DRS rules, an example of this can be seen below:

$vmhost = Get-VMHost -Name MyVMHost1
$myVM = Get-VM -Name WindowsXP
$mySourceTemplate = Get-Template -Name WindowsTemplate
$myDatastoreCluster = Get-DatastoreCluster -Name MyStorageCluster1
$myAdvancedOption =
New-Object ‘VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.SdrsVMAntiAffinityRule’ $myVM


New-VM -Name VM -Template $mySourceTemplate -Datastore $myDatastoreCluster -AdvancedOption $myAdvancedOption -ResourcePool $vmhost

Using the datastore cluster cmdlets

The following video shows you how to use the datastore cluster cmdlets to quickly setup, configure and remove datastore clusters.

This entry was posted in Datastore, DatastoreCluster and tagged , , on by .
Alan Renouf

About Alan Renouf

Alan Renouf is a Product Line Manager at VMware focusing on API's, SDK's and CLI's, He is responsible for providing the architects and operators of private and public cloud infrastructure with the toolkits/frameworks and command-line interfaces they require to build a fully automated software-defined datacenter. Alan is a frequent blogger at http://blogs.vmware.com/PowerCLI a book author and has a personal blog at http://virtu-al.net. You can follow Alan on twitter as @alanrenouf.

3 thoughts on “What’s new in PowerCLI 5.1–Datastore Clusters

  1. Pingback: Welcome to vSphere-land! » vSphere 5.1 Link-O-Rama

  2. Harold Schoofs

    Hi Alan,

    first of all thanks for the great presentation at the Belgium VMUG last week.

    I found one little typo in this blog:
    Get-Datastore “MyDatastore1″, “MyDatastore2″ | Move-Datstore -Destination $myDatastoreCluster

    There is one “a” missing in Move-Datastore.



Leave a Reply

Your email address will not be published. Required fields are marked *