[sdk] specify mac address when creating ports with nova

Sean Mooney smooney at redhat.com
Tue Jun 7 14:26:22 UTC 2022


On Tue, 2022-06-07 at 09:51 -0400, jdratlif at globalnoc.iu.edu wrote:
> When using connection.compute.create_server(), what is the structure of the
> networks parameter?
> 
>  
> 
> I see in the example is a list of objects with a single key in the list
> being the uuid of the network. I know there are other parameters that could
> be in this list though. The os-migrate ansible playbooks add fixed_ip to
> this. fixed_ip is not a Network or a Port class parameter. Port has
> fixed_ips, but that would be a list. I want to add mac address to this port,
> but I'm not sure if that's possible or what key I would need to add.

this is not something that shoudl be added to the sdk or nova.

id you want to create a vm with a set of ports with specific mac or fixed ips you shoudl first
precreate the port in neutron with the relevent setting applied and then create teh server
with a list of neutron port uuids.

nova has legacy proxy apis for create vms with interfaces on spefic neturon networks or subnets but we do not plan to extend
them to allow any finer grained contol then is there today
https://docs.openstack.org/nova/latest/contributor/project-scope.html#no-more-api-proxies

"""
No more API Proxies¶

Nova API current has some APIs that are now (in kilo) mostly just a proxy to other OpenStack services. If it were possible to remove a public API,
these are some we might start with. As such, we don’t want to add any more.

The first example is the API that is a proxy to the Glance v1 API. As Glance moves to deprecate its v1 API, we need to translate calls from the old v1
API we expose, to Glance’s v2 API.

The next API to mention is the networking APIs, in particular the security groups API. Most of these APIs exist from when nova-network existed and the
proxies were added during the transition. However, security groups has a much richer Neutron API, and if you use both Nova API and Neutron API, the
mismatch can lead to some very unexpected results, in certain cases.

Our intention is to avoid adding to the problems we already have in this area.
"""

the sdk shoudl likel avoid introduceding simiarl proxy apis.

os-migrate shoudl simple use the neutron port apis in the sdk to create the ports on the migrate neutron netowrks with the fixed ips and macs that are
required and then boot the vms with those ports instead of encodeign this in the sdk. this is they type of logic that shoudl live in the calling
application (os-migrate) not in the sdk its self.
> 
>  
> 
> Is the structure of the networks object documented somewhere?
> 
>  
> 
> Thanks
> 
>  
> 
> ---
> 
> John Ratliff
> 
> Systems Automation Engineer 
> 
> GlobalNOC @ Indiana University
> 
>  
> 




More information about the openstack-discuss mailing list