Its possible that ovs-appctl may fail when setting the active slave on a bond if the primary interface is not fully up. The ovs-appctl call should be retried in order to allow time for the primary interface to come up. A failure should be logged if the problem persists.
For example, here ifup is run on ens27f0 and ens2sf1, the two interfaces in a bond, and the failure occurs when setting ens27f0 as the active slave:
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: [2018/10/11 01:50:15 PM] [INFO] running ifup on interface: ens27f1
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: [2018/10/11 01:50:16 PM] [INFO] running ifup on interface: bond1
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: [2018/10/11 01:50:16 PM] [INFO] running ifup on interface: ens27f0
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: [2018/10/11 01:50:16 PM] [INFO] running ifup on interface: ens27f1
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: [2018/10/11 01:50:16 PM] [INFO] Running ovs-appctl bond/set-active-slave ('bond1', 'ens27f0')
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: Traceback (most recent call last):
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: File "/usr/bin/os-net-config", line 10, in <module>
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: sys.exit(main())
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: File "/usr/lib/python2.7/site-packages/os_net_config/cli.py", line 270, in main
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: activate=not opts.no_activate)
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: File "/usr/lib/python2.7/site-packages/os_net_config/impl_ifcfg.py", line 1149, in apply
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: self.bond_primary_ifaces[bond])
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: File "/usr/lib/python2.7/site-packages/os_net_config/__init__.py", line 338, in ovs_appctl
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: self.execute(msg, '/bin/ovs-appctl', action, *parameters)
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: File "/usr/lib/python2.7/site-packages/os_net_config/__init__.py", line 288, in execute
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: processutils.execute(cmd, *args, **kwargs)
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: File "/usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 424, in execute
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: cmd=sanitized_cmd)
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: oslo_concurrency.processutils.ProcessExecutionError: Unexpected error while running command.
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: Command: /bin/ovs-appctl bond/set-active-slave bond1 ens27f0
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: Exit code: 2
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: Stdout: u''
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: Stderr: u'cannot make disabled slave active\novs-appctl: ovs-vswitchd: server returned an error\n'
Oct 11 13:52:05 overcloud-controller-0 os-collect-config: + RETVAL=1
Fix proposed to branch: master /review. openstack. org/610714
Review: https:/