NAME

Get-DcsChunkAllocation

SYNOPSIS

Returns storage allocation unit (SAU) data for each physical disk in a disk pool. Data returned can be used to determine allocation distribution for disks in a pool.

SYNTAX

Get-DcsChunkAllocation   [ -Server <String> ]   -Pool <Object>   [ -Connection <String> ]   [ -PipelineVariable <String> ]

DESCRIPTION

Returns storage allocation unit (SAU) data for each physical disk in a disk pool. Data returned can be used to determine allocation distribution for disks in a pool. The returned object can be saved to a variable and used to get the total bit (SAU) count and view the actual bitmap data for each byte of each disk. This cmdlet can be used to determine if SAUs are allocated on a pool disk.

PARAMETERS

-Server<String>
Computer name or ID of the server. The computer name must be unique or the name must be fully qualified.

Required: false
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-Pool<Object>
DiskPoolData object, name, or ID that identifies the disk pool. To resolve by name, the name must be unique to the server group or the server must be specified.

Required: true
Position: named
Default value:
Accept pipeline input: true (ByValue)
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

DiskPoolData : Object that identifies and describes the pool.

OUTPUTS

DiskAllocationInfoData : Object that associates the location for each SAU within the respective physical disks in a pool.

NOTES

The amount of bytes allocated and other performance data for pools can be retrieved by the cmdlet Get-DcsPerformanceCounter. Also see Get-DcsPool, Get-DcsChunkAllocationMap, Get-DcsChunkReclamationMap.

EXAMPLES


-------------- Example 1 Returns data for a specified pool, finds the properties in the returned object, and displays the number of bits and bitmap for each disk in the pool --------------
$ChunksAlloc = Get-DcsChunkAllocation -Server SSV1 -Pool "Disk pool 1"
$ChunksAlloc
PoolMemberId                                                          ChunkMap
------------                                                          --------
c358e4a6-26e0-4f07-aa9e-e780fff049bb                                  DataCore.Executive.BitArrayEx
4407d9de-8022-40d3-be64-5db8eaf44260                                  DataCore.Executive.BitArrayEx
$ChunksAlloc[0].ChunkMap | get-Member

TypeName: DataCore.Executive.BitArrayEx
Name        MemberType            Definition
----        ----------            ----------
Equals      Method                bool Equals(System.Object other)
GetHashCode Method                int GetHashCode()
GetType     Method                type GetType()
Or          Method                System.Void Or(DataCore.Executive.BitArrayEx otherBitArrayEx)
ToString    Method                string ToString()
Item        ParameterizedProperty bool Item(int index) {get;set;}
BitMap      Property              System.Byte[] BitMap {get;set;}
Count       Property              System.Int32 Count {get;set;}
$ChunksAlloc[0].ChunkMap
BitMap                                                               Count
------                                                               -----
{254, 255, 255, 255...}                                              397
ForEach ($c in $ChunksAlloc)
{
Write-Host  (Get-DcsPhysicalDisk -PoolMember $c.PoolMemberid).ExtendedCaption
Write-Host
Write-Host "number of Bits in BitMap =" $c.ChunkMap.Count
Write-Host "BitMap:"
Write-Host $c.ChunkMap.BitMap
Write-Host
}
			

The chunk allocation data (SAUs) for each disk in the pool named "Disk Pool 1" on the server named "SSV1" is returned and stored in the variable $ChunksAlloc. The contents of the variable are output. There are two physical disks in the pool. The Pool Member ID and Chunk Map are returned for both pool disks. The PowerShell cmdlet Get-Member can be used to find the properties for the ChunkMap object, which are Count and Bitmap. The ChunkMap object for the first record in the variable is displayed. A script shows one way to ouput the Count and entire BitMap for each disk. The cmdlet Get-DcsPhysicalDisk uses the PoolMemberId to find the disk name. The variable $ChunksAlloc is used to output the bit count and actual bitmap from the ChunkMap object for each disk in the pool. The bitmap is displayed in a series of bytes in decimal that represent a bitmap of the SAU allocation for a disk. The disk size divided by the SAU size is equal to the number of SAUs or bits.

Disk 5 on SSV1
number of Bits in BitMap = 397
BitMap:
254 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 127 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Disk 6 on SSV1
number of Bits in BitMap = 397
BitMap:
250 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 127 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
		

-------------- Example 2 Returns bitmap and count data for all pools in a server group --------------
$Servers = Get-DcsServer
ForEach ($s in $Servers)
{
$Pools = Get-DcsPool -Server $s
ForEach ($p in $Pools)
{
Write-Host "Pool Name =" $p.ExtendedCaption -foregroundcolor Yellow
Write-Host
$ChunksAllocs = Get-DcsChunkAllocation -Server $s -Pool $p
ForEach ($c in $ChunksAllocs)
{
Write-Host  (Get-DcsPhysicalDisk -PoolMember $c.PoolMemberid).ExtendedCaption
Write-Host "number of Bits in BitMap =" $c.ChunkMap.Count
Write-Host "BitMap:"
Write-Host $c.ChunkMap.BitMap
Write-Host
}
}
}
			

This simple script file builds on the basics shown in Example 1 and shows one way to get bitmap and count data for all pools in a server group. The cmdlet Get-DcsServer is invoked to get the ServerHostData objects for all servers in the server group of the default connection; the objects are stored in the variable $Servers. The cmdlet Get-DcsPool is invoked to get DiskPoolData objects for all pools for all servers; those objects are stored in the variable $Pools. For each pool, the name is output to the screen in yellow. The cmdlet Get-DcsChunkAllocation is invoked for each pool on each server. The cmdlet Get-DcsPhysicalDisk is used with the PoolMemberId to output the disk name. The variable $ChunkAllocs is used to output the Count and the actual Bitmap in the ChunkMap object. In this case there are three servers in the server group: SSV1, SSV2 and SSV3. Each server has a pool (Disk pool 1 on SSV1, Disk pool 2 on SSV2, and Disk pool 3 on SSV3)and all servers share a pool (Shared pool 1). Each pool has two disks.

Pool Name = Disk pool 1 on SSV1
Disk 5 on SSV1
number of Bits in BitMap = 397
BitMap:
254 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Disk 6 on SSV1
number of Bits in BitMap = 397
BitMap:
254 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Pool Name = Shared pool 1 on SSV1
Shared Disk 2 on SSV1
number of Bits in BitMap = 317
BitMap:
254 255 255 255 255 255 255 255 87 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Shared Disk 1 on SSV1
number of Bits in BitMap = 477
BitMap:
254 255 255 255 255 255 255 255 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Pool Name = Disk pool 2 on SSV2
Disk 11 on SSV2
number of Bits in BitMap = 397
BitMap:
254 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 127 223 255 255 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Disk 9 on SSV2
number of Bits in BitMap = 397
BitMap:
254 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 223 251 255 255 191 255 255 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Pool Name = Shared pool 1 on SSV2
Shared Disk 2 on SSV1
number of Bits in BitMap = 317
BitMap:
254 255 255 255 255 255 255 255 87 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Shared Disk 1 on SSV1
number of Bits in BitMap = 477
BitMap:
254 255 255 255 255 255 255 255 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Pool Name = Disk pool 3 on SSV3
Disk 4 on SSV3
number of Bits in BitMap = 397
BitMap:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Disk 3 on SSV3
number of Bits in BitMap = 397
BitMap:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Pool Name = Shared pool 1 on SSV3
Shared Disk 2 on SSV1
number of Bits in BitMap = 317
BitMap:
254 255 255 255 255 255 255 255 87 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Shared Disk 1 on SSV1
number of Bits in BitMap = 477
BitMap:
254 255 255 255 255 255 255 255 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0