vSphere Storage Distributed Resource Scheduler is a VMware vSphere Enterprise Plus feature first introduced in vSphere 5.0. It gives you the possibility to combine datastores in a datastore cluster. You can then manage the datastore cluster instead of the individual datastores. When you create a new virtual machine and put the disks on a datastore cluster, Storage DRS will place the disks on the optimal datastore based on utilized disk space and datastore performance. Storage DRS can also migrate disks to another datastore in the same datastore cluster when the utilized disk space or latency of a datastore becomes too high. You can also make affinity rules to separate disks and virtual machines over multiple datastores or keep them together on the same datastore. If you put a datastore in Datastore Maintenance Mode, Storage DRS will move all the disks on this datastore to other datastores in the same datastore cluster.
The first thing that you have to do, if you want to use Storage DRS, is to create one or more datastore clusters. If you have multiple types of datastores, such as gold, silver, and bronze, you might want to create a datastore cluster for each type.
You can create a datastore cluster with the New-DatastoreCluster
cmdlet. This cmdlet has the following syntax:
New-DatastoreCluster [-Name] <String> -Location <VIContainer>
[-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
The New-DatastoreCluster
cmdlet has two required parameters: -Name
and -Location
. The value of the -Location
parameter must be a data center or a folder. The following command will create a new datastore cluster named Gold-Datastore-Cluster
in data center New York
:
PowerCLI C:> New-DatastoreCluster -Name Gold-Datastore-Cluster -Location (Get-Datacenter -Name 'New York') Name CapacityGB FreeSpaceGB SdrsAutomationLevel ---- ---------- ----------- ------------------- Gold-Datastore-Cluster 0.000 0.000 Disabled
The Get-DatastoreCluster
cmdlet will retrieve all of your datastore clusters or one or more specific datastore clusters. The syntax of the Get-DatastoreCluster
cmdlet is as follows. The first parameter set is the default.
Get-DatastoreCluster [-Id <String[]>] [[-Name] <String[]>]
[-Location <VIContainer[]>] [-VM <VirtualMachine[]>] [-Template
<Template[]>] [-Datastore <Datastore[]>] [-Tag <Tag[]>] [-Server
<VIServer[]>] [<CommonParameters>]
The second parameter set is for retrieving datastore clusters by related object:
Get-DatastoreCluster [-RelatedObject]
<DatastoreClusterRelatedObjectBase[]> [<CommonParameters>]
If you don't specify a parameter, the New-DatastoreCluster
cmdlet will retrieve all of your datastore clusters. You can use one of the parameters to retrieve datastore clusters based on ID, name, location, virtual machines, templates, datastores, tags, vCenter server, or related object. In the following example, we will retrieve all of our datastore clusters:
PowerCLI C:> Get-DatastoreCluster Name CapacityGB FreeSpaceGB SdrsAutomationLevel ---- ---------- ----------- ------------------- Gold-Datastore-Cluster 0.000 0.000 Disabled
After creating a datastore cluster, Storage DRS is disabled. To enable Storage DRS, you have to use the Set-DatastoreCluster
cmdlet. The syntax of this cmdlet is as follows.
Set-DatastoreCluster -DatastoreCluster <DatastoreCluster[]>
[-IOLatencyThresholdMillisecond <Int32>] [-IOLoadBalanceEnabled
[<Boolean>]] [-Name <String>] [-SdrsAutomationLevel
<DrsAutomationLevel>] [-SpaceUtilizationThresholdPercent <Int32>]
[-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
The -DatastoreCluster
parameter is required.
To enable Storage DRS, you have to use the -SdrsAutomationLevel
parameter. This parameter has three possible values:
Disabled
Manual
FullyAutomated
If you use Manual
, Storage DRS will give you recommendations for placement of disks on datastores. You will have to apply the recommendations to move the disks. If you choose FullyAutomated
, Storage DRS will automatically move disks if the utilized disk space or latency of a datastore becomes too high.
In the following example, we will enable Storage DRS and set the automation level to FullyAutomated
for the Gold-Datastore-Cluster
. We will also enable load balancing based on I/O metrics:
PowerCLI C:> Set-DatastoreCluster -DatastoreCluster Gold-Datastore-Cluster -SdrsAutomationLevel FullyAutomated -IOLoadBalanceEnabled:$true Name CapacityGB FreeSpaceGB SdrsAutomationLevel ---- ---------- ----------- ------------------- Gold-Datastore-Cluster 0.000 0.000 FullyAutomated
In the following screenshot of the vSphere Web Client, you will see datastore cluster Gold-datastore-Cluster
after executing the preceding command:
The Move-Datastore
cmdlet will move datastores into a datastore cluster or to a folder or data center. The syntax of the Move-Datastore
cmdlet is:
Move-Datastore [-Datastore] <Datastore[]> [-Destination]
<VIObject> [-Server <VIServer[]>] [-WhatIf] [-Confirm]
[<CommonParameters>]
The -Datastore
and -Destination
parameters are required.
In the following example, we will move the Cluster01_Vmfs01
datastore into datastore cluster Gold-Datastore-Cluster
:
PowerCLI C:> Move-Datastore -Datastore Cluster01_Vmfs01 -Destination (Get-DatastoreCluster -Name Gold-Datastore-Cluster) Name FreeSpaceGB CapacityGB ---- ----------- ---------- Cluster01_Vmfs01 248.801 249.750
In the following screenshot of the vSphere Web Client, you will see datastore Cluster01_Vmfs01
after being moved into datastore cluster Gold-Datastore-Cluster
:
If you want to know which datastores are in a datastore cluster, you can use the Get-Datastore -Location
parameter. In the following example, we will retrieve all of the datastores in the Gold-Datastore-Cluster
datastore cluster:
PowerCLI C:> Get-Datastore -Location (Get-DatastoreCluster -Name Gold-Datastore-Cluster) Name FreeSpaceGB CapacityGB ---- ----------- ---------- Cluster01_Vmfs01 248.801 249.750
To remove a datastore from a datastore cluster, you have to move the datastore to a folder or a data center. In the following example, we will move the Cluster01_Vmfs01
datastore from the Gold-Datastore-Cluster
datastore cluster to the New York
data center:
PowerCLI C:> Move-Datastore -Datastore Cluster01_Vmfs01 -Destination (Get-Datacenter -Name 'New York') Name FreeSpaceGB CapacityGB ---- ----------- ---------- Cluster01_Vmfs01 248.801 249.750
To check whether the Cluster_Vmfs01
datastore was removed from the datastore cluster, we can use the Get-Datastore
cmdlet again, as in the following example.
PowerCLI C:> Get-Datastore -Location (Get-DatastoreCluster -Name Gold-Datastore-Cluster) PowerCLI C:>
The command shows no output, so the Gold-Datastore-Cluster
datastore cluster does not contain any datastores anymore.
To remove a datastore cluster, you can use the Remove-DatastoreCluster
cmdlet. The syntax of this cmdlet is as follows:
Remove-DatastoreCluster [-DatastoreCluster] <DatastoreCluster[]>
[-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
The -DatastoreCluster
parameter is required.
In the following example, we will remove the Gold-Datastore-Cluster
datastore cluster:
PowerCLI C:> Remove-DatastoreCluster -DatastoreCluster
Gold-datastore-Cluster -Confirm:$false
The preceding command does not return any output.
18.116.36.192