Tuesday, September 20, 2011

SVC Flashing a copy of a boot LUN

Why would you do this operation?  Well,  if your OS team wants to install patches, but want to be able to fall back to a before-the-patches-were-install state, then you'd flash the boot LUN.  In my case the OS people believed that the production  boot LUN had some kind of corruption in it. Since the boot LUN is windows and there is no native OS back-up utility, they wanted a copy of the Test box's boot LUN presented to the production server. So, actually this should be titled "Flashing a copy of the boot LUN from test in order to give to prodution."
Well let's get to it!
What is the managed disk group for production? (boot LUN's are named Hostname+0)
svcinfo lsvdisk -filtervalue name=Eastwood0

From the output, find 2 facts: 1) the size of the boot LUN and 2) the name of your managed disk group.
Then check to see if you have enough space in the managed disk group by running:
svcinfo lsmdiskgrp -filtervalue name=mdg1746c_7_2t

If you have enough space, then make a new vdisk on which to place the copy.
From the first command, get the iogrp # and fr the second command get the mdiskgrp #.

To make the new virtual disk, run the following command:
svctask mkvdisk -name Eastwood0New -mdiskgrp 6 -size 64 -unit gb -iogrp 1

 Now, to make the flash:
First, get the source drives id number with:
svcinfo lsvdisk -filtervalue name=EastwoodT0
If you want to flash copy the current production's LUN run:
svcinfo lsvdisk -filtervalue name=Eastwood0
with EastwoodT0 being the test server's LUN and
Eastwood0 being the production server's LUN

Then get the destination drive's id (the drive you just made)
svcinfo lsvdisk -filtervalue name=Eastwood0New

Next, map the drives you are mapping from and to:
svctask mkfcmap -source 250 -target 179 -name Eastwood0New
if this svctask works then you will get the message:
"Flashcopy mapping successfully created"

Now, start the flashcopy:
svctask startfcmap -prep Eastwood0new

To check on the progress of how much has been copied run:
svcinfo lsfcmap

Once,  the flash is done, then the Windows system admin need to shutdown the windows server before you switch boot LUNS on this server.  Once this is down you can unmap the current boot LUN:
svctask rmvdiskhostmap -host Eastwood Eastwood0

Then map the newly made flash of the test boot LUN:
svctask mkvdiskhostmap -host Eastwood Eastwood0New

Then call the system admin to boot that system

No comments:

Post a Comment