I configured the bridge which are connected to guests to communicate with outside. And In the guest, i configure gateway to indicate the bridge IP. (currently achieve this with DHCP)
eth0 <--> bridge <--> guest
It's surely works. But when i migrate (live migration), the problem arises. The guest network doesn't work because the gateway in the guest have not changed and the guest consistently indicating the gateway bridge of the source host node. If i can use restarting the guest, it will be easy(editing libvrit xml file or configuring DHCP). But what i want to do live migration. More over i can't use ssh to run command in a guest. Because i supposed not to know the username and the password of the guest. How can i automatically change the gateway of the guest to the appropriate gateway when i do live migration? I thought open vswitch can solve this issue. But it looks like that open vswitch can only change the routing and can't change the gateway of the guest. Problem still there. If there are a way to run a command in the guest without ssh, it will be also appropriate. If i can do that, i could force the DHCP client of the guest to signal DHCPDISCOVERY. But sadly, this way is only available in vmware(VIX api). I can't find corresponding feature in kvm.
add : the bridge have the actual ip and the bridge ip is the gateway for the guest in a host. so there are multiple gateways in one subnet and each host has one gateway per one subnet. I have configured each host to handle NAT for their guests. a guest public ip is handled by their hosts. Why i used this approach is avoiding 'single point of failure' and distributing NAT workload to each hosts. Should i have to throw out above structure to achieve live migration? is it bad approach for constructing virtual machine cluster?