Creating and Using Oracle Solaris 10 Zones

Exit Print View

Updated: September 2014
 
 

How to Configure a Shared-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 a shared-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.
    zonecfg:s10-zone> create -b
    set brand=solaris10

    Note -  Do not use create -t SYSsolaris10-shared-ip to set the IP type.
  4. Set the zone path, /zones/s10-zone in this procedure.
    zonecfg:s10-zone> set zonepath=/zones/s10-zone
  5. Set the autoboot value.

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

    zonecfg:s10-zone> set autoboot=true
  6. Create a shared-IP zone with a network virtual interface.
    zonecfg:my-zone> set ip-type=shared
    zonecfg:my-zone> add net
    1. Set the physical device type for the network interface, the net device in this procedure.
      zonecfg:my-zone:net> Set physical=net0
    2. Set the IP address, 10.6.10.233/24 in this procedure.
      zonecfg:my-zone:net> Set address=10.6.10.233/24
    3. End the specification.
      zonecfg:my-zone:net> end

    This step can be performed more than once to add more than one network interface.

  7. 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 be mounted 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.

  8. 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
  9. Set the hostid to be the hostid of the source system.
    zonecfg:my-zone> set hostid=80f0c086
  10. Verify the zone configuration for the zone.
    zonecfg:s10-zone> verify
  11. Commit the zone configuration for the zone.
    zonecfg:s10-zone> commit
  12. 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.

  13. Use the info subcommand to verify that the brand is set to solaris10.
    global# zonecfg -z s10-zone info
  14. (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 .