Configurable MAC addresses

Registered by Lorin Hochstein

Users should be able to (optionally) specify the MAC address of an instance NIC at provision time. This is useful for things like license servers where the server will only function if running on a machine with a specific MAC address.

Blueprint information

Status:
Complete
Approver:
Vish Ishaya
Priority:
Low
Drafter:
Nova Network
Direction:
Approved
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
John Garbutt

Related branches

Sprints

Whiteboard

Hi ALL,
This is my investigation about this blueprint.
In the current Openstack logic, the process flow are:
    a) In nova-compute's ComputeManager, the method _run_instance get and set the image/memory/volume info ... for instance(nova/nova/compute/manager.py).
    b) Invoke method _allocate_network to build network info for instance(nova/nova/compute/manager.py). The method will return network_info , it will call method add_virtual_interface through rpc call
    c) Invoke method add_virtual_interface to store MAC address in table nova.virtual_interfaces (nova/nova/network/manager.py)
    d) Invoke compute driver's spawn method to start the spawn of instance.
    e) Compute Driver get the network/memory/cpu info of the instance and then create a new instance.

how to implement the functoion .
   store MAC address to DB
   a) add a method to reserve key pair MAC address and instance uuid , in nova/nova/network/manager.py
   b) modify method add_virtual_interface , to find if the instance has a reserved MAC address before store it to DB, if have one ,just use it ,otherwise use the one generated by openstack.

   How to pass the MAC address to network manager
   c) get MAC address before invoke method _allocate_network in nova/nova/compute/manager.py
   d) pass MAC address to _allocate_network with default vale None.
   e) in method _allocate_network , through a rpc call to invoke method in step a

please share with your opinion :)

Quantum already allows you to do this: you create a port on the network you're planning to attach to, specify a MAC associated with that port, and then specify that port when you boot the VM. Not elegant but it does work. -- ijw-ubuntu.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.