NAME
Set-DcsLogicalDiskRole
SYNOPSIS
Sets roles (First, Second, Backup) for the logical disks of a 3-way VirtualDisk.
SYNTAX
Set-DcsLogicalDiskAccess -VirtualDisk <Object> -FirstServer <Object> -SecondServer <Object> -BackupServer <Object> [<CommonParameters>]
Set-DcsLogicalDiskAccess -FirstLogicalDisk <Object> -SecondLogicalDisk <Object> -BackupLogicalDisk <Object> [<CommonParameters>]
DESCRIPTION
Sets roles (First, Second, Backup) for the logical disks of a 3-way VirtualDisk. The cmdlet can either change roles based on the logical disks of the VirtualDisk or change roles based on the VirtualDisk and the servers in the ServersGroup. After the cmdlet completes, it is recommended to wait for the data to be up-to-date before performing another role change.
PARAMETERS
- -VirtualDisk <Object>
- The VirtualDiskData object that identifies the virtual disk for which the roles of its logical disks will be changed. The VirtualDiskData object can be obtained from the cmdlet Get-DcsVirtualDisk.
-
- Required: true
- Position: named
- Default value:
- Accept pipeline input: true (ByValue)
- Accept wildcard characters: false
-
- -FirstServer <Object>
- The ServerHostData object that identifies the new first server. The ServerHostData object can be obtained from the cmdlet Get-DcsServer.
-
- Required: true
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -SecondServer <Object>
- The ServerHostData object that identifies the new second server. The ServerHostData object can be obtained from the cmdlet Get-DcsServer.
-
- Required: true
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
- -BackupServer <Object>
- The ServerHostData object that identifies the new backup server. The ServerHostData object can be obtained from the cmdlet Get-DcsServer.
-
- Required: true
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -FirstLogicalDisk <Object>
- The LogicalDiskData object that identifies the new first logical disk, either by ID or caption. The LogicalDiskData object can be obtained from the cmdlet Get-DcsLogicalDisk.
-
- Required: true
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -SecondLogicalDisk <Object>
- The LogicalDiskData object that identifies the new second logical disk, either by ID or caption. The LogicalDiskData object can be obtained from the cmdlet Get-DcsLogicalDisk.
-
- Required: true
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -BackupLogicalDisk <Object>
- The LogicalDiskData object that identifies the new backup logical disk, either by ID or caption. The LogicalDiskData object can be obtained from the cmdlet Get-DcsLogicalDisk.
-
- Required: true
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
- <CommonParameters>
- This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
Also see Get-DcsLogicalDisk, Get-DcsVirtualDisk, Get-DcsServer.
EXAMPLES
$vd = @(Get-DcsVirtualDisk | Where-Object { $_.SecondHostId -ne $null -and $_.BackupHostId -ne $null })[0]
$LDs = Get-DcsLogicalDisk -VirtualDisk $vd | Sort-Object -Property Caption
Set-DcsLogicalDiskRole -FirstLogicalDisk $LDs[2].Caption -SecondLogicalDisk $LDs[0] -BackupLogicalDisk $LDs[1].Id
This example sets the first logical disk as the logical disk on the third server (ordered by Caption), the second logical disk as the logical disk on the first server, and the backup logical disk as the logical disk on the second server. Also shows that we can use the logical disk object, the logical disk ID, or Caption.
Alias | : | None |
VirtualDisk | : | $vd |
FirstLogicalDisk | : | $LDs[2].Caption |
SecondLogicalDisk | : | $LDs[0] |
BackupLogicalDisk | : | $LDs[1].Id |
-------------- Example 2 Change logical disk role using VIRTUAL_DISK_AND_SERVERS_SET parameter set --------------
$vd = @(Get-DcsVirtualDisk | Where-Object { $_.SecondHostId -ne $null -and $_.BackupHostId -ne $null })[0]
$servers = Get-DcsServer | Sort-Object -Property Caption
Set-DcsLogicalDiskRole -VirtualDisk $vd -FirstServer $servers[2] -SecondServer $servers[0].Caption -BackupServer $servers[1].Id
This example sets the third server (ordered by Caption) as the new first server, the first server as the new second server, and the second server as the new backup server. Also shows that we can use the server object, the server ID, or Caption.
Alias | : | None |
VirtualDisk | : | $vd |
FirstServer | : | $servers[2] |
SecondServer | : | $servers[0].Caption |
BackupServer | : | $servers[1].Id |