Category: Vmware

  • How to Cancel a Stuck Task in ESX

    Noose

    Today I was in the process of trying to put one of my ESX 4 hosts into maintenance mode. However after about 30 minutes of waiting the task was only 2% complete. Right-Clicking on the task and clicking cancel did nothing to help. So I ran the following commands to kill off each and every task that was stuck or in progress and brought sanity back to my cluster.

    service mgmt-vmware restart

    service vmware-vpxa restart

  • Mapping nic hardware address to PCI address

    When logged into an ESX host the following command will list out all your nics with their PCI address. As you can see I have quite a few active ports on this box. Specifically I have two onboard ports and two quad port cards.

    esxcfg-nics -l

    vmnic0  0d:00.00 e1000       Up   100Mbps  Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
    vmnic5  0e:00.01 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
    vmnic8  12:00.00 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
    vmnic2  05:00.00 bnx2        Up   1000Mbps Full   1500   Broadcom Corporation Broadcom NetXtreme II BCM5708 1000Base-T
    vmnic4  0e:00.00 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
    vmnic1  03:00.00 bnx2        Up   1000Mbps Full   1500   Broadcom Corporation Broadcom NetXtreme II BCM5708 1000Base-T
    vmnic3  0d:00.01 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
    vmnic6  11:00.00 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
    vmnic7  11:00.01 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
    vmnic9  12:00.01 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller

    While this information is helpful, it does not tell me which ports are on the same card. However the following command gives me the mac addresses of each port, so I can figure out which ports are on the same quad port nic by comparing similar macs, I have highlighed the ports that are on the same card as vmnic9

    grep "/net/pnic" /etc/vmware/esx.conf

    root@rhost11 log]# grep "/net/pnic" /etc/vmware/esx.conf
    /net/pnic/child[0000]/mac = "00:1c:c4:ec:65:58"
    /net/pnic/child[0000]/name = "vmnic1"
    /net/pnic/child[0000]/virtualMac = "00:50:56:5c:65:58"
    /net/pnic/child[0001]/mac = "00:1c:c4:ec:65:56"
    /net/pnic/child[0001]/name = "vmnic2"
    /net/pnic/child[0001]/virtualMac = "00:50:56:5c:65:56"
    /net/pnic/child[0002]/mac = "00:18:fe:2e:1b:21"
    /net/pnic/child[0002]/name = "vmnic0"
    /net/pnic/child[0002]/virtualMac = "00:50:56:5e:1b:21"
    /net/pnic/child[0003]/mac = "00:18:fe:2e:1b:20"
    /net/pnic/child[0003]/name = "vmnic3"
    /net/pnic/child[0003]/virtualMac = "00:50:56:5e:1b:20"
    /net/pnic/child[0004]/mac = "00:18:fe:2e:1b:23"
    /net/pnic/child[0004]/name = "vmnic4"
    /net/pnic/child[0004]/virtualMac = "00:50:56:5e:1b:23"
    /net/pnic/child[0005]/mac = "00:18:fe:2e:1b:22"
    /net/pnic/child[0005]/name = "vmnic5"
    /net/pnic/child[0005]/virtualMac = "00:50:56:5e:1b:22"
    /net/pnic/child[0006]/mac = "00:18:fe:2e:b3:91"
    /net/pnic/child[0006]/name = "vmnic6"
    /net/pnic/child[0006]/virtualMac = "00:50:56:5e:b3:91"
    /net/pnic/child[0007]/mac = "00:18:fe:2e:b3:90"
    /net/pnic/child[0007]/name = "vmnic7"
    /net/pnic/child[0007]/virtualMac = "00:50:56:5e:b3:90"
    /net/pnic/child[0008]/mac = "00:18:fe:2e:b3:93"
    /net/pnic/child[0008]/name = "vmnic8"
    /net/pnic/child[0008]/virtualMac = "00:50:56:5e:b3:93"
    /net/pnic/child[0009]/mac = "00:18:fe:2e:b3:92"
    /net/pnic/child[0009]/name = "vmnic9"
    /net/pnic/child[0009]/virtualMac = "00:50:56:5e:b3:92"

  • Kill and VM from the Command Line

    If you need to kill a guest VM via the command line, use the vmware-cmd command.

    "vmware-cmd /<path to VM directory>/server.vmx stop"
    "vmware-cmd -l" will get you your virtual machines names and config file locations

    If that does not work you can take more drastic measures and kill the VM process itself.
    ps -ef | grep <virtualmachinename>
    kill -9 <pid>

  • Enabling Web Access in ESX 4

    For some reason, Vmware has decided to disable the Web Access service in ESSX 4 by default. You will find this out if you attempt to click on "Log into Web Access" on your Vmware ESX 4 Welcome Page on a newly build ESX 4.0 server. You will get the following error "503 Service Unavaliable". Do not panic

    To resolve this you should SSH into the ESX box and type the following

    service vmware-webAccess start, to start the service

    chkconfig –level 345 vmware-webAccess on, to set the service to start at boot.

  • vSphere 4 Configuration Maximums Document

    When you select and configure your virtual and physical equipment, you must stay at or below the maximums

    supported by vSphere 4.0. The limits presented in the attached document represent tested, recommended limits,

    and they are fully supported by VMware.

     

    http://www.vmware.com/pdf/vsphere4/r40/vsp_40_config_max.pdf

  • VMware vSphere Editions Comparison

    The Vmware Marketing team is at it again, as they have introduced even more ESX and ESXi version in VSphere 4. This link is from Vmware.com and helps clarify the difference between versions.  

    VMware vSphere Editions Comparison:

    http://www.vmware.com/products/vsphere/buy/editions_comparison.html

  • 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.