Operating System - HP-UX
1833848 Members
2412 Online
110063 Solutions
New Discussion

Cloning system with mirrored disk?

 
Hai Nguyen_1
Honored Contributor

Cloning system with mirrored disk?

Folks,

I have two rp7400 systems A and B with IDENTICAL hardware. System A has been built with the OS mirrored. Since the servers are tapeless, I cannot use ignite to clone system B. Instead, I intend to clone it using a mirrored system disk from system A. If it is possible, can you provide me with a detailed, safe procedure since system A is a production box? Thanks.

Hai
14 REPLIES 14
Stefan Farrelly
Honored Contributor

Re: Cloning system with mirrored disk?

You can use ignite to clone them - do it do an ignite server across the network. You dont need a tape drive. When you want to install a new server from the clone image simply boot from the network pointing to the server with the ignite image on. Works a treat - we use it all them time. Easier than having to take tape copies and looking after them. All you need is lots of diskspace on your ignite server to dump the ignite images.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Sridhar Bhaskarla
Honored Contributor

Re: Cloning system with mirrored disk?

Hi,

This is the fastest was that I use to clone the failover server. You can do the following.

Make sure you have an ignite tape ready before doing this.

1. Establish the mirroring. Make sure the auto string is "hpux -lq".
2. Find out the idle time when your system will not be busy. Replace the mirror disk with a new disk.
3. Run ioscan -f and make sure the new disk is claimed. At this time lvlnboot, vgdisplay etc., will give you errors.
4. Do a vgcfgrestore onto the new disk.
vgcfgrestore -n vg00 /dev/rdsk/c?t?d?
vgchange -a y vg00
mkboot -l /dev/rdsk/c?t?d?
mkboot -a "hpux" /dev/rdsk/c?t?d?
vgsync
lvlnboot -r /dev/vg00/lvol3 /dev/vg00
lvlnboot -b /dev/vg00/lvol1 /dev/vg00
lvlnboot -s /dev/vg00/lvol2 /dev/vg00
lvlnboot -d /dev/vg00/lvol2 /dev/vg00
lvlnboot -R
lvlnboot -v
Make sure both the disks are listed as bootable. Verify the mirrors.

Use the taken out disk to boot the other system. Get into single user mode, change the configuration like hostname, network etc.,


-Sri

You may be disappointed if you fail, but you are doomed if you don't try
Hai Nguyen_1
Honored Contributor

Re: Cloning system with mirrored disk?

Stefan,

Thanks for your help. I forgot to mention that I could not use that option due to lack of available space and use of tftp not permitted.

Hai
Steven E. Protter
Exalted Contributor

Re: Cloning system with mirrored disk?

You can do it with Ignite.

I am doing exactly the same thing here with L2000 boxes.

You will need a post configuration script that does pvcreate -B on the mirror disk and does the lvextend -m 1 on the appropriate filesystems.

Ignite requires NFS with a filesystem with a golden image exported(there are other ways to go).

You will need some of the Berkely protocols enabled, which is a security risk(ex rlogin)

Email me for the configuration script if you are interested. It's a far from trivial process to develop the Ignite golden image and I went to a class to learn it by HP.

We're almost ready to use Ignite to copy boot partitions including kernnel and patches from an image server to production severs via Ignite.

Steve
Don't forget the points, I'm collecting them.

Steve
Don't forget the points. Its a macho thing.
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Carlos Fernandez Riera
Honored Contributor

Re: Cloning system with mirrored disk?

I think it can be done with no much effort,but little risk, as you are taking off one drive.

First thing to do is be absolute sure that are not lvols not mirrored, and all phisical extents resides on both disks. Use lvdisplay -v to check it.

After unplug the disk, just insert a new one and do the recovery for that disk:

ioscan , pvcreate -B, vgcfgrestore and vgsync, mkboot, etc. Also lvlnboot -R.


Now on the second server you must plug the disk,better if it is the only one, and boot in lvm maintemance, w/o quorum.


bo pri
interact .. yes
hpux -lq -lm


once the system is up, Do a vgexport of all non vg00 vgs. Do a transition to single user ( init S). Use set_parms to change systems configuration??( uname, IP adresses...)

Insert a new disk for mirror and run again the procedure to mirror.

I have be done this some year ago. You can check the procedure on the second box, unpluging mirrored disk, changing some parameters as IP address and removing some lvols, etc. Check it before attack the production box.


Good Luck.




unsupported
Stefan Farrelly
Honored Contributor

Re: Cloning system with mirrored disk?


The easiest way to do it is to use dd, not mirror/UX. A mirrored copy of a disk is configured differently than the primary (eg. device names) but if you make a dd copy of a primary disk then it IS A CLONE. ie. it could be simply substituted for the boot disk if needed and it would boot, which couldnt be done with a mirror disk without a few changes/extra commands.

Basically, to be safe boot from single user mode then simply dd if=/dev/rdsk/c0t6d0 (or whatever your boot device is) of=/dev/rdsk/cxxxxx (clone device) bs=1024k.
(source and destination disk need to be same size).

Weve tried this before just as a test and it worked fine.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Hai Nguyen_1
Honored Contributor

Re: Cloning system with mirrored disk?

Steven,

Thanks. But I am not interested in ignite in this case.

Sridhar, Carlos,

Your solution is what I want. I am reviewing it. Sridhar, I wonder why you do not turn on "hpux -lq" in mkboot instead of "hpux".

Hai
Sridhar Bhaskarla
Honored Contributor

Re: Cloning system with mirrored disk?

Hai,

That was a typo. I did mention that you wanted to make sure it was "hpux -lq".

Yes. You will do a "mkboot -a "hpux -lq" /dev/rdsk/c?t?d?

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Armin Feller
Honored Contributor

Re: Cloning system with mirrored disk?

 
Jean-Louis Phelix
Honored Contributor

Re: Cloning system with mirrored disk?

hi,

It's not because he is a Pharaon ( :^) , but Stefan's solution is really the most efficient and risk'less solution. Using mirror could always get you in trouble if something happens during mirroring or reducing phase, and the mirror copy really needs to be modified afterwards. If you want to clone and don't want to use ignite, use dd (perhaps rather on block device than on raw device to get buffer cache updates even if it's slower). Then boot your system, use fsck and set_parms and everything will be fine.

Regards
It works for me (© Bill McNAMARA ...)
Sridhar Bhaskarla
Honored Contributor

Re: Cloning system with mirrored disk?

I am just wondering how you would do a 'dd' if your server has only two internal bays and the mirroring is already setup.

I also want to know if 'dd' does not duplicate the mirroring properties if you find a way to 'dd' the mirrored disk.

As I mentioned I do it *all* the time here while building the serviceguard clusters.

I do not argue about using dd because I also used it before. But I do not say that it is the best possible solution under every circumstance.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Hai Nguyen_1
Honored Contributor

Re: Cloning system with mirrored disk?

Sridhar,

In step 2, will the mirrored disk be out of sync and unusable as a result of a hotswap? Thanks.

Hai
Sridhar Bhaskarla
Honored Contributor

Re: Cloning system with mirrored disk?

Once it is taken out, it is perfectly usable because you are not reducing the mirrors. You are actually creating a situation where the system would think that the mirror disk has failed. It is the same process you would follow to replace a bad mirror disk. Since RP7400 supports hot-pluggability and Mirror/UX provides you redundancy, this can be easily done. To be on safer side which you would always be while dealing with the production systems, make sure you do it during the night time when your system will be less used.


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Hai Nguyen_1
Honored Contributor

Re: Cloning system with mirrored disk?

Thanks for your help. I have built the lab cluster successfully by restoring the vg00 data from a full backup of the production server.

Sridhar,

I did not try your approach but I believe that it will work. I had to try a safer way to do my job.

Thanks again folks.

Regards,
Hai