[one-users] Create a VM with specific MAC address

Javier Fontan jfontan at opennebula.org
Wed May 29 09:55:28 PDT 2013


In your VM template you can specify an IP or a MAC in the NIC section:

NIC=[NETWORK=private,MAC=02:00:01:02:03:04]

But beware as this will also set the IP, last 4 bytes. The mac needs
to be in the network pool.

The easiest way is to set the the IP and let it generate the mac address:

PREFIX+IP=MAC

By default PREFIX is 02:00. IP will be added afterwards, the last 4
bytes. For example, IP 10.0.0.1:

02:00 + 10.0.0.1 (0a:00:00:01) = 02:00:0a:00:00:01



On Wed, May 29, 2013 at 6:21 PM, Dmitri Chebotarov <dchebota at gmu.edu> wrote:
>
> Hi
>
> Is there a way to create a VM with specific MAC address?
> In my case I have a template with two NICs, running 'onetemplate instantiate <template_id> <file>'  to create new VM.
> In <file> I've tried using different values in attempt to specify either MAC address or IP address for ETH0.
> I've used CONTEXT=[EHT0_IP=<ip>,ETH0_MAC=<mac>]. Both VARs passed onto new VM, but IP address is still assigned automatically from the network pool.
>
> I'm trying to integrate an application which tracks VMs based on IP/MAC address.
>
> --
> Thank you,
>
> Dmitri Chebotarov
> VCL Sys Eng, Engineering & Architectural Support, TSD - Ent Servers & Messaging
> 223 Aquia Building, Ffx, MSN: 1B5
> Phone: (703) 993-6175 | Fax: (703) 993-3404
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org



-- 
Join us at OpenNebulaConf2013 in Berlin from the 24th to the 26th of
September 2013!

Javier Fontán Muiños
Project Engineer
OpenNebula - The Open Source Toolkit for Data Center Virtualization
www.OpenNebula.org | jfontan at opennebula.org | @OpenNebula



More information about the Users mailing list