NAME
Get-DcsVirtualDisk
SYNOPSIS
Returns virtual disk data.
SYNTAX
Get-DcsVirtualDisk [ -ServerGroup <Object[]> ] [ -Server <Object[]> ] [ -Machine <Object[]> ] [ -Group <Object> ] [ -Kind <String[]> ] [ -VirtualDisk <Object> ] [ -OnlyWithReplications] [ -WithCdpEnabled <Boolean> ] [ -Connection <String> ] [ -PipelineVariable <String> ]
DESCRIPTION
Returns virtual disk data. Filtering parameters may be specified to narrow the scope of the data returned. Data can be returned for one or more server groups. If no parameters are specified, data for all virtual disks on all servers in the default connection will be returned, and if that group is in a replication partner group, data for all virtual disks in the replication partner group will be returned as well.
PARAMETERS
- -ServerGroup<Object[]>
- The ServerHostGroupData object, name or ID of one or more server groups. If specified, virtual disk data for the designated server groups will be returned. If not specified, virtual disk data for the server group of the specified connection will be returned, and if that server group is in a replication partner group, virtual disk data for the replication partner group will also be returned.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Server<Object[]>
- The ServerHostData object, computer name or ID of one or more servers. Computer names must be unique or the names must be fully qualified. If specified, only data for those servers will be returned.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Machine<Object[]>
- The ServerHostData or ClientHostData object, computer name or ID that identifies one or more servers or clients in order to obtain data for virtual disks served to them. The computer name for a server must be unique or the names must be fully qualified. If specified, only data for virtual disks served to the designated machines will be returned.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Group<Object>
- The VirtualDiskGroupData, name or ID of a virtual disk group. If specified, only data for that group will be returned.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Kind<String[]>
- The kind of virtual disks to return. If specified, only data for the designated types will be returned. Specify one or more of the following values: "Standard" will return virtual disks that are not rollbacks or snapshots. "Rollback" will return virtual disks that are rollbacks. "Snapshot" will return virtual disks that are snapshots.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -VirtualDisk<Object>
- VirtualDiskData object, name or ID that identifies a virtual disk. If specified, only data for that virtual disk will be returned.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: true (ByValue)
- Accept wildcard characters: false
-
- -OnlyWithReplications<SwitchParameter>
- Specify this parameter to only return data for virtual disks that are involved in replications.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -WithCdpEnabled<Boolean>
- Use this parameter to return virtual disk data based on the Continuous Data Protection (CDP) setting. Specify $true to return data for virtual disks with CDP enabled or $false to return data for virtual disks with CDP disabled.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Connection<String>
- Alias of the connection to the server group. If not specified, the default connection is used.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -PipelineVariable<String>
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
INPUTS
VirtualDiskData : Object that identifies and describes the virtual disk.
OUTPUTS
VirtualDiskData : Object that identifies and describes the virtual disk.
NOTES
Also see Set-DcsVirtualDiskProperties.
EXAMPLES
Get-DcsVirtualDisk -Machine Host4 -Kind Rollback
Returns data for all rollbacks that are served to the machine "Host4". There are two rollbacks served to Host4.
VirtualDiskGroupId | : | |
FirstHostId | : | A6EA4E77-BBFF-4F48-91CD-3987E81C1CB3 |
SecondHostId | : | |
BackupHostId | : | |
StorageProfileId | : | 100469DF-0BE1-40DA-874E-9F1DA5A259E3 |
Alias | : | Virtual disk 1 @ 8/11/2011 5:07:01 PM |
Description | : | |
Size | : | 50.00 GiB |
Type | : | NonMirrored |
DiskStatus | : | Online |
InquiryData | : | DataCore Virtual Disk DCS |
ScsiDeviceId | : | {96, 3, 13, 144...} |
RemovableMedia | : | False |
WriteThrough | : | False |
Offline | : | False |
DiskLayout | : | DataCore.Executive.PhysicalDiskLayout |
PersistentReserveEnabled | : | True |
RecoveryPriority | : | Regular |
IsServed | : | True |
Id | : | 485f20b6b4ad47abab73cadbc84d3564 |
Caption | : | Virtual disk 1 @ 8/11/2011 5:07:01 PM |
ExtendedCaption | : | Virtual disk 1 @ 8/11/2011 5:07:01 PM from Local |
Internal | : | False |
VirtualDiskGroupId | : | |
FirstHostId | : | A6EA4E77-BBFF-4F48-91CD-3987E81C1CB3 |
SecondHostId | : | |
BackupHostId | : | |
StorageProfileId | : | 100469DF-0BE1-40DA-874E-9F1DA5A259E3 |
Alias | : | Virtual disk 1 @ 8/11/2011 6:04:17 PM |
Description | : | |
Size | : | 50.00 GiB |
Type | : | NonMirrored |
DiskStatus | : | Online |
InquiryData | : | DataCore Virtual Disk DCS |
ScsiDeviceId | : | {96, 3, 13, 144...} |
RemovableMedia | : | False |
WriteThrough | : | False |
Offline | : | False |
DiskLayout | : | DataCore.Executive.PhysicalDiskLayout |
PersistentReserveEnabled | : | True |
RecoveryPriority | : | Regular |
IsServed | : | True |
Id | : | 314b37787a1847f799315cab4d10e092 |
Caption | : | Virtual disk 1 @ 8/11/2011 6:04:17 PM |
ExtendedCaption | : | Virtual disk 1 @ 8/11/2011 6:04:17 PM from Local |
Internal | : | False |
$resultsLocation = "C:\" $allocationResult = @() foreach($vd in (Get-DcsVirtualDisk)) { $result = New-Object PSObject $result | Add-Member -MemberType NoteProperty -Name "Virtual Disk" -Value ($vd.Alias) $result | Add-Member -MemberType NoteProperty -Name "Allocation" -Value (($vd[0] | Get-DcsPerformanceCounter).BytesAllocated) $result | Add-Member -MemberType NoteProperty -Name "Size" -Value "Bytes" $allocationResult += $result } $allocationResult > $resultsLocation\allocation-results.txtThis is a script file which retrieves the number of allocated bytes for each virtual disk in the server group. A high level explanation follows. The number of allocated bytes is part of the performance data for the virtual disk. The cmdlet Get-DcsVirtualDisk is invoked to retrieve the virtual disk objects. The objects are passed to the cmdlet Get-DcsPerformanceCounter in order to get the count for BytesAllocated in the PerformanceData object. A custom object is created with the data returned from the cmdlets. The virtual disk name and allocation size are output to the file allocation-results.txt in the specified folder location.
Virtual Disk Allocation Size ------------ ---------- ---- Virtual disk 1 53284438016 Bytes Virtual disk 2 30601641984 Bytes Virtual disk 3 24293408768 Bytes Virtual disk 4 24024973312 Bytes
Connect-DcsServer -server SSV1 -UserName SANadministrator -Password SANpassword99 -Connection SSV1Connect sleep -seconds 1 $resultsLocation = "C:\" $allocationResult = @() foreach($logicalDisk in (Get-DcsLogicalDisk -Server "SSV1")) { $result = New-Object PSObject $result | Add-Member -MemberType NoteProperty -Name "Virtual Disk" -Value ((Get-DcsVirtualDisk -VirtualDisk $logicalDisk.VirtualDiskId).Alias) $result | Add-Member -MemberType NoteProperty -Name "Allocation" -Value (($logicalDisk | Get-DcsPerformanceCounter).BytesAllocated) $result | Add-Member -MemberType NoteProperty -Name "Size" -Value "Bytes" $result | Add-Member -MemberType NoteProperty -Name "Pool Name" -Value ((Get-DcsPool -Pool $logicalDisk.PoolId).Caption) $allocationResult += $result } $allocationResult > $resultsLocation\allocation-results.txt
This is a script file which retrieves the number of allocated bytes for each virtual disk for a specified server. A high level explanation follows. The number of allocated bytes is part of the performance data for the logical disk. The cmdlet Get-DcsLogicalDisk is invoked to retrieve the logical disk objects for the server named "SSV1". The objects are passed to the cmdlet Get-DcsPerformanceCounter in order to get the count for BytesAllocated in the PerformanceData object. The pool name is retrieved from the cmdlet Get-DcsPool. The virtual disk name, allocation size and pool name are copied to the file allocation-results.txt in the specified results location.
Virtual Disk Allocation Size Pool Name ------------ ---------- ---- --------- Virtual disk 1 53284438016 Bytes Disk pool 1 Virtual disk 2 30601641984 Bytes Disk pool 1 Virtual disk 4 24024973312 Bytes Disk pool 4 Virtual disk 3 24293408768 Bytes Disk pool 4
Get-DcsVirtualDisk -Machine (Get-DcsClient)
The cmdlet is invoked to return all virtual disks that are served to all client hosts in the local server group. The cmdlet Get-DcsClient is used to obtain all ClientHostData objects for all client hosts. In this
VirtualDiskGroupId | : | |
FirstHostId | : | 842E17B3-B000-4553-B711-7BE46FA260FF |
SecondHostId | : | |
BackupHostId | : | |
StorageProfileId | : | 100469DF-0BE1-40DA-874E-9F1DA5A259E3 |
SnapshotPoolId | : | |
Alias | : | Virtual disk 1 @ 2/5/2014 3:12:19 PM |
Description | : | |
Size | : | 20.00 GiB |
Type | : | NonMirrored |
DiskStatus | : | Online |
InquiryData | : | DataCore Virtual Disk DCS 3bfdb6f009814301a19ae92a1a84acb9 |
ScsiDeviceId | : | {96, 3, 13, 144...} |
ScsiDeviceIdString | : | 60030D90C87DDC011B810E83BABAD321 |
RemovableMedia | : | False |
WriteThrough | : | False |
Offline | : | False |
Disabled | : | False |
ManualRecovery | : | False |
DiskLayout | : | DataCore.Executive.PhysicalDiskLayout |
PersistentReserveEnabled | : | True |
RecoveryPriority | : | Regular |
IsServed | : | True |
Sequencenumber | : | 6337 |
Id | : | 3bfdb6f009814301a19ae92a1a84acb9 |
Caption | : | Virtual disk 1 @ 2/5/2014 3:12:19 PM |
ExtendedCaption | : | Virtual disk 1 @ 2/5/2014 3:12:19 PM from Local |
Internal | : | False |
VirtualDiskGroupId | : | |
FirstHostId | : | 842E17B3-B000-4553-B711-7BE46FA260FF |
SecondHostId | : | FF212987-2B4F-40DD-A490-A0CA13E58FDF |
BackupHostId | : | |
StorageProfileId | : | 100469DF-0BE1-40DA-874E-9F1DA5A259E3 |
SnapshotPoolId | : | |
Alias | : | Virtual disk 2 |
Description | : | |
Size | : | 20.00 GiB |
Type | : | MultiPathMirrored |
DiskStatus | : | Online |
InquiryData | : | DataCore Virtual Disk DCS 088fc1e87f3140178acd91e3434c084d |
ScsiDeviceId | : | {96, 3, 13, 144...} |
ScsiDeviceIdString | : | 60030D90739C660159D02020C214008A |
RemovableMedia | : | False |
WriteThrough | : | False |
Offline | : | False |
Disabled | : | False |
ManualRecovery | : | False |
DiskLayout | : | DataCore.Executive.PhysicalDiskLayout |
PersistentReserveEnabled | : | True |
RecoveryPriority | : | Regular |
IsServed | : | True |
Sequencenumber | : | 6600 |
Id | : | 088fc1e87f3140178acd91e3434c084d |
Caption | : | Virtual disk 2 |
ExtendedCaption | : | Virtual disk 2 from Local |
Internal | : | False |
Get-DcsVirtualDisk | where{$_.StorageProfileId -eq 'E84B65FF-B69A-4EF1-B79E-71D3DC29E867'}
The cmdlet is invoked to obtain all virtual disk data objects where the StorageProfileId field is equal to "E84B65FF-B69A-4EF1-B79E-71D3DC29E867" which is the ID for the critical storage profile. Information about storage profiles can be obtained from the cmdlet Get-DcsStorageProfile.
VirtualDiskGroupId | : | |
FirstHostId | : | 18C3C2A0-8AAD-4899-8C00-7F73375E1E41 |
SecondHostId | : | 0067448A-1FE5-4646-A934-3ECDFEAC1CED |
BackupHostId | : | |
StorageProfileId | : | E84B65FF-B69A-4EF1-B79E-71D3DC29E867 |
SnapshotPoolId | : | |
Alias | : | Virtual disk 3 |
Description | : | |
Size | : | 50 GiB |
Type | : | MultiPathMirrored |
DiskStatus | : | Online |
InquiryData | : | DataCore Virtual Disk DCS 39f8cefccbd64e3da365dad4e89add85 |
ScsiDeviceId | : | {96, 3, 13, 144...} |
ScsiDeviceIdString | : | 60030D90BAEC370737C82297BDEA027C |
RemovableMedia | : | False |
WriteThrough | : | False |
Offline | : | False |
Disabled | : | False |
ManualRecovery | : | False |
DiskLayout | : | DataCore.Executive.PhysicalDiskLayout |
PersistentReserveEnabled | : | True |
RecoveryPriority | : | Critical |
IsServed | : | False |
Sequencenumber | : | 40494 |
Id | : | 39f8cefccbd64e3da365dad4e89add85 |
Caption | : | Virtual disk 3 |
ExtendedCaption | : | Virtual disk 3 from Group1 |
Internal | : | False |
VirtualDiskGroupId | : | |
FirstHostId | : | 18C3C2A0-8AAD-4899-8C00-7F73375E1E41 |
SecondHostId | : | 0067448A-1FE5-4646-A934-3ECDFEAC1CED |
BackupHostId | : | |
StorageProfileId | : | E84B65FF-B69A-4EF1-B79E-71D3DC29E867 |
SnapshotPoolId | : | |
Alias | : | Virtual disk 4 |
Description | : | |
Size | : | 50 GiB |
Type | : | MultiPathMirrored |
DiskStatus | : | FailedRedundancy |
InquiryData | : | DataCore Virtual Disk DCS ff175cbeece04104aa21bfe8c5fde546 |
ScsiDeviceId | : | {96, 3, 13, 144...} |
ScsiDeviceIdString | : | 60030D9073643B07AC3255C9C30ACF6D |
RemovableMedia | : | False |
WriteThrough | : | False |
Offline | : | False |
Disabled | : | False |
ManualRecovery | : | False |
DiskLayout | : | DataCore.Executive.PhysicalDiskLayout |
PersistentReserveEnabled | : | True |
RecoveryPriority | : | Critical |
IsServed | : | False |
Sequencenumber | : | 40580 |
Id | : | ff175cbeece04104aa21bfe8c5fde546 |
Caption | : | Virtual disk 4 |
ExtendedCaption | : | Virtual disk 4 from Group1 |
Internal | : | False |
$VD = Get-DcsVirtualDisk $VD | ForEach-Object {Write-Host $_.alias - Witness Id = $_.WitnessId and Witness Option = $_.WitnessOption}
The cmdlet Get-DcsVirtualDisk is invoked without parameters to return VirtualDiskData for all virtual disks in the server group and store results in the variable $VD.
Results of the variable $VD are piped to ForEach-Object and the virtual disk name, WitnessId, and WitnessOption are output. Virtual disks set to use a witness will have a WitnessId and WitnessOption; otherwise, the WitnessOption will be "Default" (NoWitness) or "IoFenced".
Virtual disk 3 - Witness Id = and Witness Option = Default Virtual disk 2 - Witness Id = and Witness Option = IoFenced Virtual disk 1 - Witness Id = d629f3dc7b284325b539ee595e8d29f1 and Witness Option = Manual