VMware Cloud Community
karlg100
Contributor
Contributor
Jump to solution

using CLI tools to reconfigure static mac address on VM?

i've been poking around the CLI tools and perl scripts, and don't see an easy way to reconfigure a VM's staticly assigned MAC address from the CLI. Does anyone know any useful tricks to do this with the CLI?

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

Yes/No, no canned VMware scripts exists today that help with this specific operation but you can create your own script using the vSphere API to do so and any of the operations that can be performed using the APIs.

Here is a script that I wrote awhile back and just modified to assist with manually assigning a valid MAC Address for a given VM -

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

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 Community

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

View solution in original post

0 Kudos
3 Replies
RParker
Immortal
Immortal
Jump to solution

The MAC address are consistent for vMotion and will not change. You can only assign static MAC's in the range 00:50:50...00 - ... FF:FF:FF so you can't just use any MAC you want.

So once you assign a MAC, assuming you don't clone or delete the VM, that MAC will stay with that VM.

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

Yes/No, no canned VMware scripts exists today that help with this specific operation but you can create your own script using the vSphere API to do so and any of the operations that can be performed using the APIs.

Here is a script that I wrote awhile back and just modified to assist with manually assigning a valid MAC Address for a given VM -

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

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 Community

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

0 Kudos
karlg100
Contributor
Contributor
Jump to solution

William,

Perfect! i think this is exactly what i'm looking for! thanks!!!!

Karl

0 Kudos