×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    Zones will appear as a separate server when you log into them in most respects but there are a few things to be aware of.

    Obviously no hardware stuff can be done in a non-global zone.

    Config files can be found in /etc/zones and are fairly easy to navigate (they are in xml though). They should not be edited manually.

    The All Important Commands[edit]

    There are three main commands pertaining to zones which can be used to administer and access non-global zones (despite sshing from the outside).

    • zonecfg - used to configure zones, this command can be used interactively configure zones
    • zoneadm - this command is likely to be the most used command. It can be used to boot and check the status of zones. Below are a few useful examples:-
    zoneadm -z myzone boot
    

    (boots the specified zone)

    zoneadm -z myzone halt
    

    (halts the specified zone)

    zoneadm -z myzone reboot
    

    (any guesses?)

    zoneadm list -cv
    

    (shows a list of installed zones and the status of them)

    • zlogin - this command will enable you to login into the specified zone. This command can be particularly useful if you require console access:-
    zlogin -C myzone
    

    (will give you console access)

    Zoneified Commands[edit]

    Some commands have been zoneified to allow for new functionality:-

    • ps - has a -z option now which should show which zone the process is running in.

    Patching/Packages Zones[edit]

    As the standard CW build will use the sparse-root model (/usr/ and/sbin mounted read only from the global zone), this impacts patches and packages. If these filesystems are affected by the patch/package, then they will have to be installed from the global zone and will apply to all zones.

    Installing Packages[edit]

    If a patch is to be installed, it will by default be installed in all zones (even if they aren't

    Stopping a zone autobooting[edit]

    Do:-

    zonecfg -z z1
    set autoboot=false
    info
    commit
    exit
    

    Info will confirm the current state of autoboot.

    Changing a zones IP address[edit]

    zonecfg -z zonename
    select net address=x.x.x.x   (where x.x.x.x is the current address)
    set address=y.y.y.y  (where y.y.y.y is the new address)
    end
    verify
    commit
    exit 
    


    Mouinting a disk in a zone[edit]

    you can mount a drive directly into a "live" zone

    # mount /dev/md/dsk/d12 /zones/z1/root/mnt/tmp
    

    To make this permanent you have to edit the "zone config"

    zonecfg -z testzone
    zonecfg:testzone> add fs
    zonecfg:testzone:fs> set dir=/mnt/tmp
    zonecfg:testzone:fs> set special=/dev/md/dsk/d12
    zonecfg:testzone:fs> set raw=/dev/md/rdsk/d12
    zonecfg:testzone:fs> set type=ufs
    zonecfg:testzone:fs> end
    zonecfg:testzone> verify
    zonecfg:testzone> commit   # omit this line if you do not want to apply right away
    zonecfg:testzone> exit
    


    See also[edit]

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.