Automic Workload Automation

 View Only

List MAC Address for each Network Adapter of a specific VM

  • 1.  List MAC Address for each Network Adapter of a specific VM

    Posted 28 days ago

    Hi guys and happy Sunday,

    i want to get the MAC Address of all NICs in a VM.

    Scenario.

    I copied a VM (yes copied the files from datastore to a new folder for testing purposes) and registered it to the vCenter; obviously, the MAC resulted as duplicated of the one in the source VM, until i associated a new Portgroup to it.

    Next, infact, VMware checked in its db, founded it was already existing and generated a new one MAC for that NIC.

    When i started the VM Linux created a new entry in the /etc/udev/rules.d/70-persistent-net.rules and, of course i know, there was no more corresponding NAME between ifcfg-eth* and 70-persistent-net.rules.

    I also know that the solution is delete the file 70-, restart the OS, see what's the new NAME for the new MAC Address and assign it on the ifcfg-eth* file.

    I would aotumate the procedure via PowerCLI (i know a little of it).


    Any suggestion?

    It would be very appreciated.


    Thank you in advance.