Add-VsanRemoteDatastore
This cmdlet adds remote vSAN datastores or cross-vCenter datastores to a vSAN cluster. The cmdlet adds the specified datastores to any existing remote datastores already mounted on the cluster. To replace all mounted remote datastores with a specific set, use the Set-VsanClusterConfiguration cmdlet with the -RemoteDatastores or -XVCDatastores parameter.Remote vSAN datastores require vSAN 7.0 Update 1 or later. Cross-vCenter datastores require vSAN 8.0 Update 1 or later.
Syntax
Parameters
| Required | Parameter Name | Type | Position | Features | Description |
|---|---|---|---|---|---|
| required
|
Cluster | Cluster | named |
|
Specifies the vSAN cluster for which to add remote datastores. |
| required
|
RemoteDatastore | Datastore[] | named |
|
Specifies the remote vSAN datastores to add to the cluster. These datastores are provided by other vSAN clusters in the same vCenter Server. The datastores are added to any existing remote datastores already mounted on the cluster. |
| optional | RemoteVsanServerClusterConfig | RemoteVsanServerClusterConfig | named |
|
Specifies the remote vSAN server cluster configuration for mounting datastores from stretched clusters. This parameter is only applicable when mounting a remote datastore (not XVC datastores). When mounting a datastore from a stretched cluster, this parameter must be provided with network topology information. Use New-RemoteVsanServerClusterConfig to create the configuration object. |
| optional | RunAsync | SwitchParameter | named |
|
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. |
| optional | Server | VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. |
Parameters
| Required | Parameter Name | Type | Position | Features | Description |
|---|---|---|---|---|---|
| required
|
Cluster | Cluster | named |
|
Specifies the vSAN cluster for which to add remote datastores. |
| required
|
XVCDatastore | VsanHCIMeshDatastore[] | named |
|
Specifies the cross-vCenter datastores to add to the cluster. These datastores are provided by vSAN clusters in a different vCenter Server. The datastores are added to any existing XVC datastores already mounted on the cluster. Use Get-VsanHCIMeshDatastore to retrieve available cross-vCenter datastores. |
| optional | RunAsync | SwitchParameter | named |
|
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. |
| optional | Server | VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. |
Output
Examples
Example 1
$cluster = Get-Cluster "ClientCluster" $remoteDatastore = Get-Datastore "Remote-vSAN-Datastore" Add-VsanRemoteDatastore -Cluster $cluster -RemoteDatastore $remoteDatastore
Adds a remote vSAN datastore to the specified cluster.
Example 2
$cluster = Get-Cluster "ClientCluster" $remoteDatastore = Get-Datastore "Remote-vSAN-Datastore" $remoteCluster = Get-Cluster "ServerCluster" $remoteConfig = New-RemoteVsanServerClusterConfig -NetWorkTopology SingleVcStretchedCluster -Cluster $remoteCluster Add-VsanRemoteDatastore -Cluster $cluster -RemoteDatastore $remoteDatastore -RemoteVsanServerClusterConfig $remoteConfig
Adds a remote vSAN datastore from a stretched cluster with network topology configuration.
Example 3
$cluster = Get-Cluster "ClientCluster" $dsSource = Get-VsanHCIMeshDatastoreSource -VCHost "10.192.1.100" $xvcDatastore = Get-VsanHCIMeshDatastore -VsanHCIMeshDatastoreSource $dsSource Add-VsanRemoteDatastore -Cluster $cluster -XVCDatastore $xvcDatastore
Adds a cross-vCenter datastore from a remote vCenter to the specified cluster.
Related Commands
VsanRemoteDatastore
This cmdlet adds remote vSAN datastores or cross-vCenter datastores to a vSAN cluster.
This cmdlet removes remote vSAN datastores or cross-vCenter datastores from a vSAN cluster.