Blog O' Matty


Mapping ESX server devices to Linux devices

This article was posted by Matty on 2006-06-15 22:15:00 -0400 -0400

While poking around on one of our ESX 3.0 beta servers, I came across the esxcfg-vmhbadevs command. This nifty utility allows you to view the Linux device associated with a given VMWare device:

$ /usr/sbin/esxcfg-vmhbadevs -m

vmhba2:0:0:1 /dev/sdc1 444cdb88-b3dc4745-bdb1-00093d11a79c
vmhba2:0:1:1 /dev/sdd1 444cdb9e-eea275ca-eab2-00093d11a79c
vmhba0:0:0:3 /dev/sda3 4476fbec-7f9e4f3e-7d67-00093d11a98e
vmhba2:0:2:1 /dev/sdg1 444cdbbb-be098ef5-45d7-00093d11a79c
vmhba2:0:3:1 /dev/sdh1 44770a21-57ed137c-d2d9-00093d11a98e
vmhba2:0:4:1 /dev/sdi1 44840de1-ab9e7e7d-dcd2-00093d11a98e
vmhba2:0:5:1 /dev/sdj1 447712b9-009decd6-3fc3-00093d11a98e
vmhba2:0:6:1 /dev/sdk1 44771536-e96c381f-561a-00093d11a98e
vmhba2:0:7:1 /dev/sdl1 44771553-cb331da9-6d36-00093d11a98e

$ /usr/sbin/esxcfg-vmhbadevs -q

vmhba0:0:0 /dev/sda
vmhba0:1:0 /dev/sdb
vmhba2:0:0 /dev/sdc
vmhba2:0:1 /dev/sdd
vmhba2:0:2 /dev/sdg
vmhba2:0:3 /dev/sdh
vmhba2:0:4 /dev/sdi
vmhba2:0:5 /dev/sdj
vmhba2:0:6 /dev/sdk
vmhba2:0:7 /dev/sdl
vmhba2:0:8 /dev/sdm
vmhba2:0:9 /dev/sdn
vmhba2:0:10 /dev/sde
vmhba2:0:11 /dev/sdf

In order to run esxcfg-vmhbadevs, you need to have access to the VMWare service console.

Linux file event notifications

This article was posted by Matty on 2006-06-13 19:20:00 -0400 -0400

I read about the Linux dnotify feature a while back, and learned about it’s many limitation while writing a change notification system. It looks like Robert Love wrote a file notification framework called inotifty to replace dnotify, and his work looks really really cool. I am hoping to play with this at some point.

NAT Variations

This article was posted by Matty on 2006-06-13 19:17:00 -0400 -0400

Network Address translation (NAT) has become an essential part of the Internet, and is one of the reasons we still have IPv4 address space available. All NAT devices are not created equal though, and several NAT variations are prevalent (per RFC 3489):

Full Cone: A full cone NAT is one where all requests from the same internal IP address and port are mapped to the same external IP address and port. Furthermore, any external host can send a packet to the internal host, by sending a packet to the mapped external address.

Restricted Cone: A restricted cone NAT is one where all requests from the same internal IP address and port are mapped to the same external IP address and port. Unlike a full cone NAT, an external host (with IP address X) can send a packet to the internal host only if the internal host had previously sent a packet to IP address X.

Port Restricted Cone: A port restricted cone NAT is like a restricted cone NAT, but the restriction includes port numbers. Specifically, an external host can send a packet, with source IP address X and source port P, to the internal host only if the internal host had previously sent a packet to IP address X and port P.

Symmetric: A symmetric NAT is one where all requests from the same internal IP address and port, to a specific destination IP address and port, are mapped to the same external IP address and port. If the same host sends a packet with the same source address and port, but to a different destination, a different mapping is used. Furthermore, only the external host that receives a packet can send a UDP packet back to the internal host.

FMA support for AMD Opteron processors

This article was posted by Matty on 2006-06-11 21:15:00 -0400 -0400

Gavin Maltby has an awesome blog entry about the FMA support that is presently in Nevada, and soon to be in Solaris 10 update 2:

http://blogs.sun.com/roller/page/gavinm/20060315

I have written about FMA before, and still think it’s my favorite Solaris 10 feature.

Printing dd status

This article was posted by Matty on 2006-06-11 21:12:00 -0400 -0400

I recently used dd to zero out some hard drives on my Fedora Core workstation, and found that this operation takes a good deal of time (even when large blocksizes are used, it still takes a while). The dd utility doesn’t report status information by default, but when fed a SIGUSR1 signal it will dump the status of the current operation:

$ dd if=/dev/zero of=/dev/hda1 bs=512 &

$ kill -SIGUSR1 1749
1038465+0 records in 1038465+0 records out 531694080 bytes (532 MB) copied, 11.6338 seconds, 45.7 MB/s

It still amazes me how much stuff I have left to learn about the utilities I use daily.