Juniper / wistar

Wistar is a tool to help create and share network topologies of virtual machines. It is designed to be light weight enough to run on a laptop or a small dedicated server.
http://wistar.readthedocs.io/en/latest/
Apache License 2.0
155 stars 41 forks source link

VFP interface types and quantities with KVM #5

Open Epicyon opened 7 years ago

Epicyon commented 7 years ago

Using e1000 for virbr0 and virtio for ge-0/0/* interfaces when using a small number of connections to the vmx ( 2 or less ) causes riot to fail to launch, resulting in the VFP failing to register to the VCP correctly.

This happens because the start_riot.sh script counts the devices by type to determine what to pass to the riot.py launcher and then onto riot.

# How many ports
#i40evf shows up as Device 154c, igbvf and ixgbevf show up as Ethernet Controller Virtual Function
sriov_dev_str="Ethernet Controller Virtual Function\|Device 154c"
vmx_junos_device_type_sriov=$(lspci | grep "$sriov_dev_str" | wc -l)
vmx_junos_device_type_virtio=$(lspci | grep "Virtio network device" | wc -l)
vmx_junos_device_type_e1000=$(lspci | grep "82545" | wc -l)
vmx_junos_device_type_vmxnet3=$(lspci | grep -i "vmxnet3" | wc -l)

if [ $vmx_junos_device_type_sriov -gt 0 ];
then
    numports=$vmx_junos_device_type_sriov
elif [ $vmx_junos_device_type_virtio -gt 2 ];
then
    numports=$(expr $vmx_junos_device_type_virtio - 2)
elif [ $vmx_junos_device_type_e1000 -gt 2 ];
then
    numports=$(expr $vmx_junos_device_type_e1000 - 2)
elif [ $vmx_junos_device_type_vmxnet3 -gt 0 ];
then
    numports=$vmx_junos_device_type_vmxnet3
fi
arg_str=`/home/pfe/riot/get_virtio_argstr $numcpus $numports $fab_enable $pfe_id $vmx_phase`
if [ $? -ne 0 ];
then
    logger -s "vFP Error: $arg_str"
    echo "vFP Error: $arg_str"
    exit 1
fi    

When numports is not greater than 2 the get_virtio_argstr tool can't generate the proper command string for riot.

When riot attempts to launch, it throws this error on the console and to syslog back to the VCP.

Incorrect value for --rx argument (-12)

I see the interface type is driven by the template in ajax/templates/ajax/kvm. I'd submit a pull request if I knew enough about Django to figure out where the value for interface.type is defined, but alas, I don't. I've hardcoded my local template for now to use virtio. Hope this helps.

-James

nembery commented 7 years ago

Thanks for the catch james. I believe this was corrected with commit: e0eccbc8, so you may need to update to latest code from git to verify. I'm also hard coding these values in the js vm_type descriptor file for vpfe.

nembery commented 7 years ago

Re-opening this issue, as it's actually not fixed at all. I'll create an enhancement to ensure we always have at least two revenue ports enabled. We can create a 'hidden' bridge and assign extra ports there until we've reached a minimum port count. for vmx this would be 2. So, if the user only adds 1 port, we'll add a second one to a hidden bridge to ensure the fpc always comes up.