vSphere

 View Only
  • 1.  how to assign a mac-address manually via the SDK

    Posted Nov 10, 2009 12:44 PM

    Hi all,

    I want to add a NIC to an instance of a VM via the vSphere API for Perl with a MAC Address choosen from "me".

    I do not want, that the vCenter assign the MAC automatically, what is the default.

    I'm frustrated because I did not find anything in the internet.

    Can anyone help me?

    Thanks in advance,

    Henning



  • 2.  RE: how to assign a mac-address manually via the SDK
    Best Answer

    Broadcom Employee
    Posted Nov 10, 2009 02:50 PM

    You'll need to call the ReconfigVM_Task specify a configuration spec of adding a new device of type VirtualEthernetCard and when adding the new vNIC, you have the option of specifying how the MAC Address will be generated: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.device.VirtualEthernetCard.html You'll need to set the addressType to manual and macAddress to the MAC Address string you want to set, remember that the MAC address must be in the range of 00:50:56:00:00:00-00:50:56:3F:FF:FF

    =========================================================================

    William Lam

    VMware vExpert 2009

    VMware ESX/ESXi scripts and resources at:

    Twitter: @lamw

    VMware Code Central - Scripts/Sample code for Developers and Administrators

    VMware Developer Comuunity

    If you find this information useful, please award points for "correct" or "helpful".