ESXi

 View Only
  • 1.  vswitch lose physical adapters after reboot

    Posted Mar 19, 2019 05:28 PM

    vswitch lose physical adapters after reboot

    I created 4 standard vswitches with five NIC (one is spare).
    I dedicated to each vswitch one NIC.

    it's working fine until reboot.

    After reboot two vswitch lose physical adapters in topology, so they are also not working anymore.
    From 4 standard vswitches 2 of them lose NIC's, two of them are still working fine.

    Now, from web client - I can't add NIC to this switches and I can't delete vswitch (any vswitch - also not the one that are working fine!)

    But I can "manualy" add uplink - NIC to vswitch
    via putty it's posibly to add NIC back to topology with command: esxcli network vswitch standard uplink add --uplink-name=vusb0 --vswitch-name=ORANGE

    and then again, after reboot same 2 vswitches lose same NIC's.

    It's a fresh instalation of ESXi 6,7:

    Client version: 1.25.0

    Client build number: 7872652

    ESXi version: 6.7.0

    ESXi build number: 8169922

    Thank you form your help.



  • 2.  RE: vswitch lose physical adapters after reboot

    Posted Mar 19, 2019 08:32 PM

    Hi jiwmware and welcome to the community!

    When you say “not working” do you mean they are showing as disconnected or that network traffic doesn’t pass over them? Does normal service resume after a period of time of the server being running?

    Kind regards.



  • 3.  RE: vswitch lose physical adapters after reboot

    Posted Mar 19, 2019 08:39 PM

    not working mean that in topology there is no NIC adapter

    and also

    that ping not workind throu this NIC

    now is "No physical adapters" before reboot there were NIC, whish I assigned it to vswitch



  • 4.  RE: vswitch lose physical adapters after reboot

    Posted Mar 19, 2019 08:34 PM

    I tried to make backup:

    vim-cmd hostsvc/firmware/sync_config

    vim-cmd hostsvc/firmware/backup_config

    and I find out that result after restore host configuration: 

    vim-cmd -d info /hostsvc/firmware/restore_config /tmp/configBundle.tgz force

    or

    vim-cmd /hostsvc/firmware/restore_config /tmp/configBundle.tgz force

    network of the host went to the same state as after reboot,

    so

    2 vswitches have NIC other two don't have NIC attached to vswitch.

    Probably becouse restore command make automatic reboot after restore of the host.



  • 5.  RE: vswitch lose physical adapters after reboot

    Posted Mar 19, 2019 08:41 PM

    I’m assuming you checked that the backup file timestamps have changed before the restore is run? Sounds like the issue is the configuration is not fully committed before the backup/restore is run.

    Kind regards.



  • 6.  RE: vswitch lose physical adapters after reboot

    Posted Mar 19, 2019 08:44 PM

    It looks to me, that something happen with NIC's or vswitch after reboot.

    Everything's working fine until reboot.

    btw.

    I have:
    1x Intel NIC

    2x usb 3.0 NIC

    2x Startech USB 3.0 NIC (Double NIC in one adapter)



  • 7.  RE: vswitch lose physical adapters after reboot

    Posted Mar 19, 2019 08:50 PM

    this is result after reboot - ORANGE and BLUE have no uplinks (no NIC's)

    Before reboot ORANGE and BLUE have both assigned NIC's and both woreked (also VM)



  • 8.  RE: vswitch lose physical adapters after reboot
    Best Answer

    Posted Mar 23, 2019 05:20 PM

    I found the solution on website: VMware Labs - Flings

    and I'm sharing my solution.

    Do you want Persisting USB NIC Bindings ?

    They say:
    It's a problem that there is currentlya limitation in ESXi where USB NIC bindings are picked up much later in the boot process and to ensure settings are preserved upon a reboot, the following needs to be added to /etc/rc.local.d/local.sh based on your configurations.

    my solution/local.sh file is:

    #!/bin/sh

    # local configuration options

    # Note: modify at your own risk!  If you do/use anything in this

    # script that is not part of a stable API (relying on files to be in

    # specific places, specific tools, specific output, etc) there is a

    # possibility you will end up with a broken system after patching or

    # upgrading.  Changes are not supported unless under direction of

    # VMware support.

    # Note: This script will not be run when UEFI secure boot is enabled.

    #

    # Note: STARTECH USB 3.0 USB-1 vusb0

    # -------------------------------------------------

    vusb0_status=$(esxcli network nic get -n vusb0 | grep 'Link Status' | awk '{print $NF}')

    count=0

    while [[ $count -lt 20 && "${vusb0_status}" != "Up" ]] ]

    do

        sleep 10

        count=$(( $count + 1 ))

        vusb0_status=$(esxcli network nic get -n vusb0 | grep 'Link Status' | awk '{print $NF}')

    done

    if [ "${vusb0_status}" = "Up" ]; then

        esxcfg-vswitch -L vusb0 ORANGE

        esxcfg-vswitch -M vusb0 -p "Management Network" ORANGE

        esxcfg-vswitch -M vusb0 -p "VM Network" ORANGE

    #

    # Note: create portgroups

    # -------------------------------------------------

    esxcli network vswitch standard portgroup add --portgroup-name=ORANGE-portgrup --vswitch-name=ORANGE

    esxcli network vswitch standard portgroup add --portgroup-name=BLUE-portgrup --vswitch-name=BLUE

    esxcli network vswitch standard portgroup add --portgroup-name=RED-portgrup --vswitch-name=RED

    esxcli network vswitch standard portgroup add --portgroup-name=GREEN-portgroup --vswitch-name=vSwitch0

    #

    # Note: create vSwitches

    # -------------------------------------------------

    esxcli network vswitch standard uplink add --uplink-name=vusb0 --vswitch-name=ORANGE

    esxcli network vswitch standard uplink add --uplink-name=vusb1 --vswitch-name=BLUE

    esxcli network vswitch standard uplink add --uplink-name=vmnic32 --vswitch-name=RED

    fi

    #

    # Note: STARTECH USB 3.0 USB-2 vusb1

    # -------------------------------------------------

    vusb1_status=$(esxcli network nic get -n vusb1 | grep 'Link Status' | awk '{print $NF}')

    count=0

    while [[ $count -lt 20 && "${vusb1_status}" != "Up" ]] ]

    do

        sleep 10

        count=$(( $count + 1 ))

        vusb1_status=$(esxcli network nic get -n vusb1 | grep 'Link Status' | awk '{print $NF}')

    done

    if [ "${vusb1_status}" = "Up" ]; then

        esxcfg-vswitch -L vusb1 BLUE

        esxcfg-vswitch -M vusb1 -p "Management Network" BLUE

        esxcfg-vswitch -M vusb1 -p "VM Network" BLUE

    fi

    #

    # Note: GIGALAN GLAABIT USB 3.0 USB-3 vmnic32

    # -------------------------------------------------

    vmnic32_status=$(esxcli network nic get -n vmnic32 | grep 'Link Status' | awk '{print $NF}')

    count=0

    while [[ $count -lt 20 && "${vmnic32_status}" != "Up" ]] ]

    do

        sleep 10

        count=$(( $count + 1 ))

        vmnic32_status=$(esxcli network nic get -n vmnic32 | grep 'Link Status' | awk '{print $NF}')

    done

    if [ "${vmnic32_status}" = "Up" ]; then

        esxcfg-vswitch -L vmnic32 RED

        esxcfg-vswitch -M vmnic32 -p "Management Network" RED

        esxcfg-vswitch -M vmnic32 -p "VM Network" RED

    fi

    exit 0



  • 9.  RE: vswitch lose physical adapters after reboot

    Posted Jan 17, 2023 09:14 AM

    Hi I am having the same issue and tried to follow your configuration with the local.sh file but i only have 2 usb nic and the current on board and i tried to edit the config to fit my setup. I even named them the same. eg; ORANGE and BLUE but it fails on reboot.

    this is how i have setup the local.sh file and i am sure i went wrong somewhere and i was hoping you could help me write one up to work with my nic setup. i have tried both esxi 7u3g and 8 and both with no luck after reboot.

     

    i have also tried following virten guide to setup but still cant get them persistent, please if you can help, that would be great.

     

    this is how i tried to edit it as you can see i am probably way off.

    #!/bin/sh

    # local configuration options

    # Note: modify at your own risk! If you do/use anything in this

    # script that is not part of a stable API (relying on files to be in

    # specific places, specific tools, specific output, etc) there is a

    # possibility you will end up with a broken system after patching or

    # upgrading. Changes are not supported unless under direction of

    # VMware support.

    # Note: This script will not be run when UEFI secure boot is enabled.

    #

    # Note: STARTECH USB 3.0 USB-1 vusb0

    # -------------------------------------------------

    vusb0_status=$(esxcli network nic get -n vusb0 | grep 'Link Status' | awk '{print $NF}')

    count=0

    while [[ $count -lt 20 && "${vusb0_status}" != "Up" ]] ]

    do

    sleep 10

    count=$(( $count + 1 ))

    vusb0_status=$(esxcli network nic get -n vusb0 | grep 'Link Status' | awk '{print $NF}')

    done

    if [ "${vusb0_status}" = "Up" ]; then

    esxcfg-vswitch -L vusb0 ORANGE

    esxcfg-vswitch -M vusb0 -p "Management Network" ORANGE

    esxcfg-vswitch -M vusb0 -p "VM Network" ORANGE

    #

    # Note: create portgroups

    # -------------------------------------------------

    esxcli network vswitch standard portgroup add --portgroup-name=ORANGE-portgrup --vswitch-name=ORANGE

    esxcli network vswitch standard portgroup add --portgroup-name=BLUE-portgrup --vswitch-name=BLUE

    #

    # Note: create vSwitches

    # -------------------------------------------------

    esxcli network vswitch standard uplink add --uplink-name=vusb0 --vswitch-name=ORANGE

    esxcli network vswitch standard uplink add --uplink-name=vusb1 --vswitch-name=BLUE

    fi

    #

    # Note: STARTECH USB 3.0 USB-2 vusb1

    # -------------------------------------------------

    vusb1_status=$(esxcli network nic get -n vusb1 | grep 'Link Status' | awk '{print $NF}')

    count=0

    while [[ $count -lt 20 && "${vusb1_status}" != "Up" ]] ]

    do

    sleep 10

    count=$(( $count + 1 ))

    vusb1_status=$(esxcli network nic get -n vusb1 | grep 'Link Status' | awk '{print $NF}')

    done

    if [ "${vusb1_status}" = "Up" ]; then

    esxcfg-vswitch -L vusb1 BLUE

    esxcfg-vswitch -M vusb1 -p "Management Network" BLUE

    esxcfg-vswitch -M vusb1 -p "VM Network" BLUE

    fi

    exit 0

     

    at the moment i have just created vswitch as i keep failing i thought i would get vswitch working frst after reboot and then i can add vms to them and give them IP etc or create networks with them.

     

    i have 

    vSwitch0 - Internal NIC

    ORANGE - vusb0

    BLUE - vusb1