Earlier  
Posted Nick Remark
#openstack-nova - 2021-05-05
10:14:05 bauzas first, the method looking at the mdevs is called by the libvirt init_host()
10:14:05 bauzas first, the method looking at the mdevs is called by the libvirt init_host()
10:14:49 bauzas which is called *before* the RT update_avalaible_resource()
10:14:49 bauzas which is called *before* the RT update_avalaible_resource()
10:15:04 sean-k-mooney right so you can just use the instance uuid to call https://docs.openstack.org/api-ref/placement/?expanded=list-allocations-detail#list-allocations
10:15:04 sean-k-mooney right so you can just use the instance uuid to call https://docs.openstack.org/api-ref/placement/?expanded=list-allocations-detail#list-allocations
10:15:34 sean-k-mooney that will give you all the allocations by RP
10:15:34 sean-k-mooney that will give you all the allocations by RP
10:15:45 sean-k-mooney for a given consomeer i.e. vm
10:15:46 sean-k-mooney for a given consomeer i.e. vm
10:15:55 bauzas sean-k-mooney: so, in case of a vGPU reshape, the allocation will tell that the RP is the root one
10:15:55 bauzas sean-k-mooney: so, in case of a vGPU reshape, the allocation will tell that the RP is the root one
10:16:10 bauzas (as the reshape is done *after*)
10:16:10 bauzas (as the reshape is done *after*)
10:16:24 bauzas we could tell it's OK
10:16:24 bauzas we could tell it's OK
10:16:33 bauzas but then we have a second concern
10:16:33 bauzas but then we have a second concern
10:16:55 bauzas we don't accept the libvirt driver to call directly Placement API
10:16:55 bauzas we don't accept the libvirt driver to call directly Placement API
10:17:06 bauzas instead, we directly pass allocations to the methods
10:17:06 bauzas instead, we directly pass allocations to the methods
10:17:40 bauzas we could use the provider tree that we have in the driver
10:17:40 bauzas we could use the provider tree that we have in the driver
10:17:47 sean-k-mooney right so either we have to allow the driver to do that or we need to modify init_host to accpet a dict of allocations keyed by instance uuid
10:17:47 sean-k-mooney right so either we have to allow the driver to do that or we need to modify init_host to accpet a dict of allocations keyed by instance uuid
10:18:11 bauzas but, this variable is not yet created by init_host()
10:18:11 bauzas but, this variable is not yet created by init_host()
10:18:37 bauzas sean-k-mooney: I'm not sure we could accept this
10:18:37 bauzas sean-k-mooney: I'm not sure we could accept this
10:18:50 bauzas (allowing the driver to directly call placement)
10:18:50 bauzas (allowing the driver to directly call placement)
10:19:13 bauzas what we could do is maybe the latter
10:19:13 bauzas what we could do is maybe the latter
10:19:35 sean-k-mooney im just pulling up the code in the compute manager now
10:19:35 sean-k-mooney im just pulling up the code in the compute manager now
10:20:09 sean-k-mooney https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L1441-L1443
10:20:09 sean-k-mooney https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L1441-L1443
10:20:19 sean-k-mooney so this is where we end up callint ingo the dirver eventurally right
10:20:19 sean-k-mooney so this is where we end up callint ingo the dirver eventurally right
10:20:26 sean-k-mooney from _init_instanc
10:20:26 sean-k-mooney from _init_instanc
10:21:11 sean-k-mooney for example thsi is where we plug vifs https://github.com/openstack/nova/blob/7953c0197d1a4466cb5b78070d47626c92f9db6e/nova/compute/manager.py#L1137
10:21:11 sean-k-mooney for example thsi is where we plug vifs https://github.com/openstack/nova/blob/7953c0197d1a4466cb5b78070d47626c92f9db6e/nova/compute/manager.py#L1137
10:21:13 bauzas not really
10:21:13 bauzas not really
10:21:24 bauzas rather here https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L1413
10:21:24 bauzas rather here https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L1413
10:21:58 sean-k-mooney right but we do not create the instance until https://github.com/openstack/nova/blob/7953c0197d1a4466cb5b78070d47626c92f9db6e/nova/compute/manager.py#L1204
10:21:58 sean-k-mooney right but we do not create the instance until https://github.com/openstack/nova/blob/7953c0197d1a4466cb5b78070d47626c92f9db6e/nova/compute/manager.py#L1204
10:22:24 bauzas hmmm, I see
10:22:24 bauzas hmmm, I see
10:22:39 sean-k-mooney sorry a few lines above https://github.com/openstack/nova/blob/7953c0197d1a4466cb5b78070d47626c92f9db6e/nova/compute/manager.py#L1195
10:22:39 sean-k-mooney sorry a few lines above https://github.com/openstack/nova/blob/7953c0197d1a4466cb5b78070d47626c92f9db6e/nova/compute/manager.py#L1195
10:22:51 sean-k-mooney so what im thinking is we can extend this function to create the mdevs
10:22:51 sean-k-mooney so what im thinking is we can extend this function to create the mdevs
10:23:02 sean-k-mooney this happesn after the driver init_host is run
10:23:02 sean-k-mooney this happesn after the driver init_host is run
10:23:18 sean-k-mooney so the reshapes would already have run
10:23:18 sean-k-mooney so the reshapes would already have run
10:23:23 bauzas instead of having init_host() calling https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L789
10:23:23 bauzas instead of having init_host() calling https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L789
10:23:36 bauzas we would use init_instance()
10:23:36 bauzas we would use init_instance()
10:23:40 sean-k-mooney yep
10:23:43 bauzas this could work
10:23:43 bauzas this could work
10:24:00 bauzas * bauzas needs to look at what we have in init_instance()
10:24:17 bauzas but then, we could ask its allocations
10:24:17 bauzas but then, we could ask its allocations
10:24:27 bauzas as it's within the compute manager
10:24:27 bauzas as it's within the compute manager
10:24:32 sean-k-mooney it basicaly just plugs vifs and cleans up deleted instance ectra
10:24:32 sean-k-mooney it basicaly just plugs vifs and cleans up deleted instance ectra
10:24:36 sean-k-mooney yep
10:24:56 sean-k-mooney its in the compute manager so we can have it get the allocations
10:24:56 sean-k-mooney its in the compute manager so we can have it get the allocations
10:24:59 bauzas and then, pass the allocation to the virt driver which would use the related RP name for knowing which type
10:24:59 bauzas and then, pass the allocation to the virt driver which would use the related RP name for knowing which type
10:25:09 sean-k-mooney we might need to extend the dirver interface and add an optional funciton
10:25:09 sean-k-mooney we might need to extend the dirver interface and add an optional funciton
10:25:25 sean-k-mooney which we woudl call that take the instnace and allcoations
10:25:25 sean-k-mooney which we woudl call that take the instnace and allcoations
10:25:41 bauzas yup, I see it
10:25:41 bauzas yup, I see it
10:25:44 bauzas sean-k-mooney: thanks
10:25:51 sean-k-mooney the libvirt implemation of that could prepare_resouces_for_instance(uuid, allocation)
10:25:51 sean-k-mooney the libvirt implemation of that could prepare_resouces_for_instance(uuid, allocation)
10:26:21 bauzas yup, better than recreate_mdev() which is too specific
10:26:21 bauzas yup, better than recreate_mdev() which is too specific
10:26:52 sean-k-mooney yep not sure if we will use it for anything else but it at least allows us to if we need too in the future
10:26:52 sean-k-mooney yep not sure if we will use it for anything else but it at least allows us to if we need too in the future
10:26:57 bauzas OK, I see it, lemme work on it
10:26:57 bauzas OK, I see it, lemme work on it
10:26:59 bauzas thanks
10:26:59 bauzas thanks
10:29:03 bauzas * bauzas goes to lunch but then will implement this
10:43:59 nightmare_unreal how to change hypervisor state ( not status). It's down . I want it up .
10:43:59 nightmare_unreal how to change hypervisor state ( not status). It's down . I want it up .
10:47:50 sean-k-mooney it will be down for 2 reasons

Earlier   Later