Skip to content

Commit

Permalink
updated and finalized storage and internalvolume export examples in t…
Browse files Browse the repository at this point in the history
…utotorial
  • Loading branch information
ffeldhaus committed Nov 4, 2015
1 parent c70f18f commit 65b9a8f
Showing 1 changed file with 73 additions and 52 deletions.
125 changes: 73 additions & 52 deletions OnCommand-Insight-Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,65 +246,86 @@ To format the Storage Arrays the following commands can be used
```powershell
$FileName = "$HOME\Documents\OCIDetails.xlsx"
$Storages = foreach ($Storage in Get-OciStorages) {
$Ports = $Storage | Get-OciPortsByStorage
[PSCustomObject]@{ Name=$Storage.name;
IP=$Storage.ip;
"Capacity (GB)"=[Math]::Round($Storage.capacity.total.value/1024);
Vendor=$Storage.vendor;
Family=$Storage.family;Model=$Storage.model;
"Serial Number"=$Storage.serialNumber;
"Microcode Version"=$Storage.microcodeVersion;
"FC Port Count"=$Ports.count}
$StorageData = [ordered]@{
'Name'=$Storage.name;
'IP'=$Storage.ip;
'Capacity (GB)'='not available via API';
'Raw Capacity (GB)'=$Storage.capacity.total.value/1024;
'Protocols'='not available via API';
'Array Virtualization Type'='not available via API';
'Vendor'=$Storage.vendor;
'Family'=$Storage.family;
'Model'=$Storage.model;
'Serial Number'=$Storage.serialNumber;
'Microcode Version'=$Storage.microcodeVersion;
'FC Port Count'='not available via API';
'Last Report Time'='not available via API';
'Is the device offline?'='not available via API';
'Tenant'='not available via API';
'Line of Business'='not available via API';
'Business Unit'='not available via API';
'Project'='not available via API';
}
foreach ($Annotation in ($Storage | Get-OciAnnotationsByStorage)) {
$StorageData[$Annotation.label] = $Annotation.displayValue
}
[PSCustomObject]$StorageData
}
$Storages | Export-Excel -FileName $FileName -WorksheetName 'Storages'
$Storages | Sort-Object -Property @{Expression={$_.psobject.properties | Measure-Object | Select-Object -ExpandProperty Count};Descending=$true} | Export-Excel -FileName $FileName -WorksheetName 'Storages'
```

To format the Internal Volumes, the following commands can be used
```powershell
$FileName = "$HOME\Documents\OCIDetails.xlsx"
$InternalVolumes = foreach ($Storage in Get-OciStorages) {
foreach ($InternalVolume in ($Storage | Get-OciInternalVolumesByStorage -storage -performance -storagePool -volumes -storageNodes -Datastores')) {
[PSCustomObject]@{ Name=$InternalVolume.name;
Storage=$InternalVolume.storage.name;
'SVM/vFiler'=$InternalVolume.virtualStorage;
Nodes=$InternalVolume.storageNodes.name -join ',';
'HA Partner'='not available via API';
'Capacity (GB)'=$InternalVolume.capacity.total.value;
'RAW Capacity (GB)'=$InternalVolume.capacity.rawToUsableRatio*$InternalVolume.capacity.total.value;
'Used Capacity (GB)'=$InternalVolume.capacity.used.value;
'Used Capacity (%)'=[Math]::Round($InternalVolume.capacity.used.value/$InternalVolume.capacity.total.value*100);
'Consumed Capacity (GB)'=$(if ($InternalVolume.capacity.isThinProvisioned) { $InternalVolume.capacity.total.value } else { $InternalVolume.capacity.used.value});
'Storage Pool'=$InternalVolume.storagePool.name;
Type=$InternalVolume.type;
'Flash Pool'=$InternalVolume.storagePool.usesFlashPool;
'Thin Provisioned'=$InternalVolume.capacity.isThinProvisioned;
'Volume Count'=$InternalVolume.volumes.count;
'Share Count'='not available via API';
Datastore=$InternalVolume.dataStores.name -join ',';
'Storage Guarantee'=$InternalVolume.spaceGuarantee;
'Deduplication Savings'=$InternalVolume.dedupeSavings.value;
'Clone Source'='not available via API';
'Clone Shared Capacity (GB)'='not available via API';
'Replication Technology'='not available via API';
'Replication Mode'='not available via API';
'Replica Source Storage'='not available via API';
'Replica Source Internal Volume'=$InternalVolume.name;
'Status'=$InternalVolume.status;
'Snapshot Reserve (GB)'='not available via API';
'Snapshot Used (%)'='not available via API';
'Snapshot Overflow (GB)='not available via API';
'Snapstots Count'='not available via API';
'Last Snapshot'='not available via API';
'Disk Type'='not available via API';
'Disk Size'='not available via API';
'Disk Speed (RPM)'='not available via API';
'Application'=$InternalVolume.applications.name -join ',';
'Application Priority'=$InternalVolume.applications.priority -join ',';
'Tenant'=$InternalVolume.applications.businessEntity.tenant -join ',';
'Line of Business'=$InternalVolume.applications.businessEntity.lob -join ',';
'Business Unit'=$InternalVolume.applications.businessEntity.businessUnit -join ',';
'Project'=$InternalVolume.applications.businessEntity.project -join ',';}
foreach ($InternalVolume in ($Storage | Get-OciInternalVolumesByStorage -storage -storagePool -volumes -storageNodes -Datastores -applications -annotations -replicaSources)) {
$InternalVolumeData = [ordered]@{
Name=$InternalVolume.name;
Storage=$InternalVolume.storage.name;
'SVM/vFiler'=$InternalVolume.virtualStorage;
Nodes=$InternalVolume.storageNodes.name -join ',';
'HA Partner'='not available via API';
'Capacity (GB)'=$InternalVolume.capacity.total.value/1024;
'RAW Capacity (GB)'=$InternalVolume.capacity.rawToUsableRatio*$InternalVolume.capacity.total.value/1024;
'Used Capacity (GB)'=$InternalVolume.capacity.used.value/1024;
'Used Capacity (%)'=[Math]::Round($InternalVolume.capacity.used.value/$InternalVolume.capacity.total.value*100);
'Consumed Capacity (GB)'=$(if ($InternalVolume.capacity.isThinProvisioned) { $InternalVolume.capacity.total.value/1024 } else { $InternalVolume.capacity.used.value/1024 });
'Storage Pool'=$InternalVolume.storagePool.name;
Type=$InternalVolume.type;
'Flash Pool Eligibility'=$InternalVolume.flashPoolEligibility;
'Thin Provisioned'=$InternalVolume.capacity.isThinProvisioned;
'Volume Count'=$InternalVolume.volumes.count;
'Share Count'='not available via API';
Datastore=$InternalVolume.dataStores.name -join ',';
'Storage Guarantee'=$InternalVolume.spaceGuarantee;
'Deduplication Savings'=$InternalVolume.dedupeSavings.value;
'Clone Source'='not available via API';
'Clone Shared Capacity (GB)'='not available via API';
'Replication Technology'='not available via API';
'Replication Mode'='not available via API';
'Replica Source Storage'='not available via API';
'Replica Source Internal Volume'=$InternalVolume.replicaSources.name -join ',';
'Status'=$InternalVolume.status;
'Snapshot Reserve (GB)'='not available via API';
'Snapshot Used (%)'='not available via API';
'Snapshot Overflow (GB)'='not available via API';
'Snapstots Count'='not available via API';
'Last Snapshot'='not available via API';
'Disk Types'='not available via API';
'Disk Size'='not available via API';
'Disk Speed (RPM)'='not available via API';
'Application'=$InternalVolume.applications.name -join ',';
'Application Priority'=$InternalVolume.applications.priority -join ',';
'Tenant'=$InternalVolume.applications.businessEntity.tenant -join ',';
'Line of Business'=$InternalVolume.applications.businessEntity.lob -join ',';
'Business Unit'=$InternalVolume.applications.businessEntity.businessUnit -join ',';
'Project'=$InternalVolume.applications.businessEntity.project -join ',';
}
foreach ($Annotation in ($InternalVolume.annotations)) {
$InternalVolumeData[$Annotation.label] = $Annotation.displayValue
}
[PSCustomObject]$InternalVolumeData
}
}
$Storages | Export-Excel -FileName $FileName -WorksheetName 'Internal Volumes'
$InternalVolumes | Sort-Object -Property @{Expression={$_.psobject.properties | Measure-Object | Select-Object -ExpandProperty Count};Descending=$true} | Export-Excel -FileName $FileName -WorksheetName 'Internal Volumes'
```

0 comments on commit 65b9a8f

Please sign in to comment.