Quantcast
Viewing all articles
Browse latest Browse all 4945

How to get Volume Type using Powershell Toolkit

From the OnTap CLI, I can run this command to find out my volume type (it will be either RW or DP (for data protection)):

vol show -vserver VserverName -volume VolumeName -fields vserver,volume,state,type

 

vserver  volume   state  type

-------- -------- ------ ----

VserverName VolumeName online RW

 

 

I’d think that the Get-NcVol command should be able to retrieve that data, but that doesn’t seem to be the case:

 

PS E:\Powershell> Get-NcVol -Name $Mnemonic* -VServer VserverName | Select NcController,Vserver,Name,State,Type

 

 

NcController : ControllerName

Vserver      : VserverName

Name         : VolumeName

State        : online

Type         :  

 

 

The Type just comes back blank.  I think because it’s not actually an available Property of the volume.

 

PS E:\Powershell> Get-NcVol | Get-Member -MemberType Properties

 

 

   TypeName: DataONTAP.C.Types.Volume.VolumeAttributes

 

Name                               MemberType     Definition                                                                                                                         

----                               ----------     ----------                                                                                                                          

Name                               Property       string Name {get;set;}                                                                                                             

NcController                       Property       NetApp.Ontapi.Filer.C.NcController NcController {get;set;}                                                                         

Volume64bitUpgradeAttributes       Property       DataONTAP.C.Types.Volume.Volume64bitUpgradeAttributes Volume64bitUpgradeAttributes {get;set;}                                      

VolumeAntivirusAttributes          Property       DataONTAP.C.Types.Volume.VolumeAntivirusAttributes VolumeAntivirusAttributes {get;set;}                                             

VolumeAutobalanceAttributes        Property       DataONTAP.C.Types.Volume.VolumeAutobalanceAttributes VolumeAutobalanceAttributes {get;set;}                                        

VolumeAutosizeAttributes           Property       DataONTAP.C.Types.Volume.VolumeAutosizeAttributes VolumeAutosizeAttributes {get;set;}                                              

VolumeCloneAttributes              Property       DataONTAP.C.Types.Volume.VolumeCloneAttributes VolumeCloneAttributes {get;set;}                                                    

VolumeDirectoryAttributes          Property       DataONTAP.C.Types.Volume.VolumeDirectoryAttributes VolumeDirectoryAttributes {get;set;}                                            

VolumeExportAttributes             Property       DataONTAP.C.Types.Volume.VolumeExportAttributes VolumeExportAttributes {get;set;}                                                  

VolumeFlexcacheAttributes          Property       DataONTAP.C.Types.Volume.VolumeFlexcacheAttributes VolumeFlexcacheAttributes {get;set;}                                            

VolumeHybridCacheAttributes        Property       DataONTAP.C.Types.Volume.VolumeHybridCacheAttributes VolumeHybridCacheAttributes {get;set;}                                         

VolumeIdAttributes                 Property       DataONTAP.C.Types.Volume.VolumeIdAttributes VolumeIdAttributes {get;set;}                                                          

VolumeInfinitevolAttributes        Property       DataONTAP.C.Types.Volume.VolumeInfinitevolAttributes VolumeInfinitevolAttributes {get;set;}                                        

VolumeInodeAttributes              Property       DataONTAP.C.Types.Volume.VolumeInodeAttributes VolumeInodeAttributes {get;set;}                                                    

VolumeLanguageAttributes           Property       DataONTAP.C.Types.Volume.VolumeLanguageAttributes VolumeLanguageAttributes {get;set;}                                               

VolumeMirrorAttributes             Property       DataONTAP.C.Types.Volume.VolumeMirrorAttributes VolumeMirrorAttributes {get;set;}                                                  

VolumePerformanceAttributes        Property       DataONTAP.C.Types.Volume.VolumePerformanceAttributes VolumePerformanceAttributes {get;set;}                                        

VolumeQosAttributes                Property       DataONTAP.C.Types.Volume.VolumeQosAttributes VolumeQosAttributes {get;set;}                                                        

VolumeSecurityAttributes           Property       DataONTAP.C.Types.Volume.VolumeSecurityAttributes VolumeSecurityAttributes {get;set;}                                              

VolumeSisAttributes                Property       DataONTAP.C.Types.Volume.VolumeSisAttributes VolumeSisAttributes {get;set;}                                                        

VolumeSnapshotAttributes           Property       DataONTAP.C.Types.Volume.VolumeSnapshotAttributes VolumeSnapshotAttributes {get;set;}                                              

VolumeSnapshotAutodeleteAttributes Property       DataONTAP.C.Types.Volume.VolumeSnapshotAutodeleteAttributes VolumeSnapshotAutodeleteAttributes {get;set;}                          

VolumeSpaceAttributes              Property       DataONTAP.C.Types.Volume.VolumeSpaceAttributes VolumeSpaceAttributes {get;set;}                                                    

VolumeStateAttributes              Property       DataONTAP.C.Types.Volume.VolumeStateAttributes VolumeStateAttributes {get;set;}                                                    

VolumeStripingAttributes           Property       DataONTAP.C.Types.Volume.VolumeStripingAttributes VolumeStripingAttributes {get;set;}                                              

VolumeTransitionAttributes         Property       DataONTAP.C.Types.Volume.VolumeTransitionAttributes VolumeTransitionAttributes {get;set;}                                           

VolumeVmAlignAttributes            Property       DataONTAP.C.Types.Volume.VolumeVmAlignAttributes VolumeVmAlignAttributes {get;set;}                                                

Vserver                            Property       string Vserver {get;set;}                                                                                                          

Aggregate                          ScriptProperty System.Object Aggregate {get=try { $this.VolumeIdAttributes.ContainingAggregateName } catch [Exception] { $null };set=if($this.Vo...

Available                          ScriptProperty System.Object Available {get=try { $this.VolumeSpaceAttributes.SizeAvailable} catch [Exception] { $null };set=if($this.VolumeSpac...

Dedupe                             ScriptProperty System.Object Dedupe {get=try { $this.VolumeSisAttributes.IsSisVolume } catch [Exception] { $null };set=if($this.VolumeSisAttribu...

FilesTotal                         ScriptProperty System.Object FilesTotal {get=try { $this.VolumeInodeAttributes.FilesTotal } catch [Exception] { $null };set=if($this.VolumeInode...

FilesUsed                          ScriptProperty System.Object FilesUsed {get=try { $this.VolumeInodeAttributes.FilesUsed } catch [Exception] { $null };set=if($this.VolumeInodeAt...

IsInfiniteVolume                   ScriptProperty System.Object IsInfiniteVolume {get=try { if( $this.VolumeIdAttributes.Style -eq 'infinitevol' ) { $true } else { $false } } catc...

JunctionPath                       ScriptProperty System.Object JunctionPath {get=try { $this.VolumeIdAttributes.JunctionPath } catch [Exception] { $null };set=if($this.VolumeIdAt...

State                              ScriptProperty System.Object State {get=try { $this.VolumeStateAttributes.State } catch [Exception] { $null };set=if($this.VolumeStateAttributes...

TotalSize                          ScriptProperty System.Object TotalSize {get=try { $this.VolumeSpaceAttributes.Size } catch [Exception] { $null };set=if($this.VolumeSpaceAttribu...

Used                               ScriptProperty System.Object Used {get=try { $this.VolumeSpaceAttributes.PercentageSizeUsed } catch [Exception] { $null };set=if($this.VolumeSpa...

 

 

 

Does anyone know any other tricks to pull that info back through Powershell?
Other than using the Invoke-NcSsh command that is… the return data from that is such a pain to deal with.


Viewing all articles
Browse latest Browse all 4945

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>