Monday, December 17, 2012

How to Create Channel from RHN or Repo



How to Create Channel from RHN or Repo 

Satellite 

  1. To view channels available run 
    1. tmp]# satellite-sync -l | tee channels 
    2. # satellite-sync --list-channels | more 

  2. Download Satellite Channel Content ISO’s for each channel you will need. 
*note: Channel Content ISOs are special collections that contain both packages and XML dumps of metadata. 
  1. Red Hat recommends using Channel Content ISO’s locally versus importing directly from RHN website to save time. 
  2. Our example, we only user v6.3 RHEL 
  3. The process to copy Channel Content ISOs is to mount each one, copy its contents to the temporary repository, and then unmount the ISO. 
  4. Mount from your laptop to satellite server or copy to temp location then  
    1. mount -o loop -t iso9660 channel.iso /mntpoint  
  1. Begin download process 
    1. Login  to RHN > go to Downloads  > Channels 
    2. On the Full Software Channel page, Under Filter Product Channel choose Red Hat Network Products then click Filter 
    3. When results are returned, expand RHEL 6 and you should see Satellite.  
      1. click on the RHN Satellite channel, making sure to select the Satellite channel that corresponds to your version of Satellite.  
      2. note: make sure RHN Entitlement Certificate has been uploaded to RHN and correctly identifies the target channels. 
    4. Look to the right and you should see x86_64 and any other architectures. Click on the x86_64 
    5. Then, Click the Downloads tab and use the instructions on the page to obtain the Channel Content ISOs, available by version of Red Hat Enterprise Linux. 
    6. scroll down to View Base Channel Content ISOs for Satellite  and expand. 
    7. Locate the Base channel you want and exapand, then download all the iso images.  
      1. for example, locate  RHEL 6 (x86_64) + EUS + AUS + RHN Proxy/Tools + Supplementary (Base 2011-12-11) and download all isos listed underneath it. 

   
  1. Create import directory 
    1. ]# mkdir /var/satellite/sat-import  
  2. Mount the iso to local in vCenter and then copy from mount point to sat-import 
    1. [root@my sat media]# mount /dev/cdrom /media  
    2. [root@mysat media]# cp -ruv  * /mnt /var/satellite/sat-import/  
    3. Repeat these steps for each Channel Content ISO of every channel to be imported.   
  3. The first step in importing channels into the database is listing the channels available for import. This is accomplished with the command:  
    1. satellite-sync --list-channels --mount-point /var/satellite/sat-import 
    2. notes: run ‘satellite-sync  --list-channels’ option to obtain a list of all channels by label. 
  4. View local channels available 
    1. [root@mysat sat-import]# satellite-sync --list-channels --mount-point /var/satellite/sat-import/   
  5. Start the import of a channel 
    1. [root@mysat sat-import]# satellite-sync  -c rhel-x86_64-server-6 --mount-point /var/satellite/sat-import/  
    2. ---output truncated---       8203/8203 Fetch successful: freeradius-2.1.12-3.el6.x86_64.rpm (1458248 bytes) 
    13:38:36 Processing rpm packages complete 
    13:38:36 
    13:38:36 Importing package metadata 
    13:38:36    Importing *relevant* package metadata: rhel-x86_64-server-6 (8203) 
    13:38:36    * WARNING: this may be a slow process. 
                ________________________________________ 
    Importing:  #   ---output truncated---    
  6. This conducts the following tasks in this order:  
    1. Populating the tables describing common features for channels ( channel families). This can also be accomplished individually by passing the --step=channel-families option to satellite-sync.  
    2. Creating a particular channel in the database and importing the metadata describing the channel. Individually, use the --step=channels option.  
    3. Moving the RPM packages from the temporary repository into their final location. Individually, use the --step=rpms option.  
    4. Parsing the header metadata for each package in the channel, uploading the package data, and associating it with the channel. Individually, use the --step=packages option.  
    5. Identifying Errata associated with the packages and including them in the repository. Individually, use the --step=errata option.  
  7. Empty or remove /var/satellite/sat-import once completed.  
Spacewalk 

Add spacewalk-utils 
  • Yum install spacewalk-utils 

Run command to create two base channels 
  • /usr/bin/spacewalk-common-channels -v -u space -p spacewalk -a i386,x86_64 -k unlimited 'centos5*' 'spacewalk-nightly-client*'  
Create directory /space/iso-images  
Place ISO Image (1st disk) in iso-images and mount using mount -o loop iso /mntpoint 
Copy contents to /space/satellite