Earlier  
Posted Nick Remark
#openstack-nova - 2020-08-31
15:58:36 bauzas gibi: I need to balance all the options
15:58:56 bauzas I don't want a pre-filter that would behave different between operations
15:59:16 bauzas so I literrally need to find a way to provide the required information into the request spec object directly
15:59:39 bauzas which would prevent us backports, which is a bit sad unfortunately for my company :/
16:00:36 gibi ohh, so the motivation is backportability
16:03:23 bauzas gibi: not really, I'd say the easier be the better
16:04:00 bauzas I was thinking the physnets be a clean way to do this, but given this TODO, I'm stuck
16:04:21 bauzas so, I'll just provide the networks the best way, and good bye backportability
16:04:29 gibi fixing that TODO would need also an object change I guess, so you would not gain much
16:05:28 sean-k-mooney hi so i was not following due to downstream call
16:05:57 sean-k-mooney bauzas: we cant trust the phsynets in the networking info cache if the network has multiple phsynets
16:06:09 sean-k-mooney unless we fix how we currently do the phsynet lookup
16:06:21 sean-k-mooney so that that is segment aware
16:06:39 bauzas sean-k-mooney: that was gibi's point
16:06:57 bauzas (17:08:49) gibi: bauzas: then I think you have to resolve TODO in the codepath that gather the physnets https://github.com/openstack/nova/blob/b5d48043466b53fbdfe7b93c2e4efd449904e593/nova/network/neutron.py#L2020
16:07:02 sean-k-mooney bauzas: the physnet in the nova vif object are only correct when you have 1 phsynet and transitivly 1 segment on the network
16:07:25 bauzas sean-k-mooney: I was just looking up the network metadata
16:07:42 sean-k-mooney bauzas: right so if we resolve that todo we need also consider the inpact on sriov
16:08:11 sean-k-mooney by the way this is the issue i pointed out before. actully supporting the multi_provider_physnet extension
16:08:17 bauzas sean-k-mooney: https://review.opendev.org/#/c/749068/1/nova/scheduler/request_filter.py@286
16:08:37 bauzas sean-k-mooney: but I used the physnets because that was the quickiest path
16:08:44 bauzas since we don't pass the list of networks
16:08:50 bauzas in the request spec
16:08:54 sean-k-mooney ya so that set of phsynets is not correct for routed networks if you have more then 1 segment
16:09:01 bauzas sure
16:09:02 bauzas so
16:09:16 bauzas what I want is just a way to get a list of networks et voila
16:09:44 bauzas which means I have to augment the RequestSpec object or one of its nested children
16:09:50 sean-k-mooney the pshnets are in the segments not in the networks so you need to list the network then query neutron for the segment to get the phsynet
16:10:09 bauzas again, I don't care of the physnets
16:10:16 bauzas I want to get the segments
16:10:33 sean-k-mooney yes but neutron uses physnets to map host to segments
16:10:44 sean-k-mooney but yes you want the segment
16:11:02 bauzas sean-k-mooney: we have a neutron API for getting the segments that are related to either a network or a physnet
16:11:29 bauzas the original proposal from matt was to get the networks and ask neutron to give the segments
16:11:37 sean-k-mooney yes
16:11:38 bauzas this was easy since he wrote that in the conductor
16:11:51 bauzas and then we directly have the requested networks (or ports)
16:12:02 bauzas but here, we want to make it more generic in a pre-filter
16:12:19 bauzas and in my case, I only have the requestspec object this is passed as argument
16:12:29 bauzas good bye networks and ports
16:12:49 bauzas sean-k-mooney: see my problem and why I went using the physnets ?
16:13:12 sean-k-mooney bauzas: yep i know but just to be clear this will only work for existing vms
16:13:21 sean-k-mooney you cant use phsynets for booting new vms
16:13:48 bauzas sean-k-mooney: well, I can see us populating the network metadata object when creating the instance
16:14:21 bauzas https://github.com/openstack/nova/blob/b5d48043466b53fbdfe7b93c2e4efd449904e593/nova/network/neutron.py#L2082
16:14:25 bauzas but either way
16:14:39 sean-k-mooney when we create teh port with ip allocation policy deffer it wont be bound to a segment or phsynet yet
16:14:40 bauzas I need a way to pass down the requested networks
16:15:38 sean-k-mooney yes
16:16:35 sean-k-mooney so you eighter need to add the requested networks to the resquest spec or to the network_metadta or just add the instnace object but i know we have said no to the instance in the past
16:16:50 sean-k-mooney or jsut pass the instance to the prefilter
16:18:32 sean-k-mooney we dont actully have the instance object where this is called https://github.com/openstack/nova/blob/b5d48043466b53fbdfe7b93c2e4efd449904e593/nova/scheduler/manager.py#L150
16:19:01 bauzas sean-k-mooney: right, because that's in the scheduler
16:19:31 bauzas sean-k-mooney: a simple approach would be to mention the requested networks on the main request spec object
16:19:33 sean-k-mooney sure but the fact we are in schduling means the object exists
16:19:42 sean-k-mooney bauzas: yes
16:19:54 bauzas sean-k-mooney: do you think we would persist those ?
16:20:18 bauzas or should we guess them for a move operation ?
16:20:36 sean-k-mooney the requested networks
16:20:39 bauzas yes
16:20:46 bauzas this is risky
16:20:57 sean-k-mooney if we add them to the request spec and use them we need to update them when we add or remove interfaces
16:21:13 bauzas only when you want a scheduling decision
16:21:13 sean-k-mooney oh
16:21:22 bauzas so, yeah we need to recalculate them
16:21:28 sean-k-mooney is the network info cache populated yet
16:21:36 bauzas no, I don't think
16:21:36 sean-k-mooney we have the instance uuid right
16:21:41 sean-k-mooney damb
16:21:46 bauzas sean-k-mooney: only for the first instance
16:22:14 bauzas sean-k-mooney: but I'd say, just populate this field at boot time based on the base options
16:22:20 sean-k-mooney well select destinations has instance_uuids
16:22:28 bauzas sean-k-mooney: and for a move, just try to get them from the info cach
16:23:00 bauzas sean-k-mooney: I don't want to add a new arg to the filter
16:23:10 bauzas sean-k-mooney: all of this needs to be in the request spec
16:23:13 bauzas but I get your point
16:23:40 sean-k-mooney well we can update the request_spec.instance_uuid field
16:23:48 bauzas we could get the requested networks from the info cache in the scheduler, add them on the fly before calling the pre-filter and wipe them after
16:23:56 bauzas oh please no
16:24:15 sean-k-mooney for i think we already do in once case for multicreate
16:24:21 sean-k-mooney we had to fix someting related to this
16:24:45 sean-k-mooney i think it was the numa toplogy
16:25:47 sean-k-mooney bauzas: yes
16:25:52 sean-k-mooney so if you were to do that
16:25:56 sean-k-mooney i would not add a new fiedl
16:26:08 sean-k-mooney jsut set the info on the object directly
16:26:12 sean-k-mooney that way it wont persist
16:26:23 sean-k-mooney we do that in some places today
16:26:42 sean-k-mooney e.g. request_spec.temp_var = my thing
16:27:09 sean-k-mooney im not sure its the request spec object we do that for but its why we dont error if you set a filed on an ovo that does not exist
16:27:24 sean-k-mooney because nova ocationally stores info in them that is never serialised
16:28:04 gibi you can add a proper ovo field that is not persisted
16:28:10 gibi that would be a bit more readable
16:28:22 sean-k-mooney can you? i did not know that
16:28:28 bauzas surely you can
16:28:41 sean-k-mooney well i was not aware we were already doing that
16:28:57 bauzas the network metadata field, for example :D
16:29:14 bauzas this one is lazy loaded
16:30:10 sean-k-mooney is that contoled by https://github.com/openstack/nova/blob/b5d48043466b53fbdfe7b93c2e4efd449904e593/nova/objects/request_spec.py#L36?

Earlier   Later