SHIFT

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


netapplunmove
Differences

This shows you the differences between two versions of the page.

Link to this comparison view

netapplunmove [2013/04/20 09:45] (current)
sjoerd created
Line 1: Line 1:
 += NetApp: Rename a LUN =
  
 +When you manage a NetApp filer and because of new insights or new organizational names (or even maybe typos) you need to change the names of your volumes and LUNs you might be surprised at how easy that is. I, and I think most Administrators,​ use FilerView as the main administrative tool. Since there is a rename button for your volumes there I won't talk about that. There ain't however a rename button for your LUNs but there are two easy ways for renaming them without downtime for your storage consumers. The first option is to use the command "lun move" from the commandline,​ the other one is to use the PowerShell cmd-lets provided by NetApp. See below for more information about these two methods:
 +
 += Command LUN Move =
 +See the help for the command on how to use it:
 +<​code>​
 +filer01> help lun move
 +lun move <​lun_path>​ <​to_lun_path>​
 +  - rename a LUN. Both paths must be in the same volume.
 +</​code>​
 +
 +So, easy enough. Just do it:
 +<​code>​
 +filer01> lun move /​vol/​volume03/​ACC_153 /​vol/​volume03/​filer01_153_SATA_ACC
 +</​code>​
 +
 +It didn't even take a second!!! Then, because I was testing anyway, I moved a VM with a webserver onto the storage and retried renaming it again for a couple of times. There were no problems at all.
 +
 += Command Rename-NaLun =
 +This is the powershell command for exactly the same functionality,​ and it also has a help function:
 +<code powershell>​
 +[vSphere PowerCLI] D:​\sjoerd>​ Import-Module d:​\sjoerd\dataontap
 +[vSphere PowerCLI] D:​\sjoerd>​ Get-Help Rename-NaLun
 +
 +NAME
 +    Rename-NaLun
 +
 +SYNOPSIS
 +    Move (rename) a LUN.
 +
 +
 +SYNTAX
 +    Rename-NaLun [-Path] <​String>​ [-NewPath] <​String>​ [-Controller <​NaController>​] [-WhatIf] [-Confirm] [<​CommonParamet
 +    ers>]
 +
 +
 +DESCRIPTION
 +    Move (rename) a LUN.
 +
 +
 +RELATED LINKS
 +    Get-NaLun
 +
 +REMARKS
 +    To see the examples, type: "​get-help Rename-NaLun -examples"​.
 +    For more information,​ type: "​get-help Rename-NaLun -detailed"​.
 +    For technical information,​ type: "​get-help Rename-NaLun -full"​.
 +
 +[vSphere PowerCLI] D:​\sjoerd>​ Get-Help Rename-NaLun -examples
 +
 +NAME
 +    Rename-NaLun
 +
 +SYNOPSIS
 +    Move (rename) a LUN.
 +
 +    -------------- ​ Example 1 --------------
 +
 +    C:​\PS>​Rename-NaLun /​vol/​vol2/​lun100 /​vol/​vol2/​lun101
 +
 +
 +    Rename LUN '​lun100'​ to '​lun101'​.
 +
 +
 +    BackingSnapshot ​          :
 +    BlockSize ​                : 512
 +    IsSpaceReservationEnabled : True
 +    Mapped ​                   : False
 +    MultiprotocolType ​        : image
 +    Online ​                   : False
 +    Path                      : /​vol/​vol2/​lun101
 +    ReadOnly ​                 : False
 +    SerialNumber ​             : abcdefghijkl
 +    ShareState ​               : none
 +    Size                      : 2000683008
 +    Uuid                      : d44cf834-180e-11df-9cab-00a09806c227
 +    Comment ​                  :
 +</​code>​
 +
 +So, just fire it up:
 +
 +<code powershell>​
 +[vSphere PowerCLI] D:​\sjoerd>​ Connect-NaController filer01 -credential (get-credential)
 +
 +Name                 ​Address ​          ​Ontapi ​  ​Version
 +----                 ​------- ​          ​------ ​  ​-------
 +filer01 ​             10.10.10.10 ​      ​1.12 ​    Data ONTAP Release 7.3.4: Thu May 27 18:22:11 PDT 2010 (IBM)
 +
 +
 +[vSphere PowerCLI] D:​\sjoerd>​ Rename-NaLun /​vol/​volume03/​filer01_153_SATA_ACC /​vol/​volume03/​filer01_15300_SATA_ACC
 +
 +Path                                      TotalSize ​  ​SizeUsed Protocol ​    ​Online Mapped ​ Thin  Comment
 +----                                      --------- ​  ​-------- -------- ​    ​------ ------ ​ ----  -------
 +/​vol/​volume03/​filer0115300_SATA_ACC ​      400.0 GB   323.5 GB  vmware ​       True   ​True ​  ​True ​ LUN for ESX
 +
 +</​code>​
 +
 +This command took a bit longer but worked just as well. If you need just one or two renames I would use the lun move command, and use the powershell if you need it to be inside a script or anything. ​
 +
 +{{tag>​scripts storage netapp}}
netapplunmove.txt ยท Last modified: 2013/04/20 09:45 by sjoerd