Operating System - HP-UX
1827863 Members
1915 Online
109969 Solutions
New Discussion

Cloning kernel configurable parameters

 
SOLVED
Go to solution
Daniel Sanabria
Advisor

Cloning kernel configurable parameters

How can I copy all the kernel configurable parameters from one rp3440 server in a number of rp3440s with the same Hardware specs but without using ignite or sam, just using plain old command line?
15 REPLIES 15
NMory
Respected Contributor

Re: Cloning kernel configurable parameters

Daniel:

Have a full backup of all your info before to attempting this.

If you want to duplicate your Kernel from one system to another try these steps:

1. Copy /stand/vmunix from one system to a directory on the other server
2. Run SAM -> Kernel Config -> Configurable Parameters
3. Go to Actions -> Templates -> Load a template file
4. Specify /[directory]/vmunix
5. Go to Actions -> Templates -> Apply Template Values
6. Check both "Driver and Subsystem Values" and "Configurable
Parameter Values"
7. Go to Actions -> Process New Kernel

On Step 6 you can try both or just "Configurable Parameter Values"

Reboot the server if needed.
Make sure you have the latest cumulative SAM Patch installed.

LN
nanan
Trusted Contributor

Re: Cloning kernel configurable parameters

Hi daniel
HP-UX OS version is the same, isn't it?

I think you can do that like this
1. copy the original system's /stand/system file to those servers you intend to match the kernel parameter.

2. mk_kernel -s "the copied file"

that's my idea!!

Regards
nanan
Michael Steele_2
Honored Contributor

Re: Cloning kernel configurable parameters

Why don't you just copy the system file over and diff the two?
Support Fatherhood - Stop Family Law
Daniel Sanabria
Advisor

Re: Cloning kernel configurable parameters

Thanks for your reply Nassar but the idea is not to use sam at all since what I have is a very slow remote console connection.
Daniel Sanabria
Advisor

Re: Cloning kernel configurable parameters

Thanks Nanan, yes the OS version is the same for all the servers HP-UX 11i.
OldSchool
Honored Contributor

Re: Cloning kernel configurable parameters

If the issue is sam in a gui, you could also run sam from a terminal window. An emulator that supports wyse50 or wyse60 works very well for this.
Daniel Sanabria
Advisor

Re: Cloning kernel configurable parameters

Is there a way to do it not using SAM at all not even in a terminal window? That's my main interest.
Robert Andersson
New Member

Re: Cloning kernel configurable parameters

If you are running 11.23 you can do something like:
On the first machine export the kernel configuration by
kconfig -e /tmp/myfile

Transfer the exported file to the new machine and import the konfiguration with
kconfig -i /tmp/myfile
shutdown -yr 0

And when the machine is rebooted the second machine should be similiar to the first one.
Doug O'Leary
Honored Contributor
Solution

Re: Cloning kernel configurable parameters

Hey;

Here's what I do when I have to run this. Note: it's easier on 11.23, but you specified 11.11, so here goes:

1. Follow the directions on http://www.olearycomputers.com/ll/hpkernel.html to create a new /stand/build/system file.

2. Copy the /stand/system from your source system to a temporary directory:

mkdir -p /root/working/kernel
cd $_
scp ${host}:/stand/system .

3. ID kernel differences:

sed -n -e '/^Tunable/,$p' ./system | awk 'NF ==2 {print $1,$2)}' | \
while read p v
do
c=$(kmtune -q ${p} | tail -1 | awk '{print $2}')
[[ "${c}" != "${v}" ]] && printf "%-30s %-15s %s\n" ${p} ${c} ${v}
done | tee kern_parms

4. Edit the kern_parms; remove any kernel parameters you don't want updated.

5. Update the /stand/build/system file:

awk '{print $1,$3}' kern_parms | while read p v
do
kmtune -s ${p}=${v} -S /stand/build/system
done

6. Follow remaining instructions in the url link above to generate the kernel. In short:

mk_kernel -s /stand/build/system
cp /stand/system /stand/system.prev
cp /stand/vmunix /stand/vmunix.prev
km_update
reboot

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Bob_Vance
Esteemed Contributor

Re: Cloning kernel configurable parameters

Doug,
I like your script!
I had a couple of problems when testing it out on 11.11, however.

1) don't need ^ in ^Tunable

2) missing "(" in the first awk print function
( or, an extranous ")" ;>)

3) when you compare using the "Current" value, you lose macros and thus get false non-matches. I would suggest using "Planned" ( $4 instead of $2)

Now, this was on 11.11
and my 11.23 system has gone missing so I cannot check it there.


bv
"The lyf so short, the craft so long to lerne." - Chaucer
Doug O'Leary
Honored Contributor

Re: Cloning kernel configurable parameters

Hey;

Thanks.

The ^Tunable is to ensure I get the tunable from "tunable parameters" Generally not needed, I agree, but I tend to like to hammer those down.

The awk was definitely an error; typing those into a browser window is very different than typing them into a command line. That particular awk shouldn't have the paren before the closing brace.

There's definitely arguments pro/con for using the current vs the planned. I usually go for the current in case someone else has tweaked the kernel for the next reboot - at least I'm using parameters from a known good, bootable kernel.

Thanks for the feedback.

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Bob_Vance
Esteemed Contributor

Re: Cloning kernel configurable parameters

My point on ^Tunable was the carat itself, meaning that "Tunable" was first char on the line.

On my 11.00 and 11.11 systems, the actual string in "system" is

"* Tunable ...."
so ^Tunable did not match it.
Keeping case, but removing first-char restriction probably makes it match on any HPUX version.


bv

"The lyf so short, the craft so long to lerne." - Chaucer
Doug O'Leary
Honored Contributor

Re: Cloning kernel configurable parameters

Hey;

>> My point on ^Tunable was the carat itself, meaning that "Tunable" was first char on the line.

>> On my 11.00 and 11.11 systems, the actual string in "system" is

>> "* Tunable ...."

You are absolutely correct. I really ought not try to write these things from memory in a browser window. Humble apologies.

At least the logic's sound :)

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Kevin Wright
Honored Contributor

Re: Cloning kernel configurable parameters

scp /stand/system file, mk_kernel -s, reboot, done.
Bob_Vance
Esteemed Contributor

Re: Cloning kernel configurable parameters

I don't think that's quite right, Kevin, at least on 11.11.


1) it should be
mk_kernel -s system

2) and this only creates build/vmunix_test.

You still need the 'kmupdate' command prior to reboot.


bv
"The lyf so short, the craft so long to lerne." - Chaucer