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

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

How to Update the BIOS of the ESX/ESXi host?

Tuesday, October 17, 2017 0

Updating the BIOS of the ESX/ESXi host

The steps required to update firmware or a system BIOS varies depending on the hardware vendor and the component to be updated. Typically, the vendor will supply some type of utility that will update the component automatically.

For example, to update a motherboard's BIOS:

Notes:

    Before performing this procedure, ensure to migrate the virtual machines and appliances in the ESX/ESXi host.    

    This a only an example. The results may vary from each manufacturer.

 1. Download the update utility from the vendor.

 2. Create a bootable floppy disk or CD/DVD-ROM that contains the utility.

 3. Physically be in front of the server that hosts ESX/ESXi.

 4. Reboot the host.
   
 5. Access the BIOS of the server.
    Note: You may access the BIOS by pressing F2 or DEL. However, this varies depending on the vendor and is usually displayed on your screen.

 6. Find the System Information section of the BIOS. The location varies depending on vendor.

 7. Note the BIOS version and any other relevant information before upgrading.

 8. Ensure that your BIOS is capable of booting from a floppy or CD/DVD-ROM.

 9. Place the floppy or CD/DVD-ROM in the server and reboot the system. 

 10.Boot from the device and follow the on-screen instructions to update the hardware.

 11.Verify if the firmware/BIOS has been updated.

 12.Proceed with the ESX/ESXi installation or upgrade.

How to check the vMotion Count by using PowerCLI

Tuesday, October 17, 2017 0

Below script can help you to get the count of all vMotion events that has happened in the past 24 hrs.

If you want to calculate the count for longer period then change the number AddDays.

Get-VIEvent -Entity (Get-VM -Location $_) -MaxSamples ([int]::MaxValue) -Start (Get-Date).AddDays(-1) |Where { $_.GetType().Name -eq “TaskEvent” -and $_.Info.DescriptionId -eq “VirtualMachine.migrate”} | Measure-Object | Select-Object -ExpandProperty Count