Jim's Blog

pageicon Tuesday Jan 15, 2008

Live Upgrade

My experience with live upgrade....

First, my system.

X86 laptop.  One hard drive.  Initial install.

c0d0s0 - /  (15G)
c0d0s1 - swap  (2G)
c0d0s3 - /extra  (15G and not mounted - set aside during initial install for the live upgrade copy of /)
c0d0s7 - zfs filesystem and given the rest of the disk space.

Two zones - stemplate & dir6.  Both are sparse zones.  This caused problems?  I had this in my output from Step Two orginally

WARNING: The file </tmp/lucopy.errors.4697> contains a list of <3>
potential problems (issues) that were encountered while populating boot
environment <b80>.
INFORMATION: You must review the issues listed in
</tmp/lucopy.errors.4697> and determine if any must be resolved. In
general, you can ignore warnings about files that were skipped because
they did not exist or could not be opened. You cannot ignore errors such
as directories or files that could not be created, or file systems running
out of disk space. You must manually resolve any such problems before you
activate boot environment <b80>.

That file said....

cpio: Error during chown() of "/.alt.tmp.b-clb.mnt/dev/zcons/stemplate/masterconsole", errno 22, Invalid argument
cpio: Error during chown() of "/.alt.tmp.b-clb.mnt/dev/zcons/dir62/masterconsole", errno 22, Invalid argument
cpio: Error during chown() of "/.alt.tmp.b-clb.mnt/dev/zcons/dir62/zoneconsole", errno 22, Invalid argument

I'm willing to wager that it is fixable.  However, these zones weren't that important at this time.  So, to walk through the live upgrade, I uninstalled and deleted these zones.
 

Currently, / has Open Solaris, b78.  The plan is to live upgrade to b80 onto c0d0s3.

Step One.  lustatus reports that no live upgrade environment has been established.
Step Two.  The initial live upgrade environment

# lucreate -n b80 -m /:/dev/dsk/c0d0s3:ufs
Discovering physical storage devices
Discovering logical storage devices
Cross referencing storage devices with boot environment configurations
Determining types of file systems supported
Validating file system requests
Preparing logical storage devices
Preparing physical storage devices
Configuring physical storage devices
Configuring logical storage devices
Analyzing system configuration.
Comparing source boot environment <c0d0s0> file systems with the file
system(s) you specified for the new boot environment. Determining which
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
Searching /dev for possible boot environment filesystem devices                          
Updating system configuration files.
The device </dev/dsk/c0d0s3> is not a root device for any boot environment; cannot get BE ID.
Creating configuration for boot environment <b80>.
Source boot environment is <c0d0s0>.
Creating boot environment <b80>.
Checking for GRUB menu on boot environment <b80>.
The boot environment <b80> does not contain the GRUB menu.
Creating file systems on boot environment <b80>.
Creating <ufs> file system for </> in zone <global> on </dev/dsk/c0d0s3>.
Mounting file systems for boot environment <b80>.
Calculating required sizes of file systems for boot environment <b80>.
Populating file systems on boot environment <b80>.
Checking selection integrity.
Integrity check OK.
Populating contents of mount point </>.
Copying.
Creating shared file system mount points.
Copying root of zone <dir62>.
Copying root of zone <stemplate>.
Creating compare databases for boot environment <b80>.
Creating compare database for file system </>.

Updating compare databases on boot environment <b80>.
Making boot environment <b80> bootable.
Updating bootenv.rc on ABE <b80>.
Population of boot environment <b80> successful.
Creation of boot environment <b80> successful.

 Now for the upgrade...  I have it in 6 cd iso images.  A little easier with one dvd image.  However, I learned a little more about live upgrade in doing it this way :)

 First, mounting an iso image...
# lofiadm -a /<path_to_iso>/solaris_1.iso /dev/lofi/1
# mount -f hsfs /dev/lofi/1 /mnt
# luupgrade -u -n b80 /mnt
# umount /mnt
# lofiadm -d /dev/lofi/1
 

Now, if this was a dvd image, you could skip over the rest of the cd images to install, however....

# lofiadm -a /<path_to_iso>/solaris_2.iso /dev/lofi/1
# mount -f hsfs /dev/lofi/1 /mnt
# luupgrade -i -n b80 /mnt    (selecting the typical install is just fine!)
# umount /mnt
# lofiadm -d /dev/lofi/1
 

Do like wise for images 3,4,5 & 6.

Okay, onto finishing up and booting into build 80.

Activate the new image -
# luactivate b80

Reboot, but with init 6!
# init 6

Inspect your work -

#  lustatus  

 Boot Environment
 Is ActiveActive  Can Copy
 Name Complete Now Reboot Delete Status
 c0d0s0 yes no no yes -
 b80 yes yes yes no -

pageicon Thursday Dec 06, 2007

Yahoo Toolbar Support for Solaris? Google Toolbar Support for Solaris!

What has happened to toolbar support for Solaris???  With Solaris and firefox.  Go to http://toolbar.yahoo.com/  No support for your operating system.  Why?  Its a add on to firefox!

Same for google's toolbar.   

 

What is up with this???

 At this rate, I should just use live.com, windows and surrender.  So much for yahoo and google offering something special.  Yes, as you can tell, this urks me.

While I'm ranting.  What is up with Yahoo and supporting windows for Yahoo Music?  How lame is that.

 

Have a nice day!

pageicon Saturday Oct 27, 2007

Intalling Sun Directory 6.2 by hand.

I followed the following steps on installing Sun Directory Server 6.2 on Solaris 10 08/07 in a container that lives on a zfs.  Click here to see how I set up zones on zfs.  I did take advantage of having snapshots during this install.  To err is easy with zfs :)

First - Install Sun Application Server 9.1.  Accept most defaults except for selecting for 80 over 8080 and 443 over 8181.

Second, I setup Applicaiton Server 9.1 to start at boot the old fashion way.

# cd /etc/init.d
# cp nfs.server appserver9.1
Update it to look like.... (Left as an exercise, add a restart option)
#!/sbin/sh
#
case "$1" in
'start')
        /opt/SUNWappserver/bin/asadmin start-domain --user=admin --passwordfile=/opt/SUNWappserver/.key
        ;;

'stop')
        /opt/SUNWappserver/bin/asadmin stop-domain
        ;;

*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;
esac

# cd /etc/rc0.d
# ln /etc/init.d/appserver9.1 K99appserver9.1
# cd /etc/rc3.d
# ln /etc/init.d/appserver9.1 S99appserver9.1

Be sure to create a /opt/SUNWappserver/.key that looks like...
AS_ADMIN_PASSWORD=password
AS_ADMIN_MASTERPASSWORD=password

Now, you can start the application server...
# /etc/init.d/appserver9.1 start

It is at this point, I shutdown this zone, create a zfs snapshot of the filesystem so I can rollback to a clean zone with just application server installed.

 

Deploy directory 6.2...
# cd <where you unziped the bits>/DSEE_ZIP_Distribution
If you followed my previous blog about creating the repository of software....
# cd /share/software/dir62/DSEE_ZIP_Distribution

./dsee_deploy install -i /opt/ds62 -I -N

You will see lots of output.....

Now, setup cacao for dscc. 

vi /opt/ds62/dsee6/cacao_2/etc/cacao/instances/default/private/cacao.properties

Default cacao using 111XX port numbers.  I change them to 211XX.

Then run...

/opt/ds62/dsee6/cacao_2/usr/sbin/cacaoadm enable

/opt/ds62/dsee6/cacao_2/usr/sbin/cacaoadm start


Deploy /opt/ds62/var/dscc6/dscc.war to your application server.

Add this to /opt/SUNWappserver/domains/domain1/config/server.policy
// Permissions for Directory Service Control Center
grant codeBase "file:${com.sun.aas.instanceRoot}/applications/j2ee-modules/dscc/-"
{
        permission java.security.AllPermission;
};


/opt/ds62/dscc6/bin/dsccsetup initialize
***
DSCC Application cannot be registered because it is not installed
***
DSCC Agent is already registered
***
Choose password for Directory Service Manager:  <password>
Confirm password for Directory Service Manager:  <password>
Creating DSCC registry...
DSCC Registry has been created successfully
***


http://<host>/dscc

And you are own your way to creating a new directory server and more...
To setup auto start at boot...
# cd /etc/init.d
# cp nfs.server dir62
# vi dir62   (This just start the dscc at boot - You'll add similiar entries for other directory servers you create)
# cat dir62
#!/sbin/sh
#
case "$1" in
'start')
        /opt/ds62/var/dscc6/dcc/ads/start-slapd
        ;;

'stop')
        /opt/ds62/var/dscc6/dcc/ads/stop-slapd
        ;;
'restart')
        /opt/ds62/var/dscc6/dcc/ads/restart-slapd
        ;;
*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;
esac
# cd /etc/rc0.d
# ln /etc/init.d/dir62 K99ds62
# cd /etc/rc3.d
# ln /etc/init.d/dir62 S99ds62

Now is a good time to take a zfs snapshot of the zone to rollback to a clean directory with just dscc running.
 

pageicon Friday Oct 19, 2007

ZFS Zones Clones and Snapshot

Ever needed multiple copies of the same base zone configuration?  Here is my adventure in creating a sparse root template zone and its cloning.  (The same can be applied to full root zones by adding the option -b to the zonecfg create - "create -b")  In this example, I'm using Solaris 10 08/07.  In the latest Nevada builds, zoneadm is zfs aware and some of the noted steps below aren't needed. 

First, create a zfs filesystem for the zones to live in.  On my laptop, I created a 8G file /export/zpool with the command mkfile.  This isn't best practice for production, but on a laptop and playing around....
# mkfile 8G /export/zpool.

Then proceed to make a zpool called "z".
# zpool create z /export/zpool

# zpool list
 
 NAMESIZE
USED
AVAIL
CAP 
HEALTH
ALTROOT
z
7.94G
2.52G
5.41G
31%
ONLINE
-




Next I create my first zfs filesystem /z/share.  The use is explained in the next section....

# zfs create z/share
 

Second, I create a file called sparsetemplate that looks like this...

# cat sparsetemplate
create
set zonepath=/z/sparsetemplate
set autoboot=false
add net
        set address=192.168.123.80
        set physical=e1000g0
end
add fs
        set dir=/share
        set special=/z/share
        set type=lofs
        add options [ro,nodevices]
end

The added filesystem noted by "add fs" is a filesystem that shows up in the zone as /share that is mounted from the global zone /z/share.  I place software and files that I shared between my zones here.  That way, I don't copy files into each zone.  I mount it read only so I maintain control of its contents globally, so if I give a zone over to a developer, they can't muck with it :)

Now, in Solaris 10 08/07 I need to create the zfs filesystem.  In the latest Nevada builds, zoneadm does the next 2 steps for you!!!  Hopefully, that feature will find its way to the next build of Solaris 10.  

# zfs create z/sparsetemplate

# chmod 700 /z/sparsetemplate 

# zonecfg -z sparsetemplate -f sparsetemplate

# zoneadm -z sparsetemplate install

# zoneadm -z sparsetemplate boot

# zlogin -C sparsetemplate

From here, you will need to select the appropriate options for your environment.  Can we use jumpstart at this point?  Or JET?  That would be nice.  Something to investigate or maybe you can leave a comment. 

Once this complete, I will login to sparsetemplate (zlogin sparsetemplate) and make changes in the way I like a clean system to look.  That is, I allow root to ssh in.  Also, change root's shell to bash and disable sendmail.  This way, when I clone sparsetemplate, the newly create zone will already have these items altered.  

Third, once I complete altering my sparsetemplate zone with all the changes, I will halt the zone and then take a zfs snapshot of its zfs filesystem.

# zfs snapshot z/sparsetemplate@cstate      (cstate meaning clean state)

# zfs list

 NAMEUSED
AVAIL
REFER
MOUNTPOINT
 z2.52G
5.29G
29.5K
/z
z/share
24.5K
5.29G
24.5K
/z/share
z/sparsetemplate
76.4M
5.29G
76.0M
/z/sparsetemplate
z/sparsetemplate@cstate414K-
76.0M-
 

Forth, I will do the same, if need be and create a full root template.  Same steps. 

Fifth, Now onto creating a spare zone I will use.  If you install dir 6.2 by hand (verses using JES 5.1 installer), it will install in a sparse zone.  This is also true of Sun Application server 9.1.  Yea!  Since I do a lot with directory, I will use that as my example.

# cp sparsetemplate dir62

Update dir62 file with its zonepath /z/dir62 and its own IP. 

In the latest versions of Nevada, the next steps are NOT needed!!!! 

# zfs create z/dir62

# chmod 700 /z/dir62

# zonecfg -z dir62 -f dir62

# zoneadm -z dir62 clone sparsetemplate

# zoneadm -z dir62 boot

# zlogin -C dir62

Select the appropriate options for your environment.  Now, dir62 zone will have the root shell as bash, ssh turned on for root and sendmail not running.  Plus, creating dir62 is measured in seconds! 

 Fifth, Create a zfs snapshot of the dir62.

# zfs snapshot z/dir62@cstate     (as in clean state)

Sixth, now on with dir 6.2 install and creating a snapshot of the zfs filesystem once it is installed. 

# zfs snapshot z/dir62@cstate.dir62 

The bonus is when I mess up dir 6.2 or just want to roll back to a clean install, I simply issue a rollback and I have a clean directory!

# zfs rollback z/dir62@cstate.dir62     (the zone is halted prior to this step)

 

Taking a look at my zfs listing you will notice the snap shots of dir62.  You will notice that I took at snapshot of z/dir62@cstate.app91 prior to installing dir62.  Application server is needed (if you don't want to use Solaris' web console) for the dscc and this was very useful once I started installing the directory bits by hand since I needed to do it a few times.

# zfs list

 NAMEUSED
AVAIL
REFER
MOUNPOINT
 z 4.21G3.60G31.5K /z
 z/dir62804M
3.60G
779M
/z/dir62
z/dir62@cstate
 3.03M - 78.9M-
 z/dir62@cstate.app91 19.1M-
 470M-
 z/dir62@cstate.app91.dir62dscc 0-
 779M-
 z/share911M 3.60G 911M /z/share
z/sparsetemplate 79.7M 3.60G 76.2M /z/sparsetemplate
 z/sparsetemplate@cstate 
 3.48M-
 76.0M-


« October 2009
SunMonTueWedThuFriSat
    
1
2
3
4
5
6
7
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

Feeds

Search this blog

Links

Weblog menu

Today's referrers

Today's Page Hits: 23