ONTAP Discussions

Get-NcDisk in Toolkit and 'disk show' in cli showing different outputs

Vadiraj12
1,179 Views

Get-NcDisk in Toolkit and 'disk show' in cli showing different total capacity outputs.

 

Is there any way I can get the "disk show" same output in the powershell too?

Powershell, its 4TB and CLI, its 3.49TB

 

Name Shelf Bay Position Capacity RPM FW Model Paths Aggregate
---- ----- --- -------- -------- --- -- ----- ----- ----
1.0.0 0 0 shared 4 TB NA51 X4011WBORA3T8NTF 2
1.0.1 0 1 shared 4 TB NA51 X4011WBORA3T8NTF 2
1.0.18 0 18 shared 4 TB NA53 X4011S17333T8NTE 2

 

Usable Disk Container Container
Disk Size Shelf Bay Type Type Name Owner
---------------- ---------- ----- --- ------- ----------- --------- --------

Info: This cluster has partitioned disks. To get a complete list of spare disk capacity use "storage aggregate show-spare-disks".
1.0.0 3.49TB 0 0 SSD-NVM shared <removed>*
1.0.1 3.49TB 0 1 SSD-NVM shared <removed>*
1.0.2 3.49TB 0 2 SSD-NVM shared <removed>*

 

*removed the aggregate details

1 ACCEPTED SOLUTION

murdock01
1,075 Views

You could build a wrapper function that called get-ncdisks, manipulates the data, and spits out the info in the way you want - I have tons of these.
Also, if you run get-ncdisk | select -first 1 | select * in PS, you will see all the data that is returned. The Ontap module  has a "filter" to show the data that you get when you just run get-ncdisk, basically formats it so it looks nice.
In the command above, for my 1.09 TB disk (this is the number from the ontap console using  disk show) I get
Capacity : 1218997503360
Now to convert that number to something nicer you have to do some math.
The Ontap powershell module has a function called convertto-formattednumber. If I use that I get
> convertto-formattednumber 1218997503360
1T

If I use the powershell way I get this
> 1218997503360 / 1tb
1.10867177078035
Which is a little more accurate. Then you can format the result to get to 1.10TB.  I never got to the point of getting 1.09. I assume its what ever math is getting used to display the number on the console. Or that the 1.09TB is a value coming from the drive itself. 
Hope that helps.

View solution in original post

2 REPLIES 2

murdock01
1,076 Views

You could build a wrapper function that called get-ncdisks, manipulates the data, and spits out the info in the way you want - I have tons of these.
Also, if you run get-ncdisk | select -first 1 | select * in PS, you will see all the data that is returned. The Ontap module  has a "filter" to show the data that you get when you just run get-ncdisk, basically formats it so it looks nice.
In the command above, for my 1.09 TB disk (this is the number from the ontap console using  disk show) I get
Capacity : 1218997503360
Now to convert that number to something nicer you have to do some math.
The Ontap powershell module has a function called convertto-formattednumber. If I use that I get
> convertto-formattednumber 1218997503360
1T

If I use the powershell way I get this
> 1218997503360 / 1tb
1.10867177078035
Which is a little more accurate. Then you can format the result to get to 1.10TB.  I never got to the point of getting 1.09. I assume its what ever math is getting used to display the number on the console. Or that the 1.09TB is a value coming from the drive itself. 
Hope that helps.

Vadiraj12
1,026 Views

I have tried this too. For smaller disks, its alright, I can ignore the small amount of difference.

 

But when you are running the same command for disks more than 3.5TB, the difference is huge.

I can understand there will be some space allocated to system reserved things, but 400GB difference is not what I expected.

 

So I was asking if there is any command which can give me usable disk space similar to cli's "disk show"

Public