Wednesday, August 6, 2014

Redhat Satellite - create a software channel with specific minor version

Say you have your organization software channel synced at rhel 6.2 and Redhat parent software channel at latest release 6.5. Now you need to upgrade a rhel 6.1 system to 6.4.

Redhat Satellite provides utility to create a software channel with specific minor release. It does not download all related rpms while creating channel. Required rpms ( simply an older version of your latest rpms !) will already be available in you satellite. It will just create channel and update satellite database table with package IDs.

Below is syntax to create  rhel 6.4 software channel.

# spacewalk-create-channel --help

# spacewalk-create-channel --user=your-satellite-user-name --server=localhost --version=6 --update=U4 --release=Server --arch=x86_64 --destChannel=organisation-rhel6-x86_64-6U4 --name=organisation-rhel6-x86_64-6U4
Password:

You have not specified a source channel, we will try to determine it from inputs
Trying with source channel: rhel-x86_64-server-6
Creating channel, organisation-rhel6-x86_64-6u4, with arch x86_64 3648 packages in source file to push.
Pushing 3648 packages, please wait.
Successfully pushed 3648 packages out of 3648

# spacecmd
Welcome to spacecmd, a command-line interface to Spacewalk.
INFO: Spacewalk Username: your-satellite-user-name
Spacewalk Password:
INFO: Connected to https://localhost/rpc/api as your-satellite-user-name

spacecmd {SSM:0}> softwarechannel_details organisation-rhel6-x86_64-6u4
Label:              organisation-rhel6-x86_64-6u4
Name:               organisation-rhel6-x86_64-6U4
Architecture:       x86_64
Parent:
Systems Subscribed: 0
Number of Packages: 3648

Summary
-------
organisation-rhel6-x86_64-6u4

GPG Key:
GPG Fingerprint:
GPG URL:
spacecmd {SSM:0}>


References
Create a cloned/custom channel from a specific update level on Red Hat Satellite
Create a custom channel to include all errata's and packages released before a specific date





Sunday, August 3, 2014

Four ways to update HP iLO firmware

HP iLO firmware are scexe (self extracting files).  To get the iLO firmware, search system model on support section of hp.com.

ONE : From OS (Linux) CLI use scexe file

- Download iLO firmware say CP023069.scexe
- Unpack it
$ cd /tmp
$ chnmod 755 CP023069.scexe
$ ./CP023069.scexe
- follow online instruction
- Check iLO new version
$ curl http:///xmldata?item=All

TWO : From iLO CLI load bin file


On some webserver ( that should be on same same vlan as iLO valn and network), copy firmware bin file in DocumentRoot.

$ ./CP023069.scexe --unpack=firmware
$ cd firmware
$ cp firmware/ilo2_NNN.bin $DocumentRoot (usually /var/www/html/)

- Login on iLO over ssh and upload firmware
$ssh -l Administrator
- To see current iLO version
iLO> show

- to check if your web servers is pingable from iLO (to get iLO bin file)
iLO> cd /map1
iLO> oemhp_ping
iLO> load -source http:///firmware/ilo2_NNN.bin

- Your session will seems to hang for 2-3 minute - do not worry ! If all is good. iLo firmware will be upgraded and iLO will be rebooted. Check iLo version
$ curl http:///xmldata?item=All

THREE : Using iLO WebUI to upload bin file


- Download and save ilo firmware bin files extracted above by keying in below in you web browser
http:///firmware/ilo2_NNN.bin
-access iLO Web UI, go to Administration tab and upload bin file to upgrade iLO firmware
http://


FOUR : HPSIM to push firmware

- Use HPSIM if you  paying SIM license fee !


Reference : http://pipe2text.com/?page_id=1908





Scripts to upload multiple files on dropbox.redhat.com and ftp.veritas.com

You may need to upload multiple files multiple time on Redhat (sosreports, spacewalk-debug ) and Veritas (VRTSexplorer) websites to get vendor support. Below scripts will be handy for this purpose.

Script to upload file(s) on dropbox.redaht.com

#!/bin/bash
#set -n
if [ $# -eq 0 ]; then
        echo "Usages: $0 "
        exit 1
else
  # Check if file exist and make file readable, if it is not
  for f in $*
  do
    if [ -f $f ];then
      [ ! -r $f ] && sudo chmod 755 $f || (echo Failed to set 755 permission on $f && exit 1)
    else
      echo $f does not exist
      exit 1
    fi
  done

  # Upload file
  echo "Uploading files $* on dropbox.redhat.coms"

ftp -n <
open dropbox.redhat.com
user anonymous nasimuddin.ansari@company.com
bin
prompt
hash
passive
cd  /incoming
mput $*
bye
EOD
echo "Finish uploading of :"
echo $*|tr ' ' '\n'
exit 0
fi



Script to upload file(s) on ftp.veritas.com

#!/bin/bash
#sh -n
# http://www.symantec.com/docs/TECH66995 - for password - it changes in every 3 months

if nc -zvw2 ftp.veritas.com 21; then
        if [ $# -eq 0 ]; then
            echo "Usages: $0 "
            exit 1
        else
        # Check if file exist and make file readable, if it is not
        for f in $*
        do
          if [ -f $f ];then
            [ ! -r $f ] && sudo chmod 755 $f || (echo Failed to set 755 permission on $f && exit 1)
          else
            echo $f does not exist
            exit 1
          fi
        done

          echo "Uploading files $* on ftp.veritas.com"
          ftp -n <
          open ftp.veritas.com
          user iosupport YHJ8YLJpuUN8cY-t
          bin
          prompt
          hash
          passive
          cd  /incoming
          mput $*
          bye
EOD
          echo "Finish uploading of :"
          echo $*|tr ' ' '\n'
          exit 0
        fi
else
        echo 'ftp.veritas.com is not accessible from this host'
        exit 1
fi