On Feb 19, 2008 2:50 AM, Kamlakar Patil <[EMAIL PROTECTED]> wrote:
> Hi Everyone,
> Is there a way to move application running in global zone to new
> non-global zone?
> Thanks,
> -Kamlakar

It is about the same process as moving an application from one server
to another.  In a typical situation, you have something like:

/opt/myapp - directory where everything is installed
/etc/passwd - one or more accounts related to the app
/etc/shadow - entries to match up with /etc/paswd entries
/etc/init.d/myapp, /etc/rc*.d/[SK]*myapp - legacy start/stop scripts

And it's not installed via pkgadd.

You should be able to...

Shut down the app

mv /opt/myapp /zones/myzone/root/opt
  - Be sure you have enough space
  - Alternatively add an lofs mount to the zone's configuration to
    mount /opt/myapp from the global zone to the non-global zone
      mkdir /zones/myzone/root/opt/myapp
      zonecfg -z myzone
      add fs
        set dir=/opt/myapp
        set special=/opt/myapp
        set type=lofs
        set options=rw

Copy the appropriate entries from passwd and shadow to the same files
in the non-global zone
   - You likely want to get rid of the entries from the global
     zone once you confirm functionality in the non-global zone

Copy any related files from /etc/init.d, /etc/rc*.d to the same
place in the non-global zone.
    - At a minimum, get rid of /etc/rc*.d/S*myapp in the global

Copy any related files from /var/svc/manifest/*/myapp.xml to the same
location in the non-global zone.
    As cleanup in the global zone
       rm /var/svc/manifest/*/myapp.xml
       svccfg delete myapp

If the app knows about the server's hostname or IP address,
reconfigure that in the app.

If other things external to the server know about this application by
hostname or IP address, reconfigure them to point to the non-global

Obviously, the procedure will vary with the circumstances, but these
are the types of things that you need to worry about.

Mike Gerdts
zones-discuss mailing list

Reply via email to