Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

When I migrate a virtual machine (VM), the gateway of the VM must be reconfigured to communicate with the outside. So I decided to use DHCP to reconfigure the gateway of the VM. If once the VM sends a DHCPDISCOVERY after the migration, a DHCP server can indicate the valid gateway IP for the VM. I will then change the configuration of the DHCP server before the migration.

If I can use dhclient or any other tool that is running inside the VM, the solution will be obvious. But there are some restriction in which I can't run any commands under the VM. I must deal with the VM externally. Are there any kinds of tools which could force the VM to do DHCPDISCOVERY? Any other potential solutions?

ps. 'migration' is 'live migration'. What i want to achieve is seamless service.

add : Why i reached this question. Maybe this can show hidden requirement or restriction which are not shown in my pool question. My first approach was NAT with central machine. All host machine attached to this central machine. With this approach i could achieve what i want. freely migrate through any machine in the cluster. It's not literally seamless, but in my requirement, it's quite enough. But with this approach, I can't scale out cluster and there can be terrible single point of failure on the central machine. So my recent approach was dividing NAT function to the each hosts. In this approach, i have to set gateway of each host to virtual bridge of each machine. My servefault question has arose from this environment. What if i have to do host-to-host migration? After live migration, i have to set new gate way to the vm. Because gateway information varies with each host. Next was my server fault question. Though i'm currently using KVM full virtualization(for window supports). But I'm also looking for xen or paravirutualization solution. I'm not sure, but currently it looks like paravirtualization or ovs, flud-light can solve the issue. (After i wrote this, i have realized that i should write new question. maybe it is more fit for my source problem)

share|improve this question
What hypervisor? VMWare ESXi has a (complex) way of doing something like this that may help. – Chopper3 Mar 26 '13 at 9:26
@Chopper3 I'm using kvm. What is that feature of VMWare ESXi called? It will be very helpful for me. I just googled about that, but it's hard to find. – jinhwan Mar 27 '13 at 2:34
There's something called 'vmtools' which is an OS-specific bunch of code that gets installed inside properly configured VMWare VMs to help with compatibility and performance, they're drivers mostly but one of them allows the hypervisor to force a DHCPRenew, it's not a super-simple thing, it's an API basically so needs some coding but it's how these things called vApps often work in the VMWare world. – Chopper3 Mar 27 '13 at 8:08

2 Answers 2

That's not really possible. Maybe you could set the dhcp lease time to something short, so the box will do dhcpdiscover/request quite frequently, minimizing downtime.

share|improve this answer
thank you for answer. But there will be multiple VM per server, i'm worrying about side effect(slowdown of the server or frequent disconnection etc..) of the short lease time. – jinhwan Mar 27 '13 at 2:40
Short lease shouldn't have any adverse effects. – slm Mar 28 '13 at 6:19

One approach would be to override the settings using KVM. You can change a KVM VM using the command virsh. To make these changes edit the virtual machine's XML file through virsh:

% virsh edit <domain>

Below are the relevant lines, replace the IPs with those of your setup

    <type arch='x86_64' machine='rhel6.0.0'>hvm</type>
    <cmdline>linux ip= netmask= gateway= dns=</cmdline>
    <boot dev='hd'/>
share|improve this answer
Thank you for answer. Sorry, But i missed some words, 'live migration' in the question. As i know, with above approach I have to restart a VM to apply the change in the XML file. It will prevent to do seamless service. – jinhwan Apr 1 '13 at 5:51
Correct this approach would require a restart. If you're moving the VM from one IP to another I do not see how you'll be able to maintain "seamless" service, any existing connections will get a TCP timeout do to the IP change. – slm Apr 1 '13 at 12:44
I'm assuming web service or that kinds of service, short connection and small 'seam' is not big deal. Writing why i'm finding this weird approach will be helpful for clarify my question. I'll add more words for it. – jinhwan Apr 2 '13 at 1:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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