Wednesday, November 7, 2007

Using Solaris Volume Manager To Help With Server Moves

Howdy,

For the basics of setting Solaris Volume Manager up for basic root disk mirroring, you can refer back to an older post on this site (just search for those bolded terms) or try this link.

Here we're going to do discuss another good use for Solaris Volume Manager mirroring: Server moves. Especially server moves where you're required to migrate the server from one server platform to another (Say, from a 6800 to a v490 or something like that).

Using Solaris Volume Manager, it's very simple to set yourself up to be able to roll back all your changes if your migration fails, without losing anything in the process (except maybe a lot of your time since, if it fails, you'll have to do it again at some point).

Sucessfully rolling back is paramount to any server move, or project. If you can't go back to the way things were once you begin to enact a change, you're taking a huge risk if anything goes wrong!

Basically, you'll be guaranteeing your security in three simple steps. Our assumption is that your basic mirroring setup is as such: metadevice d0 consists of metadevice mirrors d10 and d20, d1 consists of d11 and d21, etc)

1. Assuming a simple disk-to-disk mirror setup, detach the secondary mirror for each slice on the root disk (of course, this would apply to all other disks and slices, but I'm trying not to take up too much space today, so we'll stick to the first two slices on the first two disks ;)

metadetach d0 d20
metadetach d1 d21


2. Now remove the secondary disk (leaving in the one that's actively running your system!) and replace it with a new third disk. Format this disk exactly the same as the disk already in the system (using prtvtoc and fmthard, or just using select in the format partition command menu) and create your tertiary mirrors.

metainit -f d30 1 1 c0t1d0s0
metainit -f d31 1 1 c0t1d0s0


Note that this disk is in the same logical disk location as your original mirror disk. That's not a problem and will work to your benefit when you put back the original mirrors.

3. Now attach those new metadevices to the original mirror devices and wait while they sync up your primary disk

metattach d0 d30
metattach d1 d31


Once you're done with this, simply go through this whole process again, but detach the new mirrors, remove your new disk, replace your old disk and reattach the old mirrors (you won't have to metainit your old mirrors, since SVM still thinks they exist but aren't in use).

Now you have a disk that, should everything go horribly wrong, you can pop back in your original server and get things right back to the way they were. You may need to re-install the bootblock on your backup disk (from a single user cd boot), but this will generally work without extra effort :)

, Mike