Virtual Guru's Blog – Home of Virtualization Workshops

May 19, 2008

Will OpenSolaris 2008.05 instance survive reboot after update ?

Filed under: amazon_aws, cloud, opensolaris, Virtualization — natiku @ 7:55 am

New OpenSolaris 2008.05 utilize ZFS root and use ZFS clones for system updates with IPS net based repository, it’s counts on ability of reboot OS instance into new environment.

This entry is part of ‘OpenSolaris on Amazon EC2’ Workshop

Will OpenSolaris 2008.05 OS survive reboot after update ? Yes !!!


Select OpenSolaris 2008.05 JeOS

ec2-describe-images | grep JeOS
IMAGE   ami-7bXXac12    sun-osol/2008.05_JeOS_32_1.0.img.manifest.xml   327216928991  available private  i386    machine

Start instance JeOS

c2-run-instances -k my-keypair ami-7b49ac12
RESERVATION     r-ad3ffbc4      327216928991    default
INSTANCE        i-09468860      ami-7bXXac12                    pending my-keypair   0
m1.small        2008-05-19T13:25:10+0000                        aki-7846a311    ari-7d46a314

Check if instance is already running

ec2-describe-instances i-09468860
RESERVATION     r-ad3ffbc4      327216928991    default
INSTANCE        i-09468860      ami-7bXXac12    ec2-67-202-62-253.compute-1.amazonaws.com       ip-10-251-121-157.ec2.internal
running my-keypair   0               m1.small        2008-05-19T13:25:10+0000          aki-7846a311    ari-7d46a314

Connect to instance

ssh -i id_rsa-my-keypair root@ec2-67-202-62-253.compute-1.amazonaws.com

Update instance

 pkg refresh
pkg image-update
PHASE                                        ACTIONS
Update Phase                                   16/16
A clone of opensolaris exists and has been updated and activated. On next boot the Boot Environment opensolaris-1 will be mounted on '/'.
Reboot when ready to switch to this updated BE.
init 6; exit
zfs list
NAME                                                        USED  AVAIL  REFER  MOUNTPOINT
rpool                                                       998M  7.64G  56.5K  /rpool
rpool/ROOT                                                  997M  7.64G    18K  /rpool/ROOT
rpool/ROOT/opensolaris                                      230K  7.64G   804M  legacy
rpool/ROOT/opensolaris-1                                    997M  7.64G   804M  legacy
rpool/ROOT/opensolaris-1@static:-:2008-05-19-13:40:15       166M      -   804M  -
rpool/ROOT/opensolaris-1/opt                               26.7M  7.64G  26.7M  /opt
rpool/ROOT/opensolaris-1/opt@static:-:2008-05-19-13:40:15      0      -  26.7M  -
rpool/ROOT/opensolaris/opt                                     0  7.64G  26.7M  /opt
rpool/export                                                 37K  7.64G    19K  /export
rpool/export/home                                            18K  7.64G    18K  /export/home
zpool                                                      16.0G   131G    18K  /zpool
zpool/mnt                                                    18K   131G    18K  /mnt

Re-login to rebooted instance

ssh -i id_rsa-my-keypair root@ec2-67-202-62-253.compute-1.amazonaws.com

Nice, it’s working, here is updated rebooted environment:

zfs list
NAME                                                        USED  AVAIL  REFER  MOUNTPOINT
rpool                                                      1.14G  7.47G  56.5K  /rpool
rpool/ROOT                                                 1.14G  7.47G    18K  /rpool/ROOT
rpool/ROOT/opensolaris                                      174M  7.47G   804M  legacy
rpool/ROOT/opensolaris-1                                    997M  7.47G   804M  legacy
rpool/ROOT/opensolaris-1@static:-:2008-05-19-13:40:15       166M      -   804M  -
rpool/ROOT/opensolaris-1/opt                               26.7M  7.47G  26.7M  /opt
rpool/ROOT/opensolaris-1/opt@static:-:2008-05-19-13:40:15      0      -  26.7M  -
rpool/ROOT/opensolaris/opt                                 42.5K  7.47G  26.7M  /opt
rpool/export                                                 37K  7.47G    19K  /export
rpool/export/home                                            18K  7.47G    18K  /export/home
zpool                                                      16.0G   131G    18K  /zpool
zpool/mnt                                                    18K   131G    18K  /mnt

Uptime was more then 14000 days, this is due date start from 1.1.1970 issues 🙂

Will OpenSolaris 2008.05 data disks survive reboot after update ? No ?! Fixed !!!

However data on pool zpool which was located on ephemeral store was lost on reboot, new pool zpool was created !?!

Uaaaa !!!, pool zpool was not automatically activated after reboot because we lost new zfs cache file by booting old ramdisk image !!!

Need to add forcing of pool zpool import to ec2ifyme_mount script before attempt to create it as following:

/usr/sbin/zpool import zpool

Hmm, also boot archive is always rebuild on shutdown because we change zfs cache file ?!

updating /platform/i86pc/boot_archive
updating /platform/i86pc/amd64/boot_archive

Lesson Learned: I need to use static ramdisk image in development, not booting xVM VM with pyGRUB !!!

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: