X
  • April 29, 2014

Install a kernel zone in 3 steps

Mike Gerdts
Principal Software Engineer

One of the shiniest new features in Oracle Solaris 11.2 is Kernel Zones.  Kernel Zones provide the familiarity of zones while providing independent kernels.  This means that it's now possible to have zones that run different patch levels, act as CIFS servers, load kernel modules, etc.  So, let's get to installing a kernel zone.

If you have installed any other zone on Solaris before, this will look quite familiar.  After all, it is  just another zone, right?

For this procedure to work, there are some prerequisites that shouldn't be much of a problem in a production environment, but are a bit of a problem if your normal playground is VirtualBox or the 6 year old server you found on the loading dock.

Step 1: Configure

root@vzl-212:~# zonecfg -z myfirstkz create -t SYSsolaris-kz

Step 2: Install

root@vzl-212:~# zoneadm -z myfirstkz install
Progress being logged to /var/log/zones/zoneadm.20140419T032707Z.myfirstkz.install
pkg cache: Using /var/pkg/publisher.
 Install Log: /system/volatile/install.5368/install_log
 AI Manifest: /tmp/zoneadm4798.dAaO7j/devel-ai-manifest.xml
  SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
Installation: Starting ...
        Creating IPS image
        Installing packages from:
            solaris
                origin:  http://ipkg/solaris11/dev/
        The following licenses have been accepted and not displayed.
        Please review the licenses for the following packages post-install:
          consolidation/osnet/osnet-incorporation                    
        Package licenses may be viewed using the command:
          pkg info --license <pkg_fmri>
DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                            549/549   76929/76929  680.9/680.9  8.4M/s
PHASE                                          ITEMS
Installing new actions                   104278/104278
Updating package state database                 Done
Updating package cache                           0/0
Updating image state                            Done
Creating fast lookup database                   Done
Installation: Succeeded
        Done: Installation completed in 438.132 seconds.

Step 3: Celebrate!

At this point the kernel zone is installed and ready for boot. 

root@vzl-212:~# zoneadm -z myfirstkz boot
root@vzl-212:~# zlogin -C myfirstkz
[Connected to zone 'myfirstkz' console]
Loading smf(5) service descriptions: 220/220
...

Because a sysconfig profile was not provided during installation, sysconfig(1M) will ask a few things on first boot.

                           System Configuration Tool
 
     System Configuration Tool enables you to specify the following           
     configuration parameters for your newly-installed Oracle Solaris 11      
     system:
     - system hostname, network, time zone and locale, date and time, user    
       and root accounts, name services, keyboard layout, support
 
     System Configuration Tool produces an SMF profile file in
     /etc/svc/profile/sysconfig/sysconfig-20140419-034040.
 
     How to navigate through this tool:
     - Use the function keys listed at the bottom of each screen to move      
       from screen to screen and to perform other operations.
     - Use the up/down arrow keys to change the selection or to move          
       between input fields.
     - If your keyboard does not have function keys, or they do not           
       respond, press ESC; the legend at the bottom of the screen will        
       change to show the ESC keys for navigation and other functions.        
 
 
 
  F2_Continue  F6_Help  F9_Quit

If you've read this far into this entry, you know how to take it from here.

Join the discussion

Comments ( 4 )
  • guest Tuesday, May 6, 2014

    I'm getting errors. The zone installs fine, on boot however :

    -bash-4.1# zoneadm -z test-kz boot

    zone 'test-kz': error: boot failed

    zone 'test-kz': error: Failed to create VM: Not enough space

    zone 'test-kz': error: allocation of guest RAM failed

    zoneadm: zone test-kz: call to zoneadmd(1M) failed: zoneadmd(1M) returned an error 1 (unspecified error)

    I wonder if I need a bigger swap volume?


  • Mike Gerdts Tuesday, May 6, 2014

    guest,

    The error you are seeing is most likely because the ZFS ARC (cache) has consumed too much of the system's memory. Unfortunately, ZFS does not get out of the way quickly enough when there is memory pressure leading to a failed memory allocation.

    In the third paragraph of my post, I linked to some prerequisites. One of those was to limit the ARC. On my laptop, I do this with the following entry in /etc/system:

    * Limit the ARC to 1 GB

    set zfs:zfs_arc_max=0x40000000


  • guest Friday, May 9, 2014

    Thanks Mike..

    That was indeed the cause of the problem. I should have read the pre-requisites you linked to in your link..


  • guest Wednesday, October 26, 2016

    After you install a full kernel zone, are you not supposed to be able to see the actual OS files from the physical global? I installed one and it installed fine. I can see when I log into the zone, it is on a 16GB filesystem like it's supposed to be and all is running fine. When I look in the normal place we keep zones on the physicals and I don't see the files even though I know they're on that LUN somewhere. I see that it has used the space on the LUN. Is this supposed to be this way?

    Thanks!

    David


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services