Giter Club home page Giter Club logo

convert-lbfo2set's Introduction

Build status downloads

Notice

We are no longer putting new development effort into Convert-LBFO2SET. The purpose of Convert-LBFO2SET was to help people migrate LBFO-based Hyper-V deployments to SET, the recommended solution when using NIC teaming in conjunction with Hyper-V, SDN, S2D, etc., and to bring awareness to SET for those running Windows Server 2016 and 2019.

Now that LBFO-based Hyper-V deployments are significantly down and with Windows Server 2022, and newer, no longer allowing an LBFO NIC to be attached to a Hyper-V vmSwitch we feel this script has served its purpose.

The Convert-LBFO2SET PowerShell module will remain available until Windows Server 2019 reaches end of mainstream support on 9 January 2024. The module will be retired sometime after that date.

Please note that LBFO itself has not been deprecated, nor is it being removed, in Windows. LBFO should be used for "bare metal", meaning no virtual networking (Hyper-V, SDN/HCI, S2D, etc.) is in use, NIC teaming needs. Things such as, network redundancy on a DC, web server, and so on.

Here is some reading material for those who want to learn more about LBFO, SET, and how they relate to virtual networking:

https://aka.ms/vmq2012

https://aka.ms/vmq2012r2

https://aka.ms/vmq2016

https://aka.ms/vmq2019

https://aka.ms/DownWithLBFO

Overview

For more information, including how to use this tool, please see the Wiki

This tool helps you to migrate a LBFO Team into a SET team. It will also migrate a vSwitch (if added to the LBFO Team) To a new vSwitch on SET including the host and guest vNICs.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

convert-lbfo2set's People

Contributors

blakedrumm avatar corenetbuilder avatar dcuomo avatar jameskehr avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

convert-lbfo2set's Issues

Invalid $NetAdapterNames possible

Spotted a couple of problems in this section.

There is a possible condition where $AllowOutage is $false and there is only a single adapter in $configData.NetLBFOTeam.Memeber that will create an invalid NIC name.

Since $configData.NetLBFOTeam.Members resolves to a string when there is a single member, the result of the operation is char[0] of the string name. Which makes $NetAdapterNames equal to the first letter in the NIC name and will cause an error cascade whenever called.

Commented code below.

`
#region Create new SET team
# jak: alternate condition: $configData.NetLBFOTeam.Members -isnot [Array]
if ($AllowOutage -eq $true -and $configData.NetLBFOTeam.Members.Count -eq 1)
{
$NetAdapterNames = $configData.NetLBFOTeam.Members
$AdapterMigrationNeeded = $false

    # Only one pnIC - Destroy the LBFOTeam
    Remove-NetLbfoTeam -Name $configData.NetLBFOTeam.Name -Confirm:$false
}
else 
{
    <# 
        jak: It's still possible to reach this code with a single LBFO team member, if AllowOutage is $false.

        if ($configData.NetLBFOTeam.Members -is [Array])
        {
            $NetAdapterNames = $configData.NetLBFOTeam.Members[0]
        }
        else
        {
            $NetAdapterNames = $configData.NetLBFOTeam.Members
        }

    #>
    $NetAdapterNames = $configData.NetLBFOTeam.Members[0]
    $AdapterMigrationNeeded = $true

#jak: change $configData.NetLBFOTeam.Members[0] to $NetAdapterNames
    Remove-NetLbfoTeamMember -Name $NetAdapterNames -Team $configData.NetLBFOTeam.Name -Confirm:$False
}`

You also cannot remove the last member of the team. So we need to rethink what to do when -AllowOutage is false and there is only a single LBFO team member. Just in case.

Remove-NetLbfoTeamMember : Cannot remove the only member 'NIC01' of team 'Team1'
At line:30 char:9

  •     Remove-NetLbfoTeamMember -Name $NetAdapterNames -Team $config ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (MSFT_NetLbfoTea...17545E533C96}"):root/StandardCi...tLbfoTeamMember) [Remove-NetLbfoTeamMember], CimException
    • FullyQualifiedErrorId : MI RESULT 4,Remove-NetLbfoTeamMember

Address Hash Migration

How will an LBFO team using Address Hash be migrated to SET?

Option1: Fail a pre-req check and require the user to change the load balancing option prior to continuing?

Option2: Migrate it to the recommended (Hyper-V Port)

Script does not work with Pester v5

With Pester 5.3.3 installed, the script will throw these errors about syntax incompatibilities:

Running tests.
[-] OSValidation.HostOS.HYPER05: Must be Windows Server 2016, or Server 2019 365ms (271ms|93ms)
RuntimeException: Legacy Should syntax (without dashes) is not supported in Pester 5. Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v4
RuntimeException: Legacy Should syntax (without dashes) is not supported in Pester 5. Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v4
ParameterBindingException: Cannot retrieve the dynamic parameters for the cmdlet. Legacy Should syntax (without dashes) is not supported in Pester 5. Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v
4
at , C:\Program Files\WindowsPowerShell\Modules\Convert-LBFO2SET\2022.8.29.35\tests\unit\unit.tests.ps1:10

PowerSHell exits and does not detect OS version

James, could you please take a look at this?

This doesn't appear to work and so it always goes to the exit path which closes powershell. There are two issues:

  1. Not detecting the OS properly leading to the failure path
  2. Exiting PowerShell; IMHO, this should change to a "Write-Error" if we're going to not terminate or 'Throw' with a message if we want to terminate. Personally, i think we should throw since this is a sensitive issue.

image

LACP (Switch Dependent)

Along the same lines as the Address Hash issue, how do we handle LACP (Switch Dependent)? I don't think we can simply force a change. I think the LACP config on the switches need to be removed and LBFO manually changed to switch independent before migration.

LBFOTeam should accept the LBFO vSwitch with the same name

In the scenario below, it's likely that a customer may get confused as the SET Team name will be the same as the vSwitch where as the LBFO Team and LBFO Switch can be different.

We can simplify this behavior by just checking if the Get-NetLBFOTeam contains valid data

image

Persist the vlan configuration when convert LBFO to SET

Hi,

Please persist the vlan configuration on the ManagementOS VMNetworkAdapter when convert LBFO to SET. If we have a Cluster with Live Migration and Cluster Interlink VMNetworkAdatper configured on the VSwitch on different VLANS, the convert process loos the VLAN configuration.

IF the configuration on the LBFO VSwitch is like

Get-VMNetworkAdapterVlan -ManagementOS
Live-Migration Access 210
Cluster Access 220
Host-Parent Untagged

after the convert process the VLANs are not configured like

Live-Migration Untagged
Cluster Untagged
Host-Parent Untagged

Kind Regards
Steve

Testing the Network Card Member count on LBFO Team

Hi,
The script should point to the TeamNicName when evaluating and working with the Networkcard members on the LBFO Team and not the TeamName itself.

When the LBFO Team was created with a different Team Nic Name as the Team Name itself, like

New-NetLbfoTeam -Name "Team2" -TeamNicName "Team2Nic" -TeamMembers "NIC1","NIC2"

then the script break like:

[-] CONTOSO-HVH02: LBFO Team [LBFOTeam1] must be attached to a vSwitch 222ms Expected 'LBFOTeam1', but got $null. 44: $netAdapter.Name | Should be $LBFOTeam at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Convert-LBFO2SET\2020.2.2.5\tests\unit\unit.tests.ps1: line 44

Instead to use the .Name Property on the LBFO Team use the .TeamNics Property

Made a mess of the hyper-v server I ran it on... UPDATE the video in the WIKI and install instructions.

Challenge to get it to run first... (Install problem until I used the TLS1.2 command, Pester old version issue). Finally googled and solved those issues. Ran it as instructed ...Convert-LBFO2SET -lbfoteam TeamName -Setteam NewSwitchname. Pester tests al passed. RESULTS -- Old switch changed from External to Internal with no host nics associated with it but all vnics still attached. New SETSWITCH created as external, associated the physical nics with the new switch but set it to dynamic (old one was set to hyper-v port) and no Vnics attached to it..... RESULT now I need to manually delete and recreate everything.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.