virt-ifconfig

Today I finished off a tool which everyone has been asking for, virt-ifconfig – list the IP addresses of your virtual machines:

# virt-ifconfig
Guest                Iface   Family  IP address
CentOS5x32           eth0    inet    192.168.122.17
CentOS5x32           eth0    inet6   fe80::5652:ff:fe3c:7611

You can grab some very experimental source code from this repository.

Next up will be: virt-ps, virt-uname, virt-route, virt-dmesg, and more …

4 Comments

Filed under Uncategorized

4 responses to “virt-ifconfig

  1. jef spaleta

    Do you have a roadmap concerning the number of commands you’ll be creating in the virt- namespace?

    Perhaps before you go to far down into the rabbit hole would it make more sense to modify the existing programs so that virtual client functionality is appended as an additional set of optional parameters to the existing programs? Just something to consider as an alternative to doubling the size of /sbin/ /bin/ directory listings.

    -jef

  2. rich

    Jef:

    I would be surprised if it’s more than a dozen commands. Let’s see:

    virt-df
    virt-edit
    virt-cat
    virt-top
    virt-ifconfig
    virt-ps
    virt-route
    virt-uname
    virt-dmesg
    maybe virt-iptables and virt-kill

    The aim is just to allow users to collect routine statistics and diagnose simple problems. For complex stuff, sysadmins will just have to log into the VM.

    (For comparison, my current /bin and /sbin has 392 files).

    The problem with combining them is that we don’t offer all of the existing options. For example “virt-ps” is very much equivalent to running “ps ax” in the guest, and there is no other option supported (if you want to see fewer processes you have to filter them yourself). The other problem is that these commands require a lot of machinery to work, most of it written in Perl, which isn’t conducive to inclusion in those upstream projects.

    Rich.

  3. Pingback: virt-uname « Richard WM Jones

  4. Pingback: Quick tip: Find the IP address of a virtual machine « Richard WM Jones

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.