VMware

This Question is Answered

2 "helpful" answers available (6 pts)
1 Replies Last post: Nov 10, 2009 6:50 AM by lamw  

how to assign a mac-address manually via the SDK posted: Nov 10, 2009 4:43 AM

Click to view schue's profile Novice 5 posts since
Nov 3, 2009

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

Re: how to assign a mac-address manually via the SDK

1. Nov 10, 2009 6:50 AM in response to: schue
Click to view lamw's profile Champion vExpert 3,507 posts since
Nov 27, 2007
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: http://engineering.ucsb.edu/~duonglt/vmware/
Twitter: @lamw
vGhetto Script Repository
Getting Started with the vMA (tips/tricks)
Getting Started with the vSphere SDK for Perl
VMware Code Central - Scripts/Sample code for Developers and Administrators
VMware Developer Comuunity

http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg

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

Developer Social Media

Communities