fintanr's weblog

Archives

« May 2008
MonTueWedThuFriSatSun
   
1
2
3
4
5
6
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today

the links



















All | Books | Gadgets | General | JES | OpenSolaris | Perl | Slamd | Solaris | Travels | Tunes

20080410 Thursday April 10, 2008

xVM and the art of beer maintenance
We all know global warming is occurring, and from individual's to corporations we can all make a contribution to containing, and eventually reversing climate change, and save a bit of cash along the way as well. Seems like a win, win deal to me. But now the urgency has grown, a colleague of mine forwarded on an article about the price of beer. The price of beer I hear you ask? From the AP release

Jim Salinger, a climate scientist at New Zealand's National Institute of Water and Atmospheric Research, said climate change likely will cause a decline in the production of malting barley in parts of New Zealand and Australia. Malting barley is a key ingredient of beer.

"It will mean either there will be pubs without beer or the cost of beer will go up," Mr. Salinger told the Institute of Brewing and Distilling convention.

Now considering the fact, to borrow a quote the folks over on Goats, that

Beer is the salvation of all mans souls

this is a matter of some urgency for all of us in the technology industry to address. Luckily for us the most complete suite of technologies, services and solutions to address these problems is available from Sun.

Virtualization & Consolidation

There is virtualization from the management layer with Sun xVM Ops Center, to our hypervisor level offering xVM, based on the work of the openxVM community, to logical domains with LDoms on our award winning CoolThreads servers, to software level virtualization with Solaris Zones and desktop level virtualization with Sun xVM VirtualBox.

Using xVM and our range of x64 and Sun Blade Systems you can consolidate your existing Solaris, Windows and Linux environments into one environment. Personally I still have a soft spot for the Sun Fire x4600 M2, but given the choice I would go for the Sun Blade 6000 with Sun Blade x6220 Server Modules for x64 and x86 consolidation.

Why the Sun Blade 6000? Very simple, because I can use the same blade chassis with LDoms and the Sun Blade T6320 Server Module to consolidate my existing Sparc applications. Of course if you don't feel that xVM is the right choice for your Windows or Linux consolidation all of our x64 servers are VMWare certified, and you can get your support and services directly from Sun.

Sometimes however its not possible to migrate your ISV application to the latest version of Solaris, we are all aware of the application that was certified on with database X, jvm y and os z that no one wants to get recertified due to the costs, but you know that the old machine thats there is just not efficient any more, users would like better performance that can only come from a hardware upgrade, but the new hardware doesn't support the old OS - fear not as Solaris 8 Containers, building on the excellent work of the Zones and BrandZ communities over at OpenSolaris allows you to safely consolidate applications certified for Solaris 8 and Solaris 9 applications using Solaris 10 Containers, using any of our servers, from the most energy efficent servers on the market, Suns CoolThreads servers, to our high end offerings.

If your not sure if this is for you or uncertain if you want to undertake a migration, why not get one of our newly launched Sun Sparc Enterprise T5140 Servers on our Try & Buy program, contact our Professional Services group about our Enterprise Migration service, and see how much you could save on power, maintenance and support. Your boss will thank you for saving your business money and more importantly you will be helping to protect the global beer supply, which we all know is the real issue here :).
(2008-04-10 05:43:10.0) Permalink

20070725 Wednesday July 25, 2007

compiling lame
I was compiling up lame earlier on this evening, and encountered the following error

brhist.c: In function `brhist_disp':
brhist.c:432: error: syntax error before '->' token
brhist.c:459: error: invalid type argument of `->'
brhist.c:465: error: invalid type argument of `->'

Anyway the good folks over at pkgsrc have a work around documented.
(2007-07-25 15:11:42.0) Permalink

20070723 Monday July 23, 2007

Solaris Freeware Downloads
Solely because I've just spent fifteen minutes searching for the relevant link, a direct link for Freeware Downloads for the Solaris 10 Operating System, which of course work on Nevada as well.
(2007-07-23 03:39:15.0) Permalink Comments [1]

20070711 Wednesday July 11, 2007

Flash 9 for Solaris
Its been in beta for a while, but Leon Sha has announced that Flash Player 9 for Solaris is now available. It should be integrated directly into Solaris Express relatively soon. And yes, before someone comments, I would like to see Acrobat on x86 as well, but if you haven't looked at it, evince is more than suffice, and is bundled as part of JDS.

Technorati Tag(s) :

(2007-07-11 03:45:08.0) Permalink

20070328 Wednesday March 28, 2007

Building And Deploying OpenSolaris
The slides from my presentation on Building and Deploying OpenSolaris which I gave to the Irish OpenSolaris Users Group last night are now available. Thanks to Stephen Lau, Darren Moffat and Tim Foster for various contributions to the presentation.

Now some urls for the various bits and pieces I mentioned last night.


Technorati Tag(s) : ,

(2007-03-28 05:27:04.0) Permalink

20070327 Tuesday March 27, 2007

Last minute voting....
Have you used your vote? If you are a core contributor for OpenSolaris you still have a few hours left to vote in the current open polls.

  • Board Election 2007
  • Ratify Constitution
Head over to poll.opensolaris.org for the details.
Technorati Tag(s) : ,

(2007-03-26 17:19:32.0) Permalink

20070307 Wednesday March 07, 2007

Irish OpenSolaris Users Group @ Trinity, March 27th
The next Irish OpenSolaris Users Group meeting is being hosted at Trinity College on March 27th, courtesy of Trinty Netsoc. Tim is mailing out the details at the moment, but if your a bit impatient you can also take a look on the users group page. Or just read on for a slighty abridged version of the annoucement

Seventh Irish OpenSolaris User Group Meeting
Topic	An introduction to OpenSolaris
Date	Tuesday 27th Mar 2007
Time	6:30pm onwards
Location	Swift Theatre, Arts Block – TCD, courtesy of Netsoc
Directions	TCD

This month, we're going to hold a presentation on a topic that's probably a bit 
overdue, but better late than never.

An Introduction to OpenSolaris

Tim will be covering:

    * Why OpenSolaris was started
    * How the project is organised
    * A short history of the project to date

And now the surprising part, yours truly will be presenting ..............

Fintan has volunteered to present:

    * Building & installing your own OpenSolaris bits
    * How you can start contributing

So, if you're interested in learning more about OpenSolaris, as well as 
how to get started hacking on the code, you should definitely come along.

We've also got a slot for our monthly run-down of OpenSolaris highlights 
since our last meeting in February, however, we don't yet have someone who 
can present this – if you're interested, please drop us a mail

Looking forward to seeing you there!

So as Tim said, pop along, and you never know, we may manage a beer afterwards. And I'll explain the difference between has and was to some folks (don't worry, I had planned to do a talk Tim ;) ).

Technorati Tag(s) : ,

(2007-03-07 08:26:44.0) Permalink

20061205 Tuesday December 05, 2006

OpenSolaris Developer Conference 2007
The German Unix Users Group is organising the OpenSolaris Developer Conference 2007, in Berlin, from Feb 27th to March 2nd, and there is still time to respond to their call for papers. Should be an interesting conference. Having missed out on a trip to Berlin when I briefly wroked in Germany a few years back I think I may have found a perfect excuse to go visit ;).

Technorati Tag(s) : ,

(2006-12-05 08:22:45.0) Permalink

20061017 Tuesday October 17, 2006

Jumpstart, multiple nics and ipv6
Quick tip. In most of the jumpstart examples that one sees, and certainly with the way we configure machines within our own lab, people generally specify one network interface and configure the rest later [1]. Jumpstart, using the network interface keyword can allow you to avoid this if you wish.

Currently we are doing some ipv6 work, and the system that we were setting up has two interfaces which will be used as ipv6 interfaces, while the primary interface is just ipv4. An example sysidcfg file to achieve this on installation is below

system_locale=C
timezone=GB-Eire
terminal=dtterm
network_interface=iprb0 {primary 
                         hostname=mach-ipv4 
                         netmask=255.255.255.0 
                         protocol_ipv6=no 
                         default_route=192.1.2.254}
network_interface=iprb1 {hostname=ipv6-1 
                         ip_address=10.1.1.2 
                         netmask=255.255.255.0 
                         protocol_ipv6=yes 
                         default_route=NONE}
network_interface=e1000g0 {hostname=ipv6-2 
                         ip_address=10.1.2.2 
                         netmask=255.255.255.0 
                         protocol_ipv6=yes 
                         default_route=NONE}
nfs4_domain=sun.com
root_password=xxxxxxxxxxxxx
timeserver=localhost
name_service=NIS { domain_name=blah.test.sun.com }
security_policy=none
This results in the following network setup (this setup is on Nevada build 49).
# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843 mtu 1500 index 2
        inet 10.1.2.2 netmask ffffff00 broadcast 10.1.2.255
        ether 0:2:b3:bb:c5:b2
iprb0: flags=1000843 mtu 1500 index 3
        inet 192.1.2.230 netmask ffffff00 broadcast 192.1.2.255
        ether 0:3:47:30:ee:21
iprb1: flags=1000843 mtu 1500 index 4
        inet 10.1.1.2 netmask ffffff00 broadcast 10.1.1.255
        ether 0:3:47:30:ee:22
lo0: flags=2002000849 mtu 8252 index 1
        inet6 ::1/128
e1000g0: flags=2000841 mtu 1500 index 2
        inet6 fe80::202:b3ff:febb:c5b2/10
        ether 0:2:b3:bb:c5:b2
iprb1: flags=2000841 mtu 1500 index 4
        inet6 fe80::203:47ff:fe30:ee22/10
        ether 0:3:47:30:ee:22
#

[1] We generally configure extra interfaces within our benchmarking framework, as different configs are required from the same machine.

Technorati Tag(s) : ,

(2006-10-17 03:24:35.0) Permalink

20060817 Thursday August 17, 2006

Demangling C++ symbol names
Like quite a few of my colleagues I ordered the the two volume update of Solaris Internals pretty much as soon as they came out, and one of the most useful tips I have come across in reading of Solaris Performance and Tools is a program bundled with the Sun Studio Compilers, c++filt.

c++filt demangles C++ symbol names, (for postmortem debugging mdb has the ::dem dcmd [1]), and is mentioned with reference to java in several sections of the the book. Anyway an example will save you listening to me ramble on, so as an example lets look at an abbreviated pstack(1) of a java process on my desktop.

tiresias /home/fintanr $ ptree `pgrep java`
2287  /usr/bin/java -jar /usr/lib/patch/swupna.jar -wait
28414 /usr/jdk/instances/jdk1.5.0/jre/bin/java -client -Xbootclasspath/a:/usr/jdk/ins

tiresias /home/fintanr $ pstack 28414
... snip....
-----------------  lwp# 38 / thread# 38  --------------------
 fef38c27 lwp_cond_wait (830a4a8, 830a490, 0, 0)
 feab748c __1cCosHSolarisFEventEpark6M_v_ (830a468) + 4c
 feab6b36 __1cNObjectMonitorEwait6MxipnGThread__v_ (814c774, 0, 0, 1, 8652e80) + 346
 feab64b0 __1cSObjectSynchronizerEwait6FnGHandle_xpnGThread__v_ (82e55cc, 0, 0, 8652e80) + 70
 feab6204 JVM_MonitorWait (8652f40, ee37bbb0, 0, 0, ee37bb7c, 0) + 234
 f9207fcd ???????? (0, f9206269, 0, 0, ef8fe738, ee37bbb4)
 f9202a7b ???????? (ef8fe738, 3, ef8fe738, ee37bbdc, f35a9d08, ee37bc20)
 f9202a7b ???????? (0, 0, 0, ef8fe738, 0, efa090d0)
 f9202d81 ???????? (efa090d0, ee37bc68, fedb2000, 8652e80, 1, ee37bcfc)
 f9200152 ???????? (ee37bca8, ee37be4c, a, f342b5b0, f92072d0, ee37bda8)
 feaa86d7 __1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_ 
 (ee37be48, ee37bd40, ee37bda4, 8652e80, ee37bd34, feaa8528) + 187
 feaa8544 __1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread_
     _v2468_v_ (feaa8550, ee37be48, ee37bd40, ee37bda4, 8652e80) + 14
 feaa8528 __1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_
    (ee37be48, 82e55c8, ee37bda4, 8652e80) + 28
 feab5ede __1cJJavaCallsMcall_virtual6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments
    _pnGThread__v_ (ee37be48, 82e55bc, fedd4e58, fedd4f28, ee37bda4, 8652e80) + be
 feab5e0d __1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_5pnGThread__v
   _ (ee37be48, 82e55b8, 82e55bc, fedd4e58, fedd4f28, 8652e80) + 6d
 feab5d80 __1cMthread_entry6FpnKJavaThread_pnGThread__v_ (8652e80, 8652e80) + d0
 feab5c81 __1cKJavaThreadRthread_main_inner6M_v_ (8652e80) + 51
 feab5c25 __1cKJavaThreadDrun6M_v_ (8652e80) + 105
 fecc05e2 __1cG_start6Fpv_0_ (8652e80) + d2
 fef37bdd _thr_setup (fbe66000) + 51
 fef37e30 _lwp_start (fbe66000, 0, 0, 0, fbe66000, ee37bff8)

tiresias /home/fintanr $ pstack 28414 | ./c++filt
.... snip.....
----------------  lwp# 38 / thread# 38  --------------------
 fef38c27 lwp_cond_wait (830a4a8, 830a490, 0, 0)
 feab748c void os::Solaris::Event::park() (830a468) + 4c
 feab6b36 void ObjectMonitor::wait(long long,int,Thread*) (814c774, 0, 0, 1, 8652e80) + 346
 feab64b0 void ObjectSynchronizer::wait(Handle,long long,Thread*) (82e55cc, 0, 0, 8652e80) + 70
 feab6204 JVM_MonitorWait (8652f40, ee37bbb0, 0, 0, ee37bb7c, 0) + 234
 f9207fcd ???????? (0, f9206269, 0, 0, ef8fe738, ee37bbb4)
 f9202a7b ???????? (ef8fe738, 3, ef8fe738, ee37bbdc, f35a9d08, ee37bc20)
 f9202a7b ???????? (0, 0, 0, ef8fe738, 0, efa090d0)
 f9202d81 ???????? (efa090d0, ee37bc68, fedb2000, 8652e80, 1, ee37bcfc)
 f9200152 ???????? (ee37bca8, ee37be4c, a, f342b5b0, f92072d0, ee37bda8)
 feaa86d7 void JavaCalls::call_helper(JavaValue*,methodHandle*,JavaCallArguments*,Thread*) 
   (ee37be48, ee37bd40, ee37bda4, 8652e80, ee37bd34, feaa8528) + 187
 feaa8544 void os::os_exception_wrapper(void(*)(JavaValue*,methodHandle*,JavaCallArguments*,Thread*),
    JavaValue*,methodHandle*,JavaCallArguments*,Thread*) (feaa8550, ee37be48, ee37bd40, ee37bda4,
    8652e80) + 14
 feaa8528 void JavaCalls::call(JavaValue*,methodHandle,JavaCallArguments*,Thread*) (ee37be48,
    82e55c8, ee37bda4, 8652e80) + 28
 feab5ede void JavaCalls::call_virtual(JavaValue*,KlassHandle,symbolHandle,symbolHandle,JavaCallArguments*,
   Thread*) (ee37be48, 82e55bc, fedd4e58, fedd4f28, ee37bda4, 8652e80) + be
 feab5e0d void JavaCalls::call_virtual(JavaValue*,Handle,KlassHandle,symbolHandle,symbolHandle,Thread*) 
    (ee37be48, 82e55b8, 82e55bc, fedd4e58, fedd4f28, 8652e80) + 6d
 feab5d80 void thread_entry(JavaThread*,Thread*) (8652e80, 8652e80) + d0
 feab5c81 void JavaThread::thread_main_inner() (8652e80) + 51
 feab5c25 void JavaThread::run() (8652e80) + 105
 fecc05e2 void*_start(void*) (8652e80) + d2
 fef37bdd _thr_setup (fbe66000) + 51
 fef37e30 _lwp_start (fbe66000, 0, 0, 0, fbe66000, ee37bff8)

Very handy if I do say so.

[1] mdb ::dem help
> ::help dem

NAME
  dem - demangle C++ symbol names

SYNOPSIS
  ::dem name ...

ATTRIBUTES

  Target: kvm
  Module: mdb
  Interface Stability: Evolving

(2006-08-17 04:30:42.0) Permalink

20060704 Tuesday July 04, 2006

3rd Irish OpenSolaris User Group Meeting

Subject: 3rd Irish OpenSolaris User Group Meeting
Date: Tue, 04 Jul 2006 12:08:00 +0100
From: Tim Foster 
To: iosug@yahoogroups.com

Hi All,

We're going to hold our 3rd meeting in a few weeks time - on Tuesday
25th July. In general, I think it might be good to try to always do one
on the last Tuesday in every month in the future, which would make it
easier to schedule things.

Here are the details for the next meeting:

Topic   : DTrace
Date    : Tue 25th July, 19:00
Location: Sun Offices, East Point Business Park

This month's main topic will be DTrace. Sean McGrath, an engineer in the
Sun Ireland Performance Group will give us an introduction to the
Dynamic Tracing facility in OpenSolaris and will also be doing some live
demos for us.

If you're doing *any* application development on *any* UNIX-like
operating system, and that app can be compiled on OpenSolaris, then you
really should come along - DTrace is well worth a few hours of your time
(and it'll almost certainly pay back that time a thousand-fold once you
learn how to use it!)

Sean's asked that anyone who has applications which compile on
OpenSolaris (x86 if possible) that they bring them along, and we'll have
a look at any possible performance problems they might have: DTrace is
best demoed on applications the audience is familiar with, so now's your
chance - if a bit of software has been bugging you, and you're not sure
what's wrong, DTrace can help. Examples could be:

 * a webserver with unexplained (performance) problems
 * you want to see what xmms is reall doing ?
 * how a shell script executes
 * why does my terminal-emulator take so long to scroll
 (the list is endless)

We want your applications!

As well as that, I'll try to do a quick run-down of OpenSolaris-related
things that have happened since our last meeting.

[snip .... ]

Technorati Tag(s) : ,

(2006-07-04 05:32:23.0) Permalink Comments [2]

20060626 Monday June 26, 2006

IE-OSUG @ ApacheCon Europe
ApacheCon Europe kicked off today, and conveniently for us its on in Dublin this year. Sean, Nicky, possibly Tim, (a guest appearance on returning from hisholidays) and I will be floating around at various times from Wednesday to Friday, wearing our Irish OpenSolaris Users Group caps (okay not literally in my case, baseball caps just don't suit) at the Sun booth.

If your attending feel free to call by for a general chat, or more detailed questions. We will have iso's of the various distros with us if you want to try the live cd's of Nextena, Belenix and SchilliX, or the latest release of Solaris Express.

Technorati Tag(s) : ,

(2006-06-26 09:51:52.0) Permalink

20060609 Friday June 09, 2006

Irish OpenSolaris User Group Meeting

From: Tim Foster 
Subject: [iosug] 2nd Irish OpenSolaris User Group meeting
To: iosug@yahoogroups.com, ug-discuss 

Hi All,

Just to let you know, we're going to be holding our 2nd user group
meeting on June 14th (that's this coming Wednesday!) in the Sun offices
in Dublin.

It's short notice I know, but we felt we had to do something to coincide
with the upcoming 1-year anniversary of OpenSolaris!

There's more details in a blog post at:

http://blogs.sun.com/roller/page/timf?entry=2nd_irish_opensolaris_user_group

At the meeting we're going to try to give you a quick overview of
everything that's been happening with OpenSolaris over the last year
(which may take a while!), and Mike Byrne has agreed to give us a
fly-through of ZFS : sounds interesting!

We'd love you to come along, just let us know in advance, so we can
issue you with a building-pass for the evening. See you there!

cheers,
tim

Technorati Tag(s) : ,

(2006-06-09 08:52:18.0) Permalink

20060607 Wednesday June 07, 2006

iprb updates.....
iprb updates, or scratching an itch. I did a putback for the following last week.

  • 5079410 Iprb: request adding device id 1050 in driver_aliases file
  • 6251566 RFE: add driver alias for pci8086,1059
  • 6261230 iprb: pci8086,1068 is needed in iprb driver_aliases
  • 6330971 Request support for Intel ICH7 network controller
  • 6397979 Iprb: Request support for device pci8086,1069

Expect to see the updates in Solaris Express in a few weeks, and in the snv_42 drop onto opensolaris.org sooner than that. This putback adds out of the box nic support for several common desktops and laptops including the Dell GX170LS, Dimension 9100, 5100n, 5100c, and other Dell machines, IBM ThinkCenter A50p, Toshiba Protege 3500 and several Sony Vaio's (VGN-S72PB, VGN-A580, VGN-TX90S). Other machines using the same chipset(s) will also be picked up.

If you have a known device that is working with the iprb driver and is not supported out of the box, please drop me a line (my blogname at sun.com) and I'll get a bug logged about it and work on getting a fix done (call it scratching the itch part two).

Technorati Tag(s) : ,

(2006-06-07 02:59:08.0) Permalink

20060601 Thursday June 01, 2006

Jumpstart and Zone Creation
One of the many cool features available in Solaris is Zones. As Sean has already blogged automation is the name of the game, and part of this is creating required zones when we jumpstart a machine.

The example here is quite striped down, and creates three very simple zones once a machine is jumpstarted, with very limited configuration - but using zonecfg(1M) and the various resource management utilities you can modify this to suit your needs. This example was tested on the latest Solaris Express.

Anyway, enough talk, you can download the script here, and for your persual...

 

#!/bin/sh
#
# create (very) simple zones after a jumpstart
# 
# this finish script gives an example of how you can create
# some zones post jumpstart. You need to know the name(s) of
# the zones you wish to create, their ip addresses and the 
# network interface you wish to use. It is assumed that netmasks
# have been set up correctly during your install
#
# In the example here we create three zones on a 192.1.1 subnet
# each using bge0 as their interface. 
#
# The script runs as follows
#
#	Section 1 - As a jumpstart finish script
#	-------------------------------------------------
#	1. append details on the zone to your hosts file
#	   where applicable
#	2. create the initial directory for the zone(s)
#	3. create the zonecfg input file
#	4. Create the rc3.d script we will use after reboot
#
#	Section 2 - After initial reboot
#	-------------------------------------------------
#	1. create and install zone(s)
#	2. set zone state to ready
#	3. boot zone
#
#
# Each zone is based on a very simple spare root zone, for further
# details on Zones and the various configuration options consult the
# manpages for zones(5), zoneadm(1M) and zonecfg(1M)
#
# Additional documentation on zones along with tips and articles
# can be found in the Zones section of BigAdmin at
# http://www.sun.com/bigadmin/content/zones/
#
# ZONE_DETAILS - colon seperated listed of zones, containing
#		 zone-name:ip address:interface to use
#

ZONE_DETAILS="test-js-zone-1:192.1.1.1:bge0
test-js-zone-2:192.1.1.2:bge0
test-jes-zone-3:192.1.1.3:bge0"

# ZONE_BASE - root directory for your zones to be created in
#
 
ZONE_BASE="/export/zones"

appendToHostFile() {

	LZONE_NAME=$1
	LZONE_IP=$2

	if [ ! -f $MOUNT_PREFIX/etc/hosts.prezone ]
	then
		cp $MOUNT_PREFIX/etc/hosts $MOUNT_PREFIX/etc/hosts.prezone
	fi

	grep -v $LZONE_NAME $MOUNT_PREFIX/etc/hosts > /tmp/hosts 
	echo "$LZONE_IP	$LZONE_NAME" >> /tmp/hosts
	mv /tmp/hosts $MOUNT_PREFIX/etc/hosts
}

createZoneCfg() {

	LZONE_NAME=$1
	LZONE_IP=$2
	LZONE_INTERFACE=$3

	cat >$MOUNT_PREFIX/$ZONE_BASE/zonecfg/$LZONE_NAME.zcf<<EOF_zonecfg
create -b
set zonepath=$ZONE_BASE/$LZONE_NAME
set autoboot=true
add inherit-pkg-dir
set dir=/lib
end
add inherit-pkg-dir
set dir=/platform
end
add inherit-pkg-dir
set dir=/sbin
end
add inherit-pkg-dir
set dir=/usr
end
add net
set address=$LZONE_IP
set physical=$LZONE_INTERFACE
end
verify
commit
EOF_zonecfg
}

createZoneDirs() {
	
	LZONE_NAME=$1

	if [ ! -d $ZONE_BASE/$LZONE_NAME ]
	then
		mkdir -p $MOUNT_PREFIX/$ZONE_BASE/$LZONE_NAME
		chmod 700 $MOUNT_PREFIX/$ZONE_BASE/$LZONE_NAME
	fi
}

if [ -d /a ]
then
	MOUNT_PREFIX=/a
else
	MOUNT_PREFIX=/
fi

if [ ! -d $MOUNT_PREFIX/$ZONE_BASE/zonecfg ]
then
	mkdir -p $MOUNT_PREFIX/$ZONE_BASE/zonecfg
fi

cat > $MOUNT_PREFIX/etc/rc3.d/S99zonejumpstartexample <<EOF_zonerc
#!/bin/sh

EOF_zonerc

for i in $ZONE_DETAILS
do
	ZONE_NAME=`echo $i | cut -d":" -f1`
	ZONE_IP=`echo $i | cut -d":" -f2`
	ZONE_INTERFACE=`echo $i | cut -d":" -f3`

	createZoneDirs $ZONE_NAME
	createZoneCfg $ZONE_NAME $ZONE_IP $ZONE_INTERFACE
	appendToHostFile $ZONE_NAME $ZONE_IP

cat >> $MOUNT_PREFIX/etc/rc3.d/S99zonejumpstartexample <<EOF_zonerc

/usr/sbin/zonecfg -z $ZONE_NAME -f $ZONE_BASE/zonecfg/$ZONE_NAME.zcf
/usr/sbin/zoneadm -z $ZONE_NAME install
rm -f $ZONE_BASE/$ZONE_NAME/root/etc/.UNCONFIGURED
touch $ZONE_BASE/$ZONE_NAME/root/etc/.NFS4inst_state.domain
/usr/sbin/zoneadm -z $ZONE_NAME ready
/usr/sbin/zoneadm -z $ZONE_NAME boot

EOF_zonerc

done

cat >> $MOUNT_PREFIX/etc/rc3.d/S99zonejumpstartexample <<EOF_zonerc

rm /etc/rc3.d/S99zonejumpstartexample
EOF_zonerc

chmod +x $MOUNT_PREFIX/etc/rc3.d/S99zonejumpstartexample

One caveat, to set the root password do

bash-3.00# zlogin test-js-zone-2
[Connected to zone 'test-js-zone-2' pts/51]
# passwd -r files root
New Password:
Re-enter new Password:
passwd: password successfully changed for root

Technorati Tag(s) : ,

(2006-06-01 06:18:35.0) Permalink