[sdk] specify mac address when creating ports with nova

jdratlif at globalnoc.iu.edu jdratlif at globalnoc.iu.edu
Tue Jun 7 15:12:52 UTC 2022

I'm looking at these docs here. https://docs.openstack.org/openstacksdk/xena/user/proxies/compute.html

There is a create_server() function for the compute object on the connection. It says to pass attrs, which is comprised of properties of the Server class. When I go to the server class, all I see for ports is the networks property, which I can't find any description of.

Assuming I already used neutron to create the ports, how would I tell the create_server function to use those ports? Is this the proxy function you said I shouldn't use anymore? I'm not clear on that.


John Ratliff
Systems Automation Engineer 
GlobalNOC @ Indiana University

-----Original Message-----
From: Sean Mooney <smooney at redhat.com> 
Sent: Tuesday, June 7, 2022 10:26 AM
To: jdratlif at globalnoc.iu.edu; openstack-discuss at lists.openstack.org
Cc: Ratliff, John <jdratlif at iu.edu>
Subject: Re: [sdk] specify mac address when creating ports with nova

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6687 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20220607/3f822f8b/attachment-0001.bin>

More information about the openstack-discuss mailing list