Automation

 View Only
  • 1.  Set-NetworkAdapter for multiple vmnics in a single VM

    Posted May 09, 2022 07:20 AM

    Hi all,

     

    I have been tasked with a (somewhat unusual) migration between vCenters, where I basically have to power down VMs and re-register them in the new vCenter.
    What I need help figuring out is how to set the PortGroup parameter for VMs with multiple nics?

     

    Here is what I have (yes, this is rudimentary, bear with me) :

    Now, this works just fine for VMs with one NIC, but VMs with multiple NICs fail…

    Since most of these are set up with multiple NICS, is there a way to do this?

     

    Let me know if there is any more info needed?
     



  • 2.  RE: Set-NetworkAdapter for multiple vmnics in a single VM

    Posted May 09, 2022 07:51 AM

    You could use a CSV file to contain the migration info

    To export


    To import


    Note that you will have to find some logic for the target portgroup.
    Or do all vNICs on all VMs go to the same portgroup?



  • 3.  RE: Set-NetworkAdapter for multiple vmnics in a single VM

    Posted May 09, 2022 08:07 AM

    ..



  • 4.  RE: Set-NetworkAdapter for multiple vmnics in a single VM

    Posted May 09, 2022 08:09 AM

    In that case you will have to include some logic to assign the correct portgroup on the destination.



  • 5.  RE: Set-NetworkAdapter for multiple vmnics in a single VM

    Posted May 09, 2022 08:10 AM

    Wait, do you mean port groups with the same name in the new vCenter?
    The port group names pre and post migration is identical, meaning I shold be OK.

    Thank you.

     

     

     



  • 6.  RE: Set-NetworkAdapter for multiple vmnics in a single VM
    Best Answer

    Posted May 09, 2022 08:40 AM

    Ah, ok.
    In that case you could do



  • 7.  RE: Set-NetworkAdapter for multiple vmnics in a single VM

    Posted May 09, 2022 08:41 AM

    Thank you!