Red Hat Satellite Server 6 How to install on RHEL 6/RHEL 7

Preparing for Red Hat Satellite Server 6 Installation – What you need to get started is

  • RHEL 6 or RHEL 7 server.
  • Satellite Server 6 entitlement from Red Hat Network.
  • Access to RHN network.

Step 1.) Register the Satellite server using the subscription-manager command, then set the Satellite 6 version in RHN network if you are transitioning from Red hat Satellite 5.5 :

subscription-manager register --type=satellite

Red Hat Satellite Server 6 InstallationStep 2.) find the pool id from Red Hat Satellite Server 6 and then attach the pool id id

subscription-manager list --available --all|less
Subscription Name:Red Hat Satellite Subscription
Provides:Red Hat Software Collections (for RHEL Server)
Red Hat Satellite Capsule
Red Hat Satellite
SKU: VER---US
Pool ID:axddff9944gghhaabbabababb
Available:10
Suggested:1
Service Level:Self-Support
Service Type:L1-L3
Multi-Entitlement:No
Ends:01/20/20
System Type:Virtual


subscription-manager attach --pool=axddff9944gghhaabbabababb

Step 3.) Disable RHEL 6 or RHEL 7 repos and enable the Software collection and Satellite server 6 repos

#subscription-manager repos --disable "*"


#subscription-manager repos --enable rhel-6-server-rpms --enable rhel-server-rhscl-6-rpms \
--enable rhel-6-server-satellite-6.0-rpms

Step 4.) Verify yum repos, this is crucial before you start doing Red Hat Satellite Server 6 installation. I am doing this on my VMware RHEL 6 VM’s , important thing to note is before you can install katello you need to have right repos available to your Red Hat Satellite server 6  machine

# yum repolist

rhel-6-server-rpms Red Hat Enterprise Linux 6 Server (RPMs) 12,913
rhel-6-server-satellite-6.0-rpms Red Hat Satellite 6.0 (for RHEL 6 Server) (RPMs) 345
rhel-server-rhscl-6-rpms Red Hat Software Collections RPMs for Red Hat Enterprise Linux 6 Server 1,269

Step 5.) Run the yum updates and then do the katello installation

#yum -y update
#yum install katello

So far so good, right the Satellite Server 6 installation is not bad if you are experienced Red Hat Server administrator, if you are Windows Admin then also it wouldn’t be difficult to follow the instructions I have added here.

Step 6.) Here comes the final step to install Katello

katello-installer –capsule-dns true –capsule-dns-forwarders \
8.8.8.8 –capsule-dns-interface eth0 –capsule-dns-zone \
example.com –capsule-dns-reverse 30.16.172.in-addr.arpa \
–capsule-dhcp true –capsule-dhcp-interface eth0 \
–capsule-dhcp-gateway 172.16.30.1 –capsule-tftp true

RHEL 7 How to change the hostname for a server, new commands ?

RHEL 7 introduced some new commands so it wouldn’t be like the older versions if you have to change the hostname, looking for commands to change the hostname, check this out :

 

hostname
nirvana

A static hostname file exists with entry of hostname under /etc/hostname, you can use command line option to change the hostname :

 

[root@nirvana ~]# hostnamectl set-hostname ciscomaster.mozilla.org
[root@nirvana ~]# hostname
ciscomaster.mozilla.org

RHEL 7 How to check ip address for network card


[root@nirvana ~]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:56:17:d9 brd ff:ff:ff:ff:ff:ff
inet 192.168.195.135/24 brd 192.168.195.255 scope global dynamic eth0
valid_lft 1176sec preferred_lft 1176sec
inet6 fe80::20c:29ff:fe56:17d9/64 scope link
valid_lft forever preferred_lft forever

RHEL 7 Network Manager how to check the network devices

1.How to check the network card status in RHEL 7 :
[root@nirvana ~]# nmcli dev status
DEVICE  TYPE      STATE      CONNECTION
eth0    ethernet  connected  eno2
lo      loopback  unmanaged  --  

Red Hat Enterprise 7 has concept of network connections associated with network card, network card can have multiple connections but only one connection will be active, see below :

2. Check the network card connections

[root@nirvana ~]#nmcli con show
NAME UUID TYPE DEVICE
eno2 a0d50790-5cc2-443a-bf51-71b3b8994ac6 802-3-ethernet eth0

3. Check only active connections in RHEL 7:

[root@nirvana ~]# nmcli con show –active
NAME UUID TYPE DEVICE
eno2 a0d50790-5cc2-443a-bf51-71b3b8994ac6 802-3-ethernet eth0

Adding Static routes in RHEL 5.x/RHEL 6.x

For Adding static routes in CentOS or RHEL , the ip route command comes very handy :

For example if you want to use the different network interface to reach out to some isolated network then use the ip route add command:


ip route add 192.168.74.52 via 192.168.70.1 dev eth1

You can Verify by running route -n command

Similarly, for reaching out to a different network use , as listed in example below:

ip route add 172.24.224.0/24  via 172.22.98.1 dev eth1

How to change Emulex HBA queue depth options in RHEL 6

Changing the queue depth of Emulex HBA

For Changing maximum queue depth settings in Emulex HBA on servers running RHEL 6 loading and unloading lpfc module is needed. The Emulex HBA support the following options to influence the queue depth settings :

# modinfo lpfc|grep queue_depth
parm: lpfc_lun_queue_depth:Max number of FCP commands we can queue to a specific LUN (uint)
parm: lpfc_hba_queue_depth:Max number of FCP commands we can queue to a lpfc HBA (uint)

Step 1.In RHEL 6 create a module related file under /etc/modprobe.d/ by name lpfc.conf ” and add:

options lpfc lpfc_hba_queue_depth=32
options lpfc lpfc_lun_queue_depth=32

Step 2. Rebuild the initial ramdisk image in RHEL 6:
2a. It is recommended you make a backup copy of the initrd in case the new version has an unexpected problem :

cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

2b.Now rebuild the initramfs for the current kernel version:

#dracut -f

Reboot the servers and verify the lpfc_hba_queue_depth and lpfc_lun_queue_depth values.

Using Python with RHN API

Why use RHN API ?

  • RHN APU can be used to automate tasks for managing systems .
  • Connect to the Satellite server via XML-RPC library

See example below to get started, here is sample Python script :


Sample Python Script
#!/usr/bin/python
import xmlrpclib
URL = "https://satellite.example.com/rpc/api"
user = "rhn-username"
pswd = "rhn-password"
client = xmlrpclib.Server(URL, verbose=0)
session = client.auth.login(user, pswd)
list = client.user.list_assigned_system_groups(session, user)
for group in list:
print group.get('name')
client.auth.logout(session)

Python subprocess examples

Here is the code for testing subprocess in python, firstcode.py

When this python program runs,the output will be send to standard output,stdout . For managing process Python 2.4 provides a special module called – subprocess and a class called Popen.

#!/usr/bin/python
import subprocess
p = subprocess.Popen('df -h',shell=True, stdout=subprocess.PIPE)
out,err = p.communicate()
print out

OUTPUT

[root@devine ~]# ./firstcode.py
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_devine-lv_root
18G 3.5G 13G 22% /
tmpfs 497M 276K 497M 1% /dev/shm
/dev/sda1 485M 33M 428M 8% /boot