Creating and Using Oracle Solaris 10 Zones

Exit Print View

Updated: September 2014
 
 

How to Configure an Exclusive-IP solaris10 Branded Zone

You must be the global administrator or a user with the appropriate authorizations in the global zone to perform this procedure.

  1. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  2. Create an exclusive-IP solaris10 zone with the zone name s10-zone.
    global# zonecfg -z s10-zone

    If this is the first time you have configured this zone, you will see the following system message:

    s10-zone: No such zone configured
    Use 'create' to begin configuring a new zone.
  3. Create the new solaris10 zone configuration by using the SYSsolaris10 template.
    zonecfg:s10-zone> create -t SYSsolaris10

    The SYSsolaris10 profile creates an exclusive-IP zone that includes an automatic anet resource by default.

  4. Set the zone path, /zones/s10-zone in this procedure.
    zonecfg:s10-zone> set zonepath=/zones/s10-zone
  5. Set the autoboot value.
    zonecfg:s10-zone> set autoboot=true

    If set to true, the zone is automatically booted when the global zone is booted. The default value is false. Note that for the zones to autoboot, the zones service svc:/system/zones:default must also be enabled. You can enable the zones service with the svcadm command.

  6. Add a ZFS file system shared with the global zone.
    zonecfg:s10-zone> add fs
    1. Set the type to zfs.
      zonecfg:s10-zone:fs> set type=zfs
    2. Set the directory to mount from the global zone.
      zonecfg:s10-zone:fs> set special=share/zone/s10-zone
    3. Specify the mount point.
      zonecfg:s10-zone:fs> set dir=/opt/shared
    4. End the specification.
      zonecfg:s10-zone:fs> end

    This step can be performed more than once to add more than one file system.

  7. Delegate a ZFS dataset named sales in the storage pool tank.
    zonecfg:my-zone> add dataset
    1. Specify the path to the ZFS dataset sales.
      zonecfg:my-zone> set name=tank/sales
    2. End the dataset specification.
      zonecfg:my-zone> end
  8. Set the hostid to be the hostid of the source system.
    zonecfg:my-zone> set hostid=80f0c086
  9. Verify the zone configuration for the zone.
    zonecfg:s10-zone> verify
  10. Commit the zone configuration for the zone.
    zonecfg:s10-zone> commit
  11. Exit the zonecfg command.
    zonecfg:s10-zone> exit

    Note that even if you did not explicitly type commit at the prompt, a commit is automatically attempted when you type exit or an EOF occurs.

  12. Use the info subcommand to verify that the brand is set to solaris10.
    global# zonecfg -z s10-zone info
  13. (Optional) Use the info subcommand to check the hostid:
    global# zonecfg -z s10-zone info hostid

Next Steps


Tip  - After you have configured the zone, it is a good idea to make a copy of the zone's configuration. You can use this backup to recreate the zone in the future. As root or an administrator with the correct profile, print the configuration for the zone s10-zone to a file. This example uses a file named s10-zone.config.
global# zonecfg -z s10-zone export > s10-zone.config

See also

For additional components that can be configured using zonecfg, see Chapter 2, Non-Global Zone Configuration Overview, in Introduction to Oracle Solaris Zones . This guide also provides information on using the zonecfg command in either command-line or command-file mode. Note that for shared-IP zones, a static address must be assigned in a zonecfg net resource. For more information about adding ZFS file systems, see Adding ZFS File Systems to a Non-Global Zone in Managing ZFS File Systems in Oracle Solaris 11.2 .