Knowledgebase : Operating System > Solaris

Step 1: Create a Dedicated Oracle Solaris ZFS File System

First, you create a dedicated ZFS file system for your repository on your Oracle Solaris 11 system. This allows you to use ZFS technologies, such as clones and snapshots, to easily manage your data.

We'll assume that you already have the zpool rpool created on your system, and that this file system will be mounted as /export/s11ReleaseRepo.

# zfs create rpool/export/s11ReleaseRepo

Step 2: Create the Oracle Solaris 11 Release Repository

Next, we use pkgrepo(1) to create a repository in the location you created in Step 1. This creates the necessary initial structure of the repository that we will populate in the next step.

# pkgrepo create /export/s11ReleaseRepo

Step 3: Populate the Oracle Solaris 11 Release Repository

We now populate this repository with the contents of the official Oracle Solaris 11 release repository. For this we use pkgrecv(1) and instruct it to pull the latest versions of all packages from the Oracle package repository to our local repository.

# pkgrecv -s http://pkg.oracle.com/solaris/release/ -d /export/s11ReleaseRepo '*'

If you do not have network access to the Oracle package repository, you can use the Oracle Solaris 11 repository ISO image, as detailed in Copying a  Repository From a File.


Step 4: Snapshot the Oracle Solaris 11 Release Repository

ZFS allows you to create snapshots of file systems, which makes it very easy to roll back a file system at a later date, if needed, or to copy a file system quickly. For convenience, we will create a snapshot of our repository now using the zfs snapshot command.

# zfs snapshot rpool/export/s11ReleaseRepo@initial

Step 5: Start the Package Repository SMF Service

Repositories are managed in Oracle Solaris 11 by the pkg.depotd daemon. You can configure and start instances of this daemon using the Oracle Solaris Service Management Facility (SMF).

Listing 1 shows an example of how to configure our Release repository service. We have chosen to run the daemon on port 10081.

#  svccfg -s pkg/server add s11ReleaseRepo 
#  svccfg -s pkg/server:s11ReleaseRepo setprop pkg/port=10081 
#  svccfg -s pkg/server:s11ReleaseRepo setprop pkg/inst_root=/export/S11ReleaseRepo 
#  svccfg -s pkg/server:s11ReleaseRepo setprop pkg/readonly=true 
#  svccfg -s pkg/server:s11ReleaseRepo setprop pkg/proxy_base = astring: http://pkg.example.com/s11ReleaseRepo 
#  svccfg -s pkg/server:s11ReleaseRepo setprop pkg/threads = 200 
#  svcadm refresh application/pkg/server:S11ReleaseRepo 
#  svcadm enable application/pkg/server:S11ReleaseRepo

Listing 1. Configuring the Release Repository Service

You can also make SMF configuration changes using the svccfg interactive interface.

The pkg/proxy_base configuration property is an optional property that can be used if you plan to access your package repository via Apache. This allows you to use, for example, a URL of http://pkg.example.com/s11ReleaseRepo, rather than http://pkg.example.com:10081. Setting up the repository in this way is advantageous because the repository will work through HTTP proxy servers and end users can use a descriptive URL rather a port number.


Step 6: (Optional) Configuring the Apache HTTP Server

If you choose to use an Apache HTTP server so that the package repositories can be accessed via HTTP (or HTTPS) rather than directly through the file system, you now must configure the server to map our URL (http://pkg.example.com/s11ReleaseRepo) to the port where the pkg.depotd is running (http://pkg.example.com:10081). To do this, you need to add the following to your httpd.conf file: ProxyPass /s11ReleaseRepo http://pkg.example.com:10081 nocanon max=200

To activate this change, you need to do one of the following:

  • If Apache was previously running, restart the Apache service: # svcadm restart svc:/network/http:apache24
  • If Apache was not previously running, you need to enable it: # svcadm enable svc:/network/http:apache24

Now that we have now created a copy of the Oracle Solaris 11 Release repository, clients can install software directly from http://pkg.example.com/s11ReleaseRepo rather than needing external network access to http://pkg.oracle.com/solaris/release/.

Creating the Support and Development Repositories

Next, we will look at creating the local Support and Development repositories. The Support repository will be used to roll out changes that you have tested across your organization, and the Development repository will be used to mirror the latest Support Repository Update (SRU) changes from Oracle.

Step 1: Cloning the Release Repository

Initially, the Support and Development repositories will be the same as the Release repository you just created. We can use zfs clone to create copies of the repository file systems rather than needing to use pkgrecv to pull the content over the network again from Oracle.

# zfs clone rpool/export/s11ReleaseRepo@initial rpool/export/s11SupportRepo 
# zfs clone rpool/export/s11ReleaseRepo@initial rpool/export/s11DevelopmentRepo

Again, we will make a ZFS snapshot of these repositories for future use. It is recommended that ZFS snapshots be taken anytime new content is added to a repository to provide a convenient way to roll back to an earlier snapshot if necessary.

# zfs snapshot rpool/export/s11DevelopmentRepo@initial 
# zfs snapshot rpool/export/s11SupportRepo@initial

Step 2: Repeat the Repository Configuration

The next step is to repeat the repository configuration detailed in Step 5 and Step 6 when we set up the Release repository.

Caution : Pay careful attention to changing the repository name, path, Apache proxy base, and port number during configuration.


Populating the Development Repository

Every month or so, Oracle issues new updates to the Oracle Solaris 11 Support Repository. This repository is available only to customers with a support contract, and a support contract is required to obtain the updates.

We will use the Development repository to populate the latest changes from Oracle, either directly from the Oracle repository itself or through incremental SRU ISO images.

Using the Oracle Solaris 11 Support Repository

Obtain your SSL key and certificates from here. You will need your My Oracle Support login to download the key and certificate pair. Once they have been downloaded, you can use pkgrecv again to update the contents of the Development repository.

# pkgrecv -s https://pkg.oracle.com/solaris/support \
       -d /export/s11DevelopmentRepo \
       --key /path/to/ssl_key --cert /path/to/ssl_cert solaris '*'

Remember that since we made a change to the repository, it is always a good idea to create a ZFS snapshot for our current position. The snapshot names should be meaningful, such as @sru34-2018-07-01.

# zfs snapshot rpool/export/s11Development@sru34-2018-07-01

If you choose to manage your repository using pkg.depod (instead of using a file-based repository), you must restart the appropriate SMF service.

# svcadm restart pkg/server:s11DevelopmentRepo

Using the Oracle Solaris 11 Incremental SRU ISO Images

Alternatively, you can update your repository from the ISO images, which you can download from My Oracle Support (login required).

First, we mount the ISO image as a file system on the server:

# mount -F hsfs full_path_to/sol-11-1111-sruN-bldnum-incr-repo.iso /mnt

Once we have mounted the ISO image, we can use pkgrecv to copy the updates from one file system repository to another. There is no need to specify an SSL key and certificate when using the ISO image.

# pkgrecv -s /mnt/repo -d file:///export/s11DevelopmentRepo '*'

Next, we need to rebuild the search index for the repository to reflect the latest updates:

# pkgrepo rebuild -s /export/s11DevelopmentRepo

And, once again, we need to create a ZFS snapshot for our current position and start the SMF service, if necessary:

# zfs snapshot rpool/export/s11DevelopmentRepo@sru34-2018-07-01 
#  svcadm restart pkg/server:s11DevelopmentRepo

Populating the Internal Support Repository from the Development Repository

After performing the necessary testing on your Development repository, it is time to roll out the changes to your Support repository so users can obtain the updates. We can make these changes using the pkgrecv command as follows:

# pkgrecv -s /export/s11DevelopmentRepo -d file:///export/s11SupportRepo '*'

Then we need to rebuild the search indexes for the repository, take a ZFS snapshot, and restart the appropriate SMF service:

# pkgrepo rebuild -s /export/s11SupportRepo 
#  zfs snapshot rpool/export/s11SupportRepo@sru34-2018-07-08 
#  svcadm restart pkg/server:s11SupportRepo

Rolling Back to Previous Repository Snapshots

Occasionally, you might encounter a problem, which means that you cannot install a particular SRU in your environment. In this case, you will need to roll back your repository to a previous snapshot. This is easily accomplished using the ZFS rollback mechanism (the zfs rollback command) and then restarting the SMF service:

# zfs rollback -r rpool/export/S11Development@SRU33-2018-06-15
# svcadm restart pkg/server:s11SupportRepo

Note : Ideally, you will not roll back changes on a repository from which systems have installed packages, because that might lead to dependency resolution problems during a system update. If dependency resolution problems occur, you will need to revert to a previous boot environment on any affected systems.

Configuring IP interfaces enables a system to connect to the network. The procedure essentially involves assigning IP addresses to the interfaces.

When you assign an IP address to an IP interface, a corresponding address object is created to represent that address.

The address object uses the format interface/address-family, where address-family is either v4 or v6. For example, net0 with an IPv4 address would have the address object net0/v4. Multiple address objects of the same IP interface are distinguished by a letter suffix, such as net0/v4a, net0/v4b, net0/v4c, and so on.

Similarly, an IP interface with IPv6 addresses would have address objects such as net1/v6a, net1/v6b, and so on.

Any subsequent command on this interface's address can use the address object as reference. For instance, using an address object from the previous examples, you would type ipadm delete-addr net0/v4b.

How to Configure an IPv4 Interface

Before You Begin

Ensure that your role has the appropriate rights profile to perform this procedure. See Using Rights Profiles to Perform Network Configuration.

  1. Create the IP interface.
    $ ipadm create-ip interface

    The interface name follows the datalink name on which the interface is created.

    This syntax is the most commonly used to configure networking on a system. However, two other create subcommands are available for other types of configuration:

  2. Configure the IP interface with a valid IP address.

    Use one of the following commands depending on the type of address:

    • Create a static address
      $ ipadm create-addr -a IP-address interface

      The address can be in Classless Inter-Domain Routing (CIDR) notation.

    • Configure a dynamic address.
      $ ipadm create-addr -T dhcp interface
  3. Display information about the system's IP interfaces.
    $ ipadm

    See also Monitoring IP Interfaces and Addresses that show how to obtain interface information by using show-* subcommands.

  4. If you are configuring a static IP address that uses a host name, add the entries for the IP address to the /etc/hosts file.

    The entries in this file consist of IP addresses and their corresponding host names.


    Note -  DHCP configurations do not require updates to the /etc/hosts file.

Example 2  Configuring an IPv4 Interface With a Static IP Address

The following example shows how to configure an IPv4 interface with a static IP address. The example also shows how to configure a persistent route for the interface by using the route command.

$ dladm show-phys
LINK     MEDIA        STATE     SPEED     DUPLEX     DEVICE
net3     Ethernet     up        100Mb     full       bge3

$ dladm show-link
LINK     CLASS     MTU     STATE     OVER
net3     phys      1500    up        --       --

$ ipadm create-ip net3
$ ipadm create-addr -a 192.0.2.3/24 net3
net3/v4

$ ipadm
NAME              CLASS/TYPE STATE        UNDER      ADDR
aggr0             ip         down         --         --
lo0               loopback   ok           --         --
   lo0/v4         static     ok           --         127.0.0.1/8
   lo0/v6         static     ok           --         ::1/128
net3              ip         ok           --         --
   net3/v4        static     ok           --         192.0.2.3/24

$ vi /etc/hosts
# Internet host table
# 127.0.0.1     localhost
203.0.113.14    foohost
192.0.2.3       sales1

Example 3  Configuring a Network Interface to Receive an IP Address From a DHCP Server

In the following example, the IP interface is configured to receive its address from a DHCP server. DHCP typically also installs a default route. Therefore, this example does not include a step for manually adding a default route by using the route command.

$ dladm show-phys
LINK     MEDIA        STATE     SPEED     DUPLEX     DEVICE
net3     Ethernet     up        100Mb     full       bge3

$ dladm show-link
LINK     CLASS     MTU     STATE     OVER
net3     phys      1500    up        --       --

$ ipadm create-ip net3
$ ipadm create-addr -T dhcp net3
net3v4

$ ipadm
NAME              CLASS/TYPE STATE        UNDER      ADDR
aggr0             ip         down         --         --
lo0               loopback   ok           --         --
   lo0/v4         static     ok           --         127.0.0.1/8
   lo0/v6         static     ok           --         ::1/128
net3              ip         ok           --         --
   net3/v4        static     ok           --         203.0.113.3/24

Create LDOM
# ldm add-domain DB01
# ldm add-vcpu 8 DB01
# ldm add-memory 16G DB01
# ldm add-vnet vid=98,99 vnet01 primary-vsw-core DB01


Create Volume Disk
# zfs create -V 100gb ldom-pool/DB01-OS

Create Alias
# ldm add-vdsdev /dev/zvol/dsk/ldom-pool/DB01-OS DB01-OS@primary-vds0
# ldm remove-vdsdev ldomweb_disk9 /dev/dsk/c13t5006016936E02582d0s2

Add Disk to LDOM
# ldm add-vdisk vdisk1 DB01-OS@primary-vds0 DB01

Remove Disk from LDOM
# ldm remove-disk vdisk9 ldom-web

Add ISO to LDOM
# ldm add-vdsdev options=ro /source/sol-11_4-text-sparc.iso iso@primary-vds0
# ldm add-vdisk sol11_iso iso@primary-vds0 DB01

Check Config LDOM
# ldm list-bindings DB01

Listing LDOM
# ldm list
# ldm bind DB01
# ldm start DB01

Setting variables
# ldm set-var auto-boot?=true ldom01
# ldm set-var boot-device=vdisk1 ldom01

List the resource for all LDOMs and per LDOM
# ldm list -o cpu primary
# ldm list -o network,memory ldom01


List all server resources
# ldm list-devices -a
# ldm list-devices mem

Remove ISO / Disk from LDOM
# ldm rm-vdisk iso11 ldom-DB01

Before You Begin

To collect SP data using the Service Snapshot utility, you need the Admin (a) role enabled.

  1. Log in to the Oracle ILOM CLI.
  2. Type the following commands:

    ->set /SP/diag/snapshot dataset=data

    ->set /SP/diag/snapshot dump_uri=URI

    where data and URI are one of the following:


    Value
    Option
    Header
    data
    normal
    Specifies that the Oracle ILOM, operating system, and hardware information is collected.
    full
    Specifies that all data is collected (“full” collection).

    Note - Using this option might reset the running host.


    normal-logonly or

    full-logonly

    Specifies that only log files are collected.
    URI
    Any valid target directory location
    Specifies the URI of the target directory. The URI format is as follows: protocol://username:password@host/directory

    where protocol can be one of these transfer methods: SFTP or FTP.

    For example, to store the snapshot information in the directory named data on the host, define the URI as follows: ftp://joe:mypasswd@host_ip_address/data

    The directory data is relative to the user login, so the directory would probably be /home/joe/data.

    The snapshot places a zip file in the specified URI.

  3. Unzip the file to access the data produced by the snapshot

This procedure requires Administration (a) permission.

  1. Log in to the Oracle ILOM web interface.
  2. Select Snapshot from the Maintenance tab.

    The Service Snapshot Utility screen appears.


    image:Service snapshot utility page
  3. Select the data set you want: Normal, FRU ID, Full, or Custom.
    • Normal – Specifies that Oracle ILOM, operating system, and hardware information is collected.
    • FRU ID – Provides FRU ID information.
    • Full – Specifies that all data is collected. Selecting Full might reset the system.
    • Custom – Allows you to choose one or more of the following data sets:
      • Oracle ILOM data

      • Hardware data

      • Basic OS data

      • Diagnostic data

  4. Select the Enabled check box if you want to collect only log files from the data set.
  5. Select the Enabled check box if you want to encrypt the output file.
  6. Select one of the following methods to transfer the output file:
    • Browser

    • SFTP

    • FTP

  7. Click Run.

    A Save As dialog box appears.

  8. In the dialog box, specify the directory to which to save the file and the file name.
  9. Click OK.

    The utility places a zip file in the specified directory.

  10. Unzip the file to access the data produced by the snapshot.

With Solaris 11, Oracle introduces the new zpool split command to split the ZFS pool (SPARC / x86 ). This comes in handy to increase the size of the rpool. Below are the high level steps involved :


Steps Involved

  1. attach a mirror device to the rpool
  2. reboot off the mirror (to verify everything works).
  3. split the original disk from the pool.
  4. set the “autoexpand” property of the rpool

Detailed procedure

1. Assuming that your initial rpool has the disk c0t0d0s0 and that you have a new disk c1t1d0s0 that is the size that you want to expand to. We will attach the new device c1t1d0s0 to the exisitng rpool.

# zpool attach rpool c0t0d0s0 c1t1d0s0

2. Now wait for the resilvering to complete. You can track this with :

# zpool status rpool

3. At this point, you can reboot from the mirror disk to verify that it works.
– On Sparc, you can do this by setting OBP to boot from the mirror disk c1t1d0s0, e.g.:

# init 6      ( or init 0 if you have autoboot set to true)
ok> boot /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@1

– On x86, you would configure the system BIOS.

4. And then we detach the old sub-mirror.

# zpool split rpool oldrpool c0t0d0s0

Now if you look at the pool it will show only one device (the new disk) but at the old size. You will also see a pool called “oldrpool” with the old disk that we split off. At this point, you should be able to boot from either of the two disks, but each will be a distinct rpool.

5. In order to expand the rpool size to that of the new disks we added, we need to tell zfs to expand to the capacity of the new disk. To do so, we have to set the autoexpand property on.

# zpool set autoexpand=on rpool

Use the following procedure if you need to preserve the IP configuration that is associated with one network device and then move that configuration to another network device. You might perform this procedure prior to removing a network card from the system or when changing a network cable connection.

The procedure uses e1000g0 and nge0 as sample devices.

Before You Begin

Ensure that your role has the appropriate rights profile to perform this procedure. See Using Rights Profiles to Perform Network Configuration.

  1. Display the physical link to device mappings on the system.

    The following example shows that the IP configuration for e1000g0 is down and the configuration needs to be moved to nge0:

    $ dladm show-phys
    LINK    MEDIA    STATE    SPEED    DUPLEX    DEVICE
    net0    Ethernet down     0        unknown   e1000g0
    net1    Ethernet down     0        unknown   e1000g1
    net2    Ethernet up       1000     full      nge0
    net3    Ethernet down     0        unknown   nge1
    
  2. Disable the IP configuration on the datalink temporarily, leaving its persistent settings intact.

    For example:

    $ ipadm disable-if net0
  3. Rename the datalink of the device that is down.

    For example:

    $ dladm rename-link net0 oldnet0

    This step makes oldnet0 as the link name of e1000g0.

  4. Assign the primary link name to the datalink that is designated to become the primary device.

    For example, net2 is the link name of the nge0 device. Thus, you would type:

    $ dladm rename-link net2 net0
  5. Re-enable the IP configuration on the newly named datalink (net0).
    $ ipadm enable-if -t net0

How to Set Up an NTP Server

  1. Become an administrator.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Create the ntp.conf file.

    To ensure proper execution of the ntpd daemon, the ntp.conf file must first be created. The ntp.client file can be used as a template.

    # cd /etc/inet
    # cp ntp.client ntp.conf

  3. Read the ntp.server file.

    If needed, add more information to the ntp.conf file.

  4. Edit the ntp.conf file.

    Make site specific changes to this file as needed.

  5. Start the ntpd daemon.
    # svcadm enable ntp

How to Set Up an NTP Client

  1. Become an administrator.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Create the ntp.conf file.

    To activate the ntpd daemon, the ntp.conf file must first be created.

    # cd /etc/inet
    # cp ntp.client ntp.conf
  3. Edit the ntp.conf file.

    Make site specific changes to this file as needed.

  4. Start the ntpd daemon.
    # svcadm enable ntp

How to Enable NTP Logging

  1. Become an administrator.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Enable logging.
    # svccfg -s svc:/network/ntp:default setprop config/verbose_logging = true

    See the svccfg(1M) man page for more information.

  3. Update the SMF repository and restart the service.
    # svcadm refresh svc:/network/ntp:default
    # svcadm restart svc:/network/ntp:default 
  4. Verify that logging has been enabled.
    # svcprop -p config/verbose_logging svc:/network/ntp:default
    true

How to Display the SMF Properties Associated With the NTP Service

  • List the SMF properties.
    • To list all of the properties associated with the NTP service, type:

      # svcprop svc:/network/ntp:default
    • To list all of the properties in the config property group, type:

      # svcprop -p config svc:/network/ntp:default

Hello, if you are removing a hard drive while the operating system is still running,

you must remove the drive logically from the operating system before physically
removing it from the server.
 
If you are removing a hard drive from a server that is powered off, skip to
Step 6 in these procedures.
 
Use the following instructions in conjunction with the cfgadm(M) man page.
 
1. Check that the hard drive you want to remove is visible to the operating system.
 
format
 
Searching for disks...done
 
 
 AVAILABLE DISK SELECTIONS:
 
       0. c1t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
           /pci@1c,600000/scsi@2/sd@0,0
        1. c1t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
           /pci@1c,600000/scsi@2/sd@1,0
 
Specify disk (enter its number):
 
2. Determine the correct Ap_Id label for the hard drive that you want to remove.
 
# cfgadm -al
 
Ap_Id           Type       Receptacle Occupant      Condition
 c0              scsi-bus   connected  configured    unknown
 c0::dsk/c0t0d0  CD-ROM     connected  configured    unknown
 c1              scsi-bus   connected  configured    unknown
 c1::dsk/c1t0d0  disk       connected  configured    unknown
 c1::dsk/c1t1d0  disk       connected  configured    unknown
 c2              scsi-bus   connected  unconfigured  unknown
 usb0/1          unknown    empty      unconfigured  ok
 usb0/2          unknown    empty      unconfigured  ok
 
 
Caution - Before proceeding, you must remove the hard drive from all its software
mount positions and delete any swap areas in use on the disk. If the drive is the
system boot device, do not proceed further with these instructions.  Do not attempt to unconfigure the boot disk.
 
3. Unconfigure the hard drive that you intend to remove.
 
Use the unconfigure command and specify the device you intend to remove. For example, if it is Disk 1, type:
 
# cfgadm -c unconfigure c1::dsk/c1t1d0
 
 
4. Check that the device is now unconfigured:
 
# cfgadm -al
 
Ap_Id           Type        Receptacle Occupant      Condition
 
c0              scsi-bus    connected  configured    unknown
c0::dsk/c0t0d0  CD-ROM      connected  configured    unknown
c1              scsi-bus    connected  configured    unknown
c1::dsk/c1t0d0  disk        connected  configured    unknown
c1::dsk/c1t1d0  unavailable connected  unconfigured  unknown
c2              scsi-bus    connected  unconfigured  unknown
usb0/1          unknown     empty      unconfigured  ok
usb0/2          unknown     empty      unconfigured  ok
 
 
5. Confirm that the hard drive you want to remove from the server is no longer visible to the operating system:
 
# format
 
Searching for disks...done
 
 
AVAILABLE DISK SELECTIONS:
 
       0. c1t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
           /pci@1c,600000/scsi@2/sd@0,0
 
Specify disk (enter its number): 
 
 
6. Ensure that the server is properly grounded.
 
7. Grip the bezel at the two finger holds and rotate it down to open
 
8. Check that the blue indicator LED is lit on the hard drive.
 
The blue LED comes on when the hard drive is ready to remove.
 
9. Slide the catch at the front of the hard drive to the right.
 
10. Pull the handle and remove the hard drive from the server by sliding it out from its bay.