Friday, July 16, 2010

Timekeeping on Linux VMware Guests

Timekeeping on Linux VMware guests can be a cumbersome and frustrating experience. I'm creating this post to be able to remind myself of the various settings required to make things work. The bulk of this information is taken from VMware KB article #1006427 located at:
http://kb.vmware.com/kb/1006427.

VMware recommends using NTP and turning off VMware Tools periodic time synchronization in the guest. To turn this off, there are three options:

  1. Set tools.syncTime = "False" in the configuration file (.vmx file) of the virtual machine.

  2. OR

  3. Deselect Time synchronization between the virtual machine and the host operating system in the VMware Tools toolbox GUI of the guest operating system.

  4. OR

  5. Run the vmware-guestd --cmd "vmx.set_option synctime 1 0" command in the guest operating system.
To work properly in a VM, some vendor kernels require certain kernel parameters. In our environment, we only run SLES and RHEL so I'm only concerned about those two. If you run something different, check the VMware KB article linked to above.


Architecture

Linux Version

Kernel Parameters

Notes
64bitRHEL 5.4 and later
No additional kernel parameters.
32bitRHEL 5.4 and later
No additional kernel parameters.
64bitRHEL 5.3notsc divider=10
32bitRHEL 5.3divider=10 clocksource=acpi_pm
64bitSLES 10.2 and later
No additional kernel parameters.
32bitSLES 10.2 and later
Use a VMI enabled kernel.



You now want to make sure that NTP is configured correctly for your environment.

The following is a sample /etc/ntp.conf :

server ntp1.somedomain.org
server ntp2.somedomain.org
restrict 127.0.0.1
restrict default nomodify nopeer
driftfile /var/lib/ntp/drift

Wednesday, January 6, 2010

Remove LUNs from Linux

I have a previous post here on how to add SAN Presentations (LUNs) to Linux. This post uses the same QLogic Dynamic Target and LUN Discovery utilities as the previous post. The steps below apply to SLES 10 and RHEL 5 servers using QLogic HBAs and PowerPath. That is what we have at my workplace and so that is what I'm most familiar with. This post also assumes that you have put the qlogic utilities into /tmp/ql_utils as described in the other post.

To remove a LUN and all associated PowerPath and Linux devices from the host environment follow these steps. These steps must be run with root privileges. (Note that it is critical to follow the procedures in exact order because deviating from the procedures can cause the host to panic.) These steps were put together using steps from QLogic KB articles.

1. Stop any I/O to the device being removed. [Unmount the filesystem or make sure that the disk has been completely removed from within Oracle ASM control.] It is critical to stop all I/O on the device that is being removed.

2. Run the following command to determine which native SCSI devices are mapped to the pseudo device:

powermt display dev=all

Find the name of the LUN to be removed and match it up with the emcpower device name. This will need to be done on each server individually.

3. Run the command:

powermt remove dev=emcpower

Where corresponds to the LUN to be removed.

4. Run the command:

powermt release

Failing to run this command results in the pseudo device still being visible in /dev and /sys/block and may lead to some complications when the new devices are dynamically added.

5. In the /tmp/ql_utils directory, there should be a script to rescan the qlogic hbas. (If this script doesn't exist, see the previous post for the steps to get the script.) The script is called ql-dynamic-tgt-lun-disc.sh. Run the script:

/tmp/ql_utils/ql-dynamic-tgt-lun-disc.sh

6. You will now remove the device from the storage array using your array admin utilities. On the Linux server, run powermt display to verify that the device has been removed.

7. Now remove the LUN from the Storage Group (CLARiiON) or unmap it from the FA ports (DMX).

Display WWN in SLES 9

I have another post regarding how to do this on SLES 10, so I decided to create a post on how to do this in SLES 9. In SLES 9 you can easily find the WWN for QLogic HBA's by running:

# cat /proc/scsi/qla2xxx/* | grep node