+
+ if bond_slaves:
+ # There seems to be a race somewhere: without this sleep, using
+ # XenCenter to create a bond that becomes the management interface
+ # fails with "The underlying connection was closed: A connection that
+ # was expected to be kept alive was closed by the server." on every
+ # second or third try, even though /var/log/messages doesn't show
+ # anything unusual.
+ #
+ # The race is probably present even without vswitch, but bringing up a
+ # bond without vswitch involves a built-in pause of 10 seconds or more
+ # to wait for the bond to transition from learning to forwarding state.
+ time.sleep(5)