Remove-VsanRemoteDatastore
This cmdlet removes (unmounts) remote vSAN datastores or cross-vCenter datastores from a vSAN cluster. The cmdlet removes only the specified datastores, leaving other remote datastores mounted. To unmount all remote datastores or to set a specific desired state, 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 remove remote datastores. |
| required
|
RemoteDatastore | Datastore[] | named |
|
Specifies the remote vSAN datastores to remove from the cluster. These datastores are provided by other vSAN clusters in the same vCenter Server. Only the specified datastores are removed; other remote datastores remain mounted. |
| 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 remove remote datastores. |
| required
|
XVCDatastore | VsanHCIMeshDatastore[] | named |
|
Specifies the cross-vCenter datastores to remove from the cluster. These datastores are provided by vSAN clusters in a different vCenter Server. Only the specified datastores are removed; other XVC datastores remain mounted. |
| 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"
$config = Get-VsanClusterConfiguration -Cluster $cluster
$remoteDatastore = $config.RemoteDatastore | Where-Object { $_.Name -eq "Remote-vSAN-DS" }
Remove-VsanRemoteDatastore -Cluster $cluster -RemoteDatastore $remoteDatastore
Removes a specific remote vSAN datastore "Remote-vSAN-DS" from the cluster.
Example 2
$cluster = Get-Cluster "ClientCluster"
$config = Get-VsanClusterConfiguration -Cluster $cluster
$xvcDatastore = $config.VsanXVCDatastore | Where-Object { $_.OwnerVcAddress -eq "10.192.1.100" }
Remove-VsanRemoteDatastore -Cluster $cluster -XVCDatastore $xvcDatastore
Removes a cross-vCenter datastore from VC "10.192.1.100" from the 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.