ONTAP Discussions

[cDOT] How to list lun size in Bytes

marcinlub
7,559 Views

Hi everyone, 

In a AIX cluster migration from HDS to 8.2 cDOT systems I have provisioned luns as seen from the AIX side in MB. Unfortunately the size of new luns do not match old size. 

I'll probably just create new luns (or resize) specifying size in Bytes but I'm struggling to display the current size on ONTAP side in Bytes. 

Is it possible ?? I don't see any switch in lun show command

1 ACCEPTED SOLUTION

bobshouseofcards
7,531 Views

Run command

 

set -units B

 

to switch output from subsequent commands that list capacities to Bytes.  Other unit choices are available if more convenient (KB,MB,GB,etc.)

 

 

 

 

View solution in original post

6 REPLIES 6

nelias1988
7,551 Views

hello,

 

you can easily convert the sizes via powershell Get-NcLun cmdlet:

 

PS C:\Windows\system32>

 

Get-NcLun |Select Path,

                   @{Name="Size (KBytes)";Expression={[math]::Round([decimal]$_.Size/1KB,2)}} |Format-Table -AutoSize

 

Just change KB through GB, TB...

 

hope this helps

 

marcinlub
7,512 Views

I'm not a big power shell fan 😛

I prefer command line and if I write something bigger then in perl using ZAPI.

Setting the units to bytes is much easier solution 🙂

bobshouseofcards
7,492 Views

Have to agree - I'm in the CLI all day so getting a quick result that I can cut/paste somewhere for easy manipulation is a huge plus.  

 

Also agree on ZAPI/Perl combo when I really need to script something.  PS Toolkit is too limiting since it doesn't offer Advanced/Diagnostic privilige capabilities - rather have the full ZAPI available through the Perl "toolkit" API bindings.

 

Bob

marcinlub
7,462 Views

I have now other problem. The LUN can't be set to the required size 😕

It can be 117774MB or 117756MB  but nothing in between (like the size of 117760MB  which is required by AIX).

 

NTAP_22_OW::> lun show -vserver STANDALONE_OW -volume RN1100D_RN1102A -fields size,serial,uuid
vserver       path                       size     serial       uuid
------------- -------------------------- -------- ------------ ------------------------------------
STANDALONE_OW /vol/RN1100D_RN1102A/LUN00 117774MB D7J-8?G4cOAM 005a3f26-620a-4a25-b7e0-f68e3e130074


NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117760MB -force

Error: command failed: New LUN size is the same as the old LUN size

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 123480309760B -force

Error: command failed: Requested LUN size is too large

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 115GB -force

Error: command failed: New LUN size is the same as the old LUN size

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117760MB -force

Error: command failed: New LUN size is the same as the old LUN size

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117759MB -force

Error: command failed: New LUN size is the same as the old LUN size

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117758MB -force

Error: command failed: New LUN size is the same as the old LUN size

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117757MB -force

Error: command failed: New LUN size is the same as the old LUN size

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117750MB -force

NTAP_22_OW::> lun show -vserver STANDALONE_OW -volume RN1100D_RN1102A -fields size,serial,uuid
vserver       path                       size     serial       uuid
------------- -------------------------- -------- ------------ ------------------------------------
STANDALONE_OW /vol/RN1100D_RN1102A/LUN00 117756MB D7J-8?G4cOAM 005a3f26-620a-4a25-b7e0-f68e3e130074

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117752MB -force

Error: command failed: New LUN size is the same as the old LUN size

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117753MB -force

Error: command failed: New LUN size is the same as the old LUN size

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117754MB -force

Error: command failed: New LUN size is the same as the old LUN size

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117755MB -force

Error: command failed: New LUN size is the same as the old LUN size

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117756MB -force

Error: command failed: New LUN size is the same as the old LUN size

NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117757MB -force

NTAP_22_OW::> lun show -vserver STANDALONE_OW -volume RN1100D_RN1102A -fields size,serial,uuid
vserver       path                       size     serial       uuid
------------- -------------------------- -------- ------------ ------------------------------------
STANDALONE_OW /vol/RN1100D_RN1102A/LUN00 117774MB D7J-8?G4cOAM 005a3f26-620a-4a25-b7e0-f68e3e130074

bobshouseofcards
7,532 Views

Run command

 

set -units B

 

to switch output from subsequent commands that list capacities to Bytes.  Other unit choices are available if more convenient (KB,MB,GB,etc.)

 

 

 

 

marcinlub
7,462 Views

Hmm... the problem I'm getting now is that it's not possible to set the lun size to the desired size in MB 😕

 

The LUN size can be either 117774MB or 117756MB but not 117760MB as required by AIX.

Why is it like that?? I was thinking I can set the lun size as desired (within volume limits)...

 

 

 

NTAP_22_OW::> lun show -vserver STANDALONE_OW -volume RN1100D_RN1102A -fields size,serial,uuid
vserver       path                       size     serial       uuid
------------- -------------------------- -------- ------------ ------------------------------------
STANDALONE_OW /vol/RN1100D_RN1102A/LUN00 117774MB D7J-8?G4cOAM 005a3f26-620a-4a25-b7e0-f68e3e130074
 
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117760MB -force
 
Error: command failed: New LUN size is the same as the old LUN size
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 123480309760B -force
 
Error: command failed: Requested LUN size is too large
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 115GB -force
 
Error: command failed: New LUN size is the same as the old LUN size
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117760MB -force
 
Error: command failed: New LUN size is the same as the old LUN size
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117759MB -force
 
Error: command failed: New LUN size is the same as the old LUN size
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117758MB -force
 
Error: command failed: New LUN size is the same as the old LUN size
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117757MB -force
 
Error: command failed: New LUN size is the same as the old LUN size
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117750MB -force
 
NTAP_22_OW::> lun show -vserver STANDALONE_OW -volume RN1100D_RN1102A -fields size,serial,uuid
vserver       path                       size     serial       uuid
------------- -------------------------- -------- ------------ ------------------------------------
STANDALONE_OW /vol/RN1100D_RN1102A/LUN00 117756MB D7J-8?G4cOAM 005a3f26-620a-4a25-b7e0-f68e3e130074
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117752MB -force
 
Error: command failed: New LUN size is the same as the old LUN size
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117753MB -force
 
Error: command failed: New LUN size is the same as the old LUN size
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117754MB -force
 
Error: command failed: New LUN size is the same as the old LUN size
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117755MB -force
 
Error: command failed: New LUN size is the same as the old LUN size
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117756MB -force
 
Error: command failed: New LUN size is the same as the old LUN size
 
NTAP_22_OW::> lun resize -vserver STANDALONE_OW -path /vol/RN1100D_RN1102A/LUN00 -size 117757MB -force
 
NTAP_22_OW::> lun show -vserver STANDALONE_OW -volume RN1100D_RN1102A -fields size,serial,uuid
vserver       path                       size     serial       uuid
------------- -------------------------- -------- ------------ ------------------------------------
STANDALONE_OW /vol/RN1100D_RN1102A/LUN00 117774MB D7J-8?G4cOAM 005a3f26-620a-4a25-b7e0-f68e3e130074

 

Public