diff options
| author | Tushar Patil <tushar.vitthal.patil@gmail.com> | 2011-09-16 15:22:14 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-09-16 15:22:14 +0000 |
| commit | 895e776fcb8d4f961ef52b7dd20bc1964d248538 (patch) | |
| tree | 5b9c8c674c3db8038f65c3d2453395bac9828c68 | |
| parent | 23fefd17727966b0a1397f40b25bedcd668206d7 (diff) | |
| parent | ecd77c06d47f79d6c6341a0407e68507468553a4 (diff) | |
I am using iputils-arping package to send arping command.
You will need to install this package on the network nodes using apt-get command
apt-get install iputils-arping
| -rwxr-xr-x | nova/network/linux_net.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py index 7d89b2bcc..e693e5939 100755 --- a/nova/network/linux_net.py +++ b/nova/network/linux_net.py @@ -68,6 +68,8 @@ flags.DEFINE_string('linuxnet_interface_driver', 'Driver used to create ethernet devices.') flags.DEFINE_string('linuxnet_ovs_integration_bridge', 'br-int', 'Name of Open vSwitch bridge used with linuxnet') +flags.DEFINE_bool('send_arp_for_ha', False, + 'send gratuitous ARPs for HA setup') flags.DEFINE_bool('use_single_default_gateway', False, 'Use single default gateway. Only first nic of vm' ' will get default gateway from dhcp server') @@ -407,6 +409,10 @@ def bind_floating_ip(floating_ip, check_exit_code=True): _execute('ip', 'addr', 'add', floating_ip, 'dev', FLAGS.public_interface, run_as_root=True, check_exit_code=check_exit_code) + if FLAGS.send_arp_for_ha: + _execute('arping', '-U', floating_ip, + '-A', '-I', FLAGS.public_interface, + '-c', 1, run_as_root=True, check_exit_code=False) def unbind_floating_ip(floating_ip): @@ -478,6 +484,10 @@ def initialize_gateway_device(dev, network_ref): check_exit_code=False) if err and err != 'RTNETLINK answers: File exists\n': raise exception.Error('Failed to add ip: %s' % err) + if FLAGS.send_arp_for_ha: + _execute('arping', '-U', network_ref['gateway'], + '-A', '-I', dev, + '-c', 1, run_as_root=True, check_exit_code=False) if(FLAGS.use_ipv6): _execute('ip', '-f', 'inet6', 'addr', 'change', network_ref['cidr_v6'], |
