Solaris 11 – IPS Local Repository

im07t1-solaris-cloud-1-1354432 A fast and straight approach for creating local IPS repository.

CREATING THE REPOSITORY

The steps are basic:
1.Download the repository;
2.Concatenate the iso files;
3.Mount the iso;
4.Create the zfs dataset;
5.Create the repository;
6.Copy the repository;
7.Build the search index;
8.Set the repository;
9.Unmount the iso;

Code example:

root@sol11:~# cat sol-11_1-repo-full.iso-a sol-11_1-repo-full.iso-b > sol-11_1-repo-full.iso
root@sol11:~# mount -F hsfs sol-11_1-repo-full.iso /mnt
root@sol11:~# zfs create -o atime=off -o compression=on rpool/export/repoSolaris11
root@sol11:~# pkgrepo create /export/repoSolaris11
root@sol11:~# rsync -aPq /mnt/repo /export/repoSolaris11
root@sol11:~# pkgrepo -s /export/repoSolaris11 refresh
Initiating repository refresh.
root@sol11:~# pkg set-publisher -G '*' -M '*' -g /export/repoSolaris11/repo solaris
root@sol11:~# umount /mnt
root@sol11:~#

Note – pkg set-publisher:
-G ‘*’ – Removes all existing origins for the solaris publisher.
-M ‘*’ – Removes all existing mirrors for the solaris publisher.


UPDATING THE REPOSITORY

Again basic steps:
1.Download the incr repo /from MOS/;
2.Mount the iso;
3.Update the repository;
4.Refresh the search index;
5.Unmount the iso;

root@sol11:~$ mount -F hsfs sol-11_1_17_5_0-incr-repo.iso /mnt
root@sol11:~$ pkgrecv -s /mnt/repo -d /export/repoSolaris11 '*'
Processing packages for publisher solaris ...
Retrieving and evaluating 626 package(s)...
PROCESS                                         ITEMS    GET (MB)   SEND (MB)
Completed                                     626/626   3109/3109   7243/7243

root@sol11:~$ pkgrepo -s /export/repoSolaris11 refresh
Initiating repository refresh.
root@sol11:~$ umount /mnt
root@sol11:~$

CONFIGURING HTTP SERVICE

We can share the repository trough NFS or HTTP. With NFS we just need to export the repo dir, mount it on the target machine and execute: pkg set-publisher -G '*' -M '*' -g /nfs/mount/point solaris

For HTTP we need to configure the service first:

root@sol11:~$ svccfg -s application/pkg/server setprop pkg/inst_root=/export/repoSolaris11
root@sol11:~$ svccfg -s application/pkg/server setprop pkg/readonly=true
root@sol11:~$ svccfg -s application/pkg/server setprop pkg/address=192.168.1.9
root@sol11:~$ svccfg -s application/pkg/server setprop pkg/port=65007
root@sol11:~$ svcadm refresh application/pkg/server
root@sol11:~$ svcadm enable application/pkg/server
root@sol11:~$

In here we are just making the repo read only and setting the repo dir, addr, port to the appropriate values.

After that we shall enable the repo on the target machines:

root@sol11:~$ pkg set-publisher -G '*' -M '*' -g http://192.168.1.9:65007/ solaris
root@sol11:~$

Kovachev

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s