NetApp Lun Clone & Lun Clone Split
The other day I was asked if I could create a virtual copy of a SQL server for some performance and load testing. Of course I said that wouldn’t be a problem. My only brief was that the original server must remain live and it can only be taken offline on a Sunday evening.
So I sat down and planned an approach. The first part was the server and the applications. Thankfully it was just one SQL server and the application was also on the same box. So just the one P2V was required.
I planned to stop the SQL and Application services before the P2V. I also planned to re-size the system partition as it was 8GB!! The P2V will let me do this and this would allow the bench mark utilities to be installed.
Then I looked at the rest of the drives attached and they were on the NetApp. This was interesting as I could not just present them to the test box for obvious reasons and I did not have a Flex Clone license available. That’s when I found out about LUN copy clone and UN copy split.
Using these would allow me to create a separate LUN that was a clone of the original. This could then be presented to the virtual test machine.
Here are my findings around these commands.
- The cloned LUN must reside in the same volume as the LUN you are cloning.
- The LUN clone split can only split off into the same volume that the LUN clone is in.
- Data Motion might work to move the volume and then the duplicate LUNs could be deleted. Though I think Data Motion may require the volumes to change aggregate?
- Double the size of your volume to hold the additional LUN. If you don’t you will get an error saying your out of space. I did a quick test just to see if the clone LUN is deleted and its not so make sure you remove it.
- Create a snapshot of the volume containing the LUN. I would suggest using a sensible name and not the default name!
- Run the LUN Clone Command below. If you see this error check the path closely… LUN clone create: No such LUN exists in snapshot. Once the clone has been created the snapshot is locked and cannot be deleted until you delete the clone or split it. The LUN clone actually becomes a writable snap shot which is pretty handy too but I wanted a totally separate environment.
- Run the LUN clone split command below. You can monitor the status of the split by running LUN clone status command
- Add new LUNs to correct initiator group and present to host.
- Tidy up and delete the snap shot that you created.
NOTE:You can also run multiple splits and this appears to have no impact on the speed of completion. My largest LUN took a few hours to split which was 200GB.
Command syntax LUN CLONE CREATE <path to volume clone LUN> -0 noreserve -b <parent LUN path> <snap shot name>
The switch for -o noreserve means that the LUN is not thin provisioned.
Here is an example of what I ran.
un clone create /vol/sv02_sys/sv02_sysclone.lun -o noreserve -b /vol/sv02_sys/sv02_sys.lun sv02_sys_SNAP
lun clone split start -d /vol/sv02_sys/svr02_sysclone.lun