ONTAP Discussions

[cDOT] How to list lun size in Bytes

marcinlub
8,818 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
8,790 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
8,810 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
8,771 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
8,751 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
8,721 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
8,791 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
8,721 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