# Everything is configured start vpp
VPPUtil.start(node)
+
def autoconfig_dryrun(ask_questions=True):
"""
Execute the dryrun function.
acfg.ipv4_interface_setup()
-def autoconfig_create_vm():
+def autoconfig_create_iperf_vm():
"""
Setup IPv4 interfaces
"""
acfg = AutoConfig(rootdir, VPP_AUTO_CONFIGURATION_FILE)
- acfg.create_and_bridge_virtual_interfaces()
+ acfg.destroy_iperf_vm('iperf-server')
+ acfg.create_and_bridge_iperf_virtual_interface()
+ acfg.create_iperf_vm('iperf-server')
def autoconfig_not_implemented():
basic_menu_text = '\nWhat would you like to do?\n\n\
1) List/Create Simple IPv4 Setup\n\
+2) Create an iperf VM and Connect to VPP an interface\n\
9 or q) Back to main menu.'
- # 1) List/Create Simple IPv4 Setup\n\
- # 2) List/Create Create VM and Connect to VPP interfaces\n\
- # 9 or q) Back to main menu.'
-
-
print "{}".format(basic_menu_text)
input_valid = False
answer = autoconfig_basic_test_menu()
if answer == '1':
autoconfig_ipv4_setup()
- # elif answer == '2':
- # autoconfig_create_vm()
+ elif answer == '2':
+ autoconfig_create_iperf_vm()
elif answer == '9' or answer == 'q':
return
else:
global rootdir
- logging.basicConfig(level=logging.ERROR)
-
distro = VPPUtil.get_linux_distro()
if distro[0] == 'Ubuntu':
rootdir = '/usr/local'
(os.path.isfile(VPP_REAL_GRUB_FILE) is True):
autoconfig_cp(node, VPP_REAL_GRUB_FILE, '{}'.format(rootdir + VPP_GRUB_FILE))
+ # Be sure the uio_pci_generic driver is installed
+ cmd = 'modprobe uio_pci_generic'
+ (ret, stdout, stderr) = VPPUtil.exec_command(cmd)
+ if ret != 0:
+ logging.warning('{} failed on node {} {}'. format(cmd, node['host'], stderr))
+
+# noinspection PyUnresolvedReferences
def execute_with_args(args):
"""
Execute the configuration utility with agruments.
if not os.geteuid() == 0:
sys.exit('\nPlease run the VPP Configuration Utility as root.')
+ if len(sys.argv) > 1 and ((sys.argv[1] == '-d') or (sys.argv[1] == '--debug')):
+ logging.basicConfig(level=logging.DEBUG)
+ else:
+ logging.basicConfig(level=logging.ERROR)
+
# If no arguments were entered, ask the user questions to get the main parameters
if len(sys.argv) == 1:
- # Main menu
+ autoconfig_main()
+ return
+ elif len(sys.argv) == 2 and (sys.argv[1] == '-d' or sys.argv[1] == '--debug'):
autoconfig_main()
return
if __name__ == '__main__':
-
config_main()