vmkvsitools in ESXi

There is very little I can find about vmkvsitools on the internet. VMware document says “vmkvsitools is intended for use with VMware Technical Support. Do not use vmkvsitools to manage your system.”. But we normally don’t care as long as we know what we are doing, do we?

The following commands are available under vmkvsitools in ESXi 6.0 U1.

    vmkvsitools
    usage: vmkvsitools [options] [function] [arguments]
           or [function] [arguments]

    Options:
       --cache, -c    Perform the operation on a given VSI cache file

    Functions:
       lspci
       ps
       hwclock
       vmware
       irqinfo
       bootOption
       amldump
       pci-info
       pidof
       userspaceof
       vdu
       lsof
       vdf
       pkill
       pgrep
       uptime

You can run them using “vmkvsitools function”. For example-

vmkvsitools hwclock
04:26:29   07/17/2017   UTC 

You can also run them directly by typing just the command as they are symblinked from /bin.

    ls -l /bin |  grep vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 amldump -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 bootOption -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 hwclock -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 irqinfo -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 lsof -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 lspci -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 pgrep -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 pidof -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 pkill -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 ps -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 uptime -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 vdf -> /bin/vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 vdu -> /bin/vmkvsitools
    -r-xr-xr-x    1 root     root         75868 Sep 16  2015 vmkvsitools
    lrwxrwxrwx    1 root     root            16 Sep 16  2015 vmware -> /bin/vmkvsitools
Advertisements

How to find interface name from /sys

It would be very rare to land on a Linux box without lspci (pciutils) installed. I faced an such rare issue today while helping a friend with his lfs machine. The network will not start because the interface eth0 is missing.

We were pretty sure we have the driver since we compiled VMXNET3 (CONFIG_VMXNET3=y) into the kernel. The first thing you would naturally do is, keep reading. is run lspci to check if the device is detected. There was no lscpi as it was a bare bone lfs system.

In the absence of lspci, When you restart network or ifup an interface and it complains the interface is missing “Device ethX does not seem to be present, delaying initialization”, you have the wrong interface name.

ifconfig -a and ip a s will show you all interfaces even if they have no IP assigned. If your system is so bare bones that you don’t have net-tools or iproute2, there are other means.

 # ls /sys/class/net/
 eno16780032  lo  sit0 

and

# cat /proc/net/dev

It was a case of wrong interface name in the config file. Once we find the correct interface name, the fix was a matter of renaming the config file and device name inside the config file .