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

Friday, October 20, 2017

How to enable log for chroot sftp users in Linux Server?

Friday, October 20, 2017 0
Follow the below steps to enable logs for chroot sftp users

1. Take the backup of /etc/ssh/sshd_config

2. Add the below settings to sshd_config

Subsystem       sftp   internal-sftp  -f LOCAL6 -l INFO

  Match group sftpgroup
  ChrootDirectory /home/%u
  KbdInteractiveAuthentication no
  PasswordAuthentication no
  AllowTCPForwarding no
  X11Forwarding no
  Subsystem       sftp  internal-sftp -f LOCAL6 -l INFO

Save & Exit the sshd configuration.

3. Take the back of /etc/sysconfig/rsyslog & add the below entry.

SYSLOGD_OPTIONS="-m 0 -a /home/sftpuser/dev/log"

4. Create sftp.log file under /etc/rsyslog.d & add the below entry (This is used for create sockets)

# create additional sockets for the sftp chrooted users
module(load="imuxsock")
input(type="imuxsock" Socket="/path/to/somedirectory/dev/log" CreatePath="on")
input(type="imuxsock" Socket="/path/to/anotherdirectory/dev/log" CreatePath="on")

# log internal-sftp activity to sftp.log
if $programname == 'internal-sftp' then /var/log/sftp/sftp.log
& stop

5. Create dev directory under /home/sftpuser user

6. Now restart both sshd & rsyslog service

7. Now chroot sftp users activity logs are enabled & available under /var/log/sftp/

Hope it helps.

Thursday, October 19, 2017

Kernel: WARNING calibrate_APIC_clock: the APIC timer calibration may be wrong appear on Guest 5.x Linux VM's

Thursday, October 19, 2017 0
This was due to the MAX_DIFFERENCE parameter value (in the APIC calibration loop) of 1000 cycles being too aggressive for virtual guests. APIC (Advanced Programmable Interrupt Controllers) and TSC (Time Stamp Counter) reads normally take longer than 1000 cycles when performed from inside a virtual guest, due to processors being scheduled away from and then back onto the guest. With this update, the MAX_DIFFERENCE parameter value has been increased to 10,000 for virtual guests.

These messages can be stopped by adding ‘apiccalibrationdiff=10000’ to guest kernel in /etc/grub.conf.

How to Activate the Logical Volumes on Individual Cluster Member Nodes in a RHEL Cluster?

Thursday, October 19, 2017 0
If you have LVM installed in a cluster environment, you may at times need to activate logical volumes exclusively on one node.

To activate logical volumes exclusively on one node, use the lvchange -aey command. Alternatively, you can use lvchange -aly command to activate logical volumes only on the local node but not exclusively.


You can later activate them on additional nodes concurrently.

How to Power on a virtual machine from the command line?

Thursday, October 19, 2017 0
ESXi 4.x, 5.x and 6.0

To power on a virtual machine from the command line:

    List the inventory ID of the virtual machine with the command:

    vim-cmd vmsvc/getallvms |grep <vm name>Note: The first column of the output shows the vmid.   

    Check the power state of the virtual machine with the command:

    vim-cmd vmsvc/power.getstate <vmid>   

    Power-on the virtual machine with the command:

    vim-cmd vmsvc/power.on <vmid>


ESX 4.0 and ESX 4.1

To power on a virtual machine from the command line:

    To list the path of all the virtual machines on the host:

    vmware-cmd -l   

    Get the state of the virtual machine with the command:

    vmware-cmd <path to the VMX file> getstate

    Power on the virtual machine with the command:

    vmware-cmd <path to the VMX file> start

ESXi 3.5

To power on a virtual machine from the command line:

    List the inventory ID of the virtual machine with the command:

    vim-cmd vmsvc/getallvms |grep <vm name>

    Check the power state of the virtual machine with the command:

    vim-cmd vmsvc/power.getstate <vmid>

    Power on the virtual machine with the command:

    vim-cmd vmsvc/power.on <vmid>

ESX 3.5
To power on a virtual machine from the command line:

    To list the path of all the virtual machines on the host:

    vmware-cmd -l

    Get the state of the virtual machine with the command:

    vmware-cmd <path to the VMX file> getstate

    Power on the virtual machine with the command:

    vmware-cmd <path to the VMX file> start

Wednesday, October 18, 2017

How to solve "Cannot vMotion virtual machines with physical mode RDM"

Wednesday, October 18, 2017 0

1.  Open the vSphere PowerCLI command-line.

2.  Run the command:

Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName | fl

This command produces a list of virtual machines with RDMs, along with the backing SCSI device for the RDMs.

    An output looks similar to:

    Parent              Virtual Machine Display Name
    Name                Hard Disk n
    DiskType            RawVirtual
    ScsiCanonicalNamenaa.60123456789abcdef0123456789abcde
    DeviceName            vml.020000000060123456789abcdef0123456789abcde1234567890ab

    If you need to save the output to a file the command can be modified:

Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName | fl | Out-File –FilePath RDM-list.txt
    
  3.  Identify the backing SCSI device from either the ScsiCanonicalName or DeviceName identifiers.

How to Identify Raw Device Mappings (RDMs) using the vSphere Client?

Wednesday, October 18, 2017 0

To identify RDMs using the vSphere Client:

1. Connect to vCenter Server or a host using the vSphere Client.
2. Select a virtual machine in the inventory.
3. Right-click the virtual machine and click Edit Settings.
4. Select each hard disk in the Virtual Hardware list with a summary Mapped Raw LUN. The path to the RDM virtual disk mapping file and the name of the backing SCSI device are listed.

Tuesday, October 17, 2017

When the : "Error: Driver 'pcspkr' is already registered" will appear in Virtual Machine?

Tuesday, October 17, 2017 0

On Virtual machine's, if you are observing following message 'Error: Driver 'pcspkr' is already registered'  in /var/log/messages file, then we get rid of this by adding  'blacklist snd-pcsp' in /etc/modeprobe.d/blacklist.conf file.

#echo 'blacklist snd-pcsp' >> /etc/modprobe.d/blacklist.conf