Tag: vmware

  • ESX Post Install – Enable NTP and SNMP

    FirewallThis post is the first in what I suspect will be a semi-long list of post-install hints and tips as I go through and start rebuilding my cluster as Vsphere 4. Hopefully I will learn a lot along the way… like for example the fact the ntp and snmp traffic is not allowed by default by the ESX Firewall.

    But before we go there we first need to make sure that our services are starting at boot.

    chkconfig ntp on, … do the same for snmp

    Then lets fix the firewall. First lets fix ntp.

    esxcfg-firewall -e ntpClient

    Then lets verify that all is well with…

    esxcfg-firewall -q ntpClient

    This command returns…

    Service ntpClient is enabled

    Ok now lets fix snmp using the same commands above, but specific for snmp.

    esxcfg-firewall -e snmp and esxcfg-firewall -q snmpd.

    While you are at it add the following to you snmp.conf

    dlmod SNMPESX /usr/lib/vmware/snmp/libSNMPESX.so

    Then restart snmp and ntp and you should be good.

  • How to Configure NTP in a RHEL/CentOS Vmware Guest

    HourglassSuccessful time keeping in a Virtual Machine can be a bit confusing. At times I have been told to use Vmware Tools to sync time between the Guest and the Host, and at time I have been advised to avoid this functionality and use NTP. The following information is direct from a VMware KB article (updated, 4/16/2010) so I am going to follow their lead on this and use NTP exclusively.

    First off VMware advises using the NTP service to keep time in sync, but it suggests
    using an additional kernel parameter that you add to your grub.conf. See the KB Article for more info on how to do this.

    • notsc for RHEL/Centos 4.6 64bit
    • notsc divider=10 for  RHEL/Centos 5.3 64bit

    Note that there are no additional params needed for 5.4

    http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427

    Also, inside the ntp.conf the following line should be added to the top of the file.

    tinker panic 0

    This configuration directive instructs NTP not to give up
    if it sees a large jump in time. This is important for coping with large
    time drifts and also resuming virtual machines from their suspended state.

    It is also important not to use the local clock as a time source, often
    referred to as the Undisciplined Local Clock. NTP has a tendency to fall
    back to this in preference to the remote servers when there is a large
    amount of time drift.

    An example of such a configuration is below. You should comment out both
    lines.

    server 127.127.1.0

    fudge 127.127.1.0 stratum 10

    Also, if you are using ntp, you want to make sure that you disable
    Vmware tools time sync. You can do so with the following command via the
    guest OS.

    vmware-guestd –cmd “vmx.set_option synctime 1 0”

  • Redhat I/O Scheduler Configuration in a Virtual Machine.

    Dali-melting-time-wall-clock The Linux kernel controls disk I/O scheduling, and is responsible for its optimization. One of the ways that it does this is via an I/O elevator to reorder and schedule pending I/O requests in order to minimize the time spent moving the
    disk head. This reduction in movement results in a reduction in disk seek time which in turn,  maximizes hard
    disk throughput.

    However, because of the fact that ESX is its own built in elevator, the Linux kernel’s elevator is not needed, and in fact can hurt disk performance. So its best to disable the elevator inside your linux VMs.

    One way to do this is to edit your /etc/grub.conf and add “elevator=noop” as seen below. This will require a reboot to take affect.

    title CentOS (2.6.18-53.el5)
            root (hd0,0)
            kernel /boot/vmlinuz-2.6.18-53.el5 ro root=LABEL=/ noapic acpi=off rhgb quiet notsc elevator=noop
            initrd /boot/initrd-2.6.18-53.el5.img

    To make the change on the fly to a running Linux VM run the command below, where device is your boot disk

    echo noop > /sys/block/DEVICE/queue/scheduler

    Additional Information:

    http://www.redhat.com/magazine/008jun05/features/schedulers/

    http://kbase.redhat.com/faq/docs/DOC-7539

    http://lonesysadmin.net/2008/02/21/elevatornoop/

    http://www.redhat.com/docs/wp/performancetuning/iotuning/iosubsystem-scheduler-selection.html

    http://www.linuxjournal.com/article/6931

  • How to Disable DRS for one VM in a DRS Enabled Cluster

    How to Disable DRS for one VM in a DRS Enabled Cluster

    VMware DRS (Distributed Resource Scheduler) is a feature of ESX that balances
    computing workloads with available resources in a virtualized
    environment. 

    When you enable a cluster for DRS, VirtualCenter continuously monitors the distribution
    of CPU and memory resources for all hosts and virtual machines in the cluster. DRS compares these metrics to what resource utilization ideally should be given the attributes of the resource pools and
    virtual machines in the cluster, and the current load.

    Note that DRS is only available in ESX Enterprise or above.

    When DRS is enabled in a cluster, ESX then will automagically vmotion guest VMs to other hosts in your cluster in an attempt to ballance out the load evenly across the cluster. However, sometimes this behavior is not always desired. For exmaple if you have a large VM that you want to stay pinned to a particular host.

    In order to override the default DRS cluster settings for a vm, you need to do the following.

    1. Right Click on your cluster and then click on “edit settings
    2. Under DRS, click on “Virtual Machine Options
    3. Locate the particular VM and the drop down box under “Automation Level
    4. Change “Default (Fully Automated)” to “Manual
  • VMK load_Mod panic failed to load module VMFS2

    This past weekend I was doing a few memory upgrades when one of the boxes that I was working on decided not to boot up properly. This was a bummer considering that it was 2am.

    Networking did not start properly so I was unable to ssh to the box, however I found the above error messages in the vmware kernel log (/var/log/vmkernel), the hostd log (/var/log/vmware/hostd.log) and on the console.

    First I needed to verify the modules that started using the esxcfg-module command with the -l switch. Below is the output of this command, as it should appear, however in this case as we found that the vmklinux and the vmfs3 were loaded up fine but there was no vmfs2 module.

    esxcfg-module -l
    Device Driver Modules
    Module         Enabled Loaded
    vmklinux       true    true
    bnx2           true    true
    cciss          true    true
    e1000          true    true
    lpfc_740       true    true
    lvmdriver      true    true
    vmfs3          true    true
    etherswitch    true    true
    shaper         true    true
    tcpip          true    true
    cosShadow      true    true
    migration      true    true
    nfsclient      true    true
    deltadisk      true    true

    vmfs2          true    true

    The we checked whether vmfs2 is not enabled by using the "-g" switch to the same command and found it was not set to load at boot. We then set the boot option to true by using the "-s" switch for the "vmfs2". The performed an esxcfg-boot -b and then rebooted the ESX and it booted up fine.