2

I'm using xen virtualization with a dhcp server. Whenever I create a new VM an ipaddress is assigned by the dhcp server. I'm working remotely and have to use only command line, so logging into the VMs I create is a pain without knowing the ipaddress (static ip is not allowed). Is there an elegant way to find the ipaddress of the vm before logging into it?

Currently I use nmap to scan the port and take my best guess at the open ssh ports.

3

If you're assigning IP addresses with a DHCP server then you can read the leases file to see which addresses have been leased to which MAC addresses. You can set a static MAC address for the Xen domain in its config file.

For example, with ISC DHCP on Debian you will find the leases file at /var/lib/dhcp3/dhcpd.leases

On many DHCP server implementations you can also have it send a DNS update when it acknowledges a lease, so if you configure your DNS infrastructure properly you can just connect by host name.

Also on some DHCP server implementations you can have a script execute when a lease is acknowledged, so you could work something out with that.

0

I run Xen with Fedora Domain0 and use libvirt managed dnsmasq for dhcp. My leases are found in /var/lib/libvirt/dnsmasq/default.leases

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.