This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Tuesday, June 7, 2016

When up2date/yum fail with "Error Class Code 31" - Solved.

Tuesday, June 07, 2016 0
Whenever Running up2date or yum update fails with below error

Error Message    : Service not enabled for system profile: "system1.example.com"

Error Class Code: 31
Error Class Info   :This system does not have a valid entitlement for Red Hat Network.

    Please visit https://rhn-server/rhn/systems/SystemEntitlements. or 

    login at https://rhn-server, and from the "Overview" tab,
    select "Subscription Management" to enable Redhat Network service for this system.
Situation

  • System registration fails with above error.
  • Redhat Network entitlements missing after Redhat contract renewal.
  • After executing rhn_register, the system appears in host list, but as unentitled.
  • Cannot entitle system.
  • System does not have a valid entitlement for Red Hat Network.
  • When trying to install a package, an error was received that said the system does not have a valid entitlement.
  • No longer able to update system.
  • Satellite certificate activation is failing with "Error Class Code 31"?

Resolution

If the system is not registered with rhn-server, follow the below steps to have an entitlement.


  • Log in to Satellite Customer Portal
  • Click on My Subscriptions
  • Under Redhat Network Classic select All Registered Systems
  • Click on system name
  • Click on Edit These Properties beside System Properties
  • Ensure either Update or Management is selected for Base Entitlement.
  • Click the Update Properties button located in the bottom-right corner.

Root Cause

  • Error Class Code: 31 means that a valid entitlement is not assigned to your system profile.
  • When you register a system, the base entitlement gets assigned to either Update / Management (as per the free entitlement in account) along with the base channel. But if the base entitlement is removed for the system profile then while updating the system it fails with Error Class Code: 31

Saturday, April 23, 2016

Find command with more example

Saturday, April 23, 2016 0
1. Find Files Using Name in Current Directory

[root@nsk nskselvan]# find . -name kal.txt
./kal.txt

2. Find Files Under Home Directory

[root@nsk nskselvan]# find /home -name kal.txt
/home/nskselvan/kal.txt

3. How to run the last executed find command?

[root@nsk nskselvan]# !find
find /home -name kal.txt
/home/nskselvan/kal.txt


4. Find Files Using Name and Ignoring Case sensitive

[root@nsk nskselvan]# find /home -iname Kal.txt
/home/nskselvan/kal.txt


5. Find Directories under / directory by using particular name.

[root@nsk nskselvan]# find / -type d -name kal
/home/nskselvan/kal

6. Find all txt Files in Directory

[root@nsk nskselvan]# find / -type f -name "*.txt"
/etc/pki/nssdb/pkcs11.txt
/var/cache/yum/x86_64/7/base/mirrorlist.txt
/var/cache/yum/x86_64/7/extras/mirrorlist.txt
..
.
/usr/share/hwdata/oui.txt
/home/nskselvan/kal.txt


7. Find Files With 777 Permissions

[root@nsk nskselvan]# find . -type f -perm 0777 -print
./tes1.txt

8. Find Files Without 777 Permissions

[root@nsk nskselvan]# find / -type f ! -perm 777 
/boot/grub2/device.map
/boot/grub2/i386-pc/gcry_rmd160.mod
/boot/grub2/i386-pc/acpi.mod
/boot/grub2/i386-pc/gcry_rsa.mod
/boot/grub2/i386-pc/adler32.mod

9. Find Sticky Bit Files with 551 Permissions

[root@nsk nskselvan]#  find / -perm 1551
/home/nskselvan/tes.txt

10. Find SUID Files

[root@nsk nskselvan]# find / -perm /u=s
/usr/bin/umount
/usr/bin/chage
/usr/bin/gpasswd
/usr/bin/staprun

11. Find SGID Files

[root@nsk nskselvan]# find / -perm /g+s
/run/log/journal
/run/log/journal/57b26cb527b64b9f88803ad24fd81384
/usr/bin/wall
/usr/bin/write

/usr/bin/ssh-agent


12. Find Read Only Files

[root@nsk nskselvan]# find / -perm /u=r 
/
/boot
/boot/efi
/boot/efi/EFI
/boot/efi/EFI/centos
/boot/grub2
/boot/grub2/device.map
/boot/grub2/i386-pc


13. Find Executable Files

[root@nsk nskselvan]# find / -perm /a=x | more
/
/boot
/boot/efi
/boot/efi/EFI
/boot/efi/EFI/centos
/boot/grub2


14. Find Files with 777 Permissions and Chmod to 644 (dont use untill not checked)

# find / -type f -perm 0777 -print -exec chmod 644 {} \;

15. Find Directories with 777 Permissions and Chmod to 755 (dont use untill not checked)

# find / -type d -perm 777 -print -exec chmod 755 {} \;

16. Find and remove single File  

# find . -type f -name "kal.txt" -exec rm -f {} \;

17. Find and remove Multiple File ( list before using rm command)

# find . -type f -name "*.txt" -exec rm -f {} \;

18. Find all Empty Files under /tmp Directory

[root@nsk nskselvan]# find /tmp -type f -empty
/tmp/yum.log

19.  Find all Empty Directories under /tmp Directory

[root@nsk nskselvan]#  find /tmp -type d -empty
/tmp/.font-unix
/tmp/.Test-unix
/tmp/.ICE-unix
/tmp/.XIM-unix
/tmp/.X11-unix

20. File all Hidden Files 

[root@nsk nskselvan]# find / -type f -name ".*" | more
/boot/.vmlinuz-3.10.0-693.el7.x86_64.hmac
/boot/.vmlinuz-3.10.0-693.5.2.el7.x86_64.hmac
/run/initramfs/.need_shutdown
/sys/module/sg/notes/.note.gnu.build-id


21. Find Single File Based on User

[root@nsk nskselvan]# find / -user nskselvan -name kal.txt
/home/nskselvan/kal.txt

22. Find all Files Based on User

[root@nsk nskselvan]# find /  -user nskselvan
/var/spool/mail/nskselvan
/home/nskselvan
/home/nskselvan/.bash_logout
/home/nskselvan/.bash_profile
/home/nskselvan/.bashrc
/home/nskselvan/kal.txt
/home/nskselvan/kal
/home/nskselvan/tes.txt
/home/nskselvan/tes1.txt

/home/nskselvan/test2.txt


23. Find all Files Based on Group

[root@nsk nskselvan]# find / -group ntp
/etc/ntp/crypto
/var/lib/ntp

/var/log/ntpstats

24. Find Particular Files of User

[root@nsk nskselvan]# find / -user nskselvan -iname "*.txt"
/home/nskselvan/kal.txt
/home/nskselvan/tes.txt
/home/nskselvan/tes1.txt
/home/nskselvan/test2.txt


25. Find Last 5 Days Modified Files

[root@nsk nskselvan]# find / -mtime 5 
/
/boot/efi
/boot/efi/EFI
/boot/grub2/device.map
/boot/grub2/i386-pc
/boot/grub2/i386-pc/gcry_rmd160.mod
/boot/grub2/i386-pc/acpi.mod


26. Find Last 5 Days Accessed Files

[root@nsk nskselvan]#  find / -atime 5 | more
/boot/grub2/device.map
/boot/grub2/i386-pc/gcry_rmd160.mod
/boot/grub2/i386-pc/acpi.mod
/boot/grub2/i386-pc/gcry_rsa.mod
/boot/grub2/i386-pc/adler32.mod


27. Find Last 1-5 Days Modified Files

[root@nsk nskselvan]#  find / -mtime +1 -mtime -5
/var/cache/yum/x86_64/7/extras/gen/primary_db.sqlite
/var/cache/yum/x86_64/7/extras/repomd.xml


28. Find Changed Files in Last 1 Hour

[root@nsk nskselvan]# find / -cmin -60
/var/lib/rsyslog
/var/lib/rsyslog/imjournal.state
/var/log/messages
/var/log/audit/audit.log
/var/log/cron
/home/nskselvan
/home/nskselvan/kal.txt

/home/nskselvan/kal


29. Find Modified Files in Last 1 Hour

[root@nsk nskselvan]# find / -mmin -60
/dev/pts/0
/dev/ptmx
/proc/fb
/proc/fs

/proc/fs/xfs


30. Find Accessed Files in Last 1 Hour

[root@nsk nskselvan]# find / -amin -60 | more
/boot/efi
/boot/efi/EFI
/boot/efi/EFI/centos
/boot/grub2
/boot/grub2/i386-pc
/boot/grub2/locale


31. Find 5MB Files

[root@nsk nskselvan]# find / -size 5M
/usr/bin/ld.gold

/usr/lib/x86_64-redhat-linux6E/lib64/libc.a


32. Find Size between 5MB – 7MB

[root@nsk nskselvan]# find / -size +5M -size -7M
/boot/vmlinuz-3.10.0-693.el7.x86_64
/boot/vmlinuz-0-rescue-57b26cb527b64b9f88803ad24fd81384
/boot/vmlinuz-3.10.0-693.5.2.el7.x86_64


33. Find and Delete 100MB Files (list before deleting the file)

# find / -size +100M -exec rm -rf {} \;

34. Find Specific Files and Delete (list before deleting the file)

# find / -type f -name *.mp3 -size +10M -exec rm {} \;

Saturday, March 5, 2016

vSphere 6 – new virtual hardware version 11

Saturday, March 05, 2016 0
This new hardware version enables new maximum configurations and features listed below. Below you can find a list with enhancements and a compatiblity list showing vSphere Version to supported virtual hardware versions.

New configuration maximums for virtual machines with vHW11:

    128 vCPUs
    4 TB vRAM
    32 serial ports

New features with vHW11:

    vNUMA aware hot-add RAM
    WDDM 1.1 GDI acceleration
    USB 3.0 xHCI controller
    extended support for virtual graphics incl. Nvidia vGPU

Expanded Guest OS Support:

    Solaris 11.2
    Oracle Unbreakable Enterprise Kernel Release 3 Quaterly Update 3
    Asanux 4 SP4
    Ubuntu 12.04.5 and 14.04.1
    Oracle Linux 7
    FreeBSD 9.3
    Mac OSX 10.10





Importing media into VMware Update Manager fails with the error: Cannot upload file, because it is an invalid package

Saturday, March 05, 2016 0
Whenever
Attempting to import an ESXi update image fail with below erros

    Cannot upload file, because it is an invalid package.
    Failed to import data. The uploaded upgrade package cannot be used with VMware vSphere Update Manager



The resolution will be

 “ You must use the same version of vSphere Update Manager to upgrade to the corresponding version of ESXi”

vSphere 6.0 – What’s New in VMware Fault Tolerance (FT)

Saturday, March 05, 2016 0
Finally, With vSphere 6.0, VMware broken the limitation lock of Fault Tolerance. FT VM now Supports upto 4 vCPUs and 64 GB of RAM (Which was 1 vCPu and 64 GB RAM in vSphere 5.5). With this vSMP support, Now FT can be used to protect your Mission Critical applications. Along with the vSMP FT support, There are lot more features has been added in FT with vSphere 6.0, Let’s take a look at what’s new in vSphere 6.0 Fault Tolerance(FT)

 
Benefits of Fault Tolerance
  •     Continuous Availablity with Zero downtime and Zero data loss
  •     NO TCP connections loss during failover
  •     Fault Tolerance is completely transparent to Guest OS.
  •     FT doesn’t depend on Guest OS and application
  •     Instantaneous Failover from Primary VM to Secondary VM in case of ESXi host failure
What’s New in vSphere 6.0 Fault Tolerance
  •     FT support upto 4 vCPUs and 64 GB RAM
  •     Fast Check-Pointing, a new Scalable technology is introduced to keep primary and secondary in Sync by replacing “Record-Replay”
  •     vSphere 6.0, Supports vMotion of both Primary and Secondary Virtual Machine
  •     With vSphere 6.0, You will be able to backup your virtual machines. FT supports for vStorage APIs for Data Protection (VADP) and it also supports all leading VADP solutions in Market like symantec, EMC, HP ,etc.
  •     With vSphere 6.0, FT Supports all Virtual Disk Type like EZT, Thick or Thin Provisioned disks. It supports only Eager Zeroed Thick with vSphere 5.5 and earlier versions
  •     Snapshot of FT configured Virtual Machines are supported with vSphere 6.0
  •     New version of FT keeps the Separate copies of VM files like .VMX, .VMDk files to protect primary VM from both Host and Storage failures. You are allowed to keep both Primary and Secondary VM files on different datastore.
  •  


Friday, March 4, 2016

Deprecated VMFS Volumes found on host. Please consider upgrading volume(s) to the latest version error in vsphere 6.0

Friday, March 04, 2016 0
The ESXi hosts display a false positive warning:

Deprecated VMFS volume(s) found on the host. Please consider upgrading volume(s) to the latest version

This is a known issue affecting vCenter Server 6.0.

Currently, there is no resolution.

This issue occurs because the version of the filesystem is not known during the initial detection. Therefore, comparing it against the list of valid filesystems does not return a match.

Workaround or Fix :

To work around this issue, restart the management agents on the impacted hosts to clear the warning using the below command.

Services.sh restart

After restarting the management agents on my ESXi 6.0 host, warning about deprecated VMFS volumes on ESXi host is cleared automatically. I hope this informative for you. Thanks for Reading!!!. Be Social and share it in social media, if you feel worth sharing it.


Thursday, March 3, 2016

How can I add more ethernet interface to a guest Linux server after installation?

Thursday, March 03, 2016 0

Add more ethernet interface to a guest after installation

Issue 

When a guest OS was created using virt-manager or virt-install, it created one ethernet interface for the guest. How do I create a second and third interface and attach them to the guest post insatllation?

Resolution
 

Xen

Using virt-manager. (Recommended)
  •     Right Click the Guest in virt-manager and select "Open" an dselect "Hardware" tab
  •     Click on "Add Hardware"
  •     Select "Network" as the "Hardware Type" and click Forward.
  •     Select "Virtual Network" or "Shared physical device" depending upon the requirement. Set fixed MAC address if needed. Select "Hypervisor default" or another appropriate Deivce Model. Click Forward
  •     Then Click "Finish".
  •     New network will be attached to the guest on the next reboot.

By manually editing the guest configuration file. (Not recommended)

    Edit the configuration file for that guest at /etc/xen/guestname and add nic = 2 for two interfaces and or nic = 3 for three interfaces.
    Change the vif = entry.

     vif = [ 'mac=xx:xx:xx:xx:xx:xx, bridge=xenbr0' ]
     To (For two interfaces)
     vif = [ 'mac=xx:xx:xx:xx:xx:xx, bridge=xenbr0', 'mac=xx:xx:xx:xx:xx:xx:xx,

    bridge=xenbr0' ]
     OR To (For three interfaces)
     vif = [ 'mac=xx:xx:xx:xx:xx:xx, bridge=xenbr0', 'mac=xx:xx:xx:xx:xx:xx:xx,
    bridge=xenbr0', 'mac=xx:xx:xx:xx:xx:xx, bridge=xenbr0' ]

    For fully virtualised guests it should be as below:

     vif = [ 'type=ioemu,mac=xx:xx:xx:xx:xx:xx, bridge=xenbr0',
    'type=ioemu,mac=xx:xx:xx:xx:xx:xx:xx, bridge=xenbr0',
    'type=ioemu,mac=xx:xx:xx:xx:xx:xx, bridge=xenbr0' ]

    Configure eth1 and eth2 inside the guest OS as usual.

Note: xx:xx:xx:xx:xx:xx needs to be replaced by a unique mac address.


KVM

Using virt-manager.
  •     Right Click the Guest in virt-manager and select "Open" an dselect "Hardware" tab
  •     Click on "Add Hardware"
  •     Select "Network" as the "Hardware Type" and click Forward.
  •     Select "Virtual Network" or "Shared physical device" depending upon the requirement. Set fixed MAC address if needed. Select "Hypervisor default" or another appropriate Deivce Model. Click Forward
  •     Then Click "Finish".
    New network will be attached to the guest on the next reboot.