Friday, 2025-03-14

gokhanhello folks, we are using nova with ceph backend. Sometimes we are getting  "nova-compute: Got no allocation candidates from the Placement API. This could be due to insufficient resources or a temporary occurrence as compute nodes start up" warnings. when I look at the resource provider inventory list, hosts DISK_GB value is not correct. Only one host shows corresct value as ceph pool capacity. https://paste.openstack.org/show/b9g8Js7V63bdf7rKuLqg/ 07:37
gokhan. I want to be sure if this is expected behaviour with ceph. 07:37
fricklergokhan: that does sound like a bug to me, what versions of nova and ceph? probably best create a bug report07:58
gokhanfrickler, nova version is 29.2.0 and ceph is 18.2.2. But in my other deployments which has same version,  DISK_GB on every hosts is correct. 08:02
gokhanfrickler, ohh sorry ceph versions sre different. İt is working with ceph 18.2.4 but with ceph 18.2.2 it is not working. may be there is a known issue 08:06
*** elodilles_pto is now known as elodilles08:19
*** ralonsoh_ is now known as ralonsoh09:49
ishanwarHi Everyone!10:50
ishanwarI am planning to take a shot at this LHF https://bugs.launchpad.net/nova/+bug/202715610:50
ishanwarCan someone help me understand why we invented to use to the neutron quota API here ? Please dont mind me question I am new to nova dev 10:51
ishanwarintend 10:51
ishanwar@Sean-k-mooney @bauzas10:52
sean-k-mooneyishanwar: am short version is today we are pulling the full port object with all the extentions and then counting them in python10:59
sean-k-mooneyto see if we exceed the quota the project has for total ports11:00
sean-k-mooneybut neutron has an api that just returns this as a number11:00
sean-k-mooneyso its much faster to use the dedciated api and less work for both nova and neutron if we do11:00
sean-k-mooneyso this is just a performance optimisation ot reduce the amount of data sent over the wire and reduce the database load on the neutron side11:01
sean-k-mooneyishanwar: so the idea is, 1 try and use the neutron api exteion for quota details, if that works great we can skip the extra work of counting the ports ourselves, if not fall back to what we do today11:02
ishanwarHi Sean 11:06
ishanwarThanks for your response 11:06
ishanwarThe big mentions that the quota api seems to be controlled by Also, the extension seems to be controlled by the cfg.CONF.QUOTAS.quota_driver  config option: https://github.com/openstack/neutron/blob/6fa9142ced0eed8de9a89042747438b93de7202d/neutron/extensions/quotasv2_detail.py#L3711:06
ishanwarSo all neutron servers may not have this, how can we check the availability of the api ? 11:07
sean-k-mooneythere are two way, we can assuem its there and just catch the excption when not and fall back11:11
sean-k-mooneyor we can call the extention list api11:11
sean-k-mooneyhttps://docs.openstack.org/api-ref/network/v2/#show-extension-details11:11
sean-k-mooneyusing the extension list api is probaly better. in either case we have a convention of caching that result in nova11:12
sean-k-mooneylike this https://github.com/openstack/nova/blob/master/nova/network/neutron.py#L1435-L145511:13
ishanwarthanks let me try to gather more details before create a gerrit review request11:39
opendevreviewmitya-eremeev-2 proposed openstack/nova master: Add more thorough handling of evacuated instances  https://review.opendev.org/c/openstack/nova/+/94405813:28
dansmithgibi: I don't understand your response to my comment13:39
dansmith_find_pool() is not where things get sorted into pools, right? It looks through the already-sorted pools and finds the one that _dev_pool (which I think is just the device, right?) matches?13:41
opendevreviewmitya-eremeev-2 proposed openstack/nova master: Remove instance directory on live-migration  https://review.opendev.org/c/openstack/nova/+/94405813:41
gibidansmith: yes, find_pool tries to find a matching pool, the callers of _find_pool creating a logic that if a pool is not found for a dev then a new pool is created for the dev13:47
gibibut as matching logic was broken in _find_pool the upper layer created new pool for the devs13:48
gibiduring deallocation13:48
dansmithohhh, I see okay, let me follow that thread13:48
dansmithsince you're changing it and the allocation part I was mostly linking those in my head (and because _find_pool is almost like _filter_pools)13:49
dansmithso if I comment out the _find_pool() part, I fail this part of the test:13:50
gibiyeah the two changed code path are only linked from afar. the _find_pool runs during new device discovery and device deallocatin (putting back to pool). The _apply runs during scheduling of a VM, the consume codepath runs during the pci claim from the pci tracker in the compute13:50
dansmith# assert that the single pool is not broken into two during the de-allocation13:50
dansmithwhich makes sense based on what you said13:50
gibiyeas13:50
gibiand the _find_pool fix is the only thing that is necessary, the other code change is just safetynet13:51
dansmithgibi: okay and the place where we do that (add a pool if we don't find it) is in add_device()..13:54
dansmithit doesn't look like we run remove_device() when we consume it from the pool or anything,13:54
dansmithso I'm not sure why we're re-running add_device() there, except maybe just as idempotentcy/healing or something?13:55
gibiI think add_device is used both during new device discover at startup and during deallocation when we place the device back to the pool13:56
dansmithI see it used in consume_requests() but the only other place is update_device() which isn't called from here at all13:57
dansmithanyway, it doesn't matter that much because I see the problem now, it just seems confusing to me13:57
dansmithhowever, at least it's consistent with all the other confusing terminology in here (devs, pools, dev_pools, stats, all of which are kinda the same :)13:58
gibi_allocate_devs pops the device from the pool13:59
dansmithwe also call add_device() from _free_device() in compute manager while we're deallocating13:59
gibiduring consume_request13:59
dansmithoh, it doesn't call remove_device() but it removes it some other way?13:59
gibiyeah 13:59
gibi:/13:59
sean-k-mooneythe way we test in teh schduler if a host passes is we call consume_requests on a copy of the pools and just dont save it from Supprots_requests()14:00
gibiliterarily             pci_dev = pool['devices'].pop()14:00
dansmithack14:00
dansmithokay so the add_device is adding it back in after it's no longer used I guess instead of just being marked as in-use...14:00
gibisean-k-mooney: nope, we call _apply, consume is for the pci tracker14:00
gibidansmith: yes that is my understanding14:01
sean-k-mooneyi may have mixed up the names but the point i wanted to make is, we test if we can allcoate the device by trying to do it on a copy of the data)14:01
gibisort of yes14:01
gibieven in the scheduler (host manager) we do an allocation on the stats via apply to allow mutlicreate to see a proper resource availability 14:03
sean-k-mooneyhttps://github.com/openstack/nova/blob/master/nova/pci/stats.py#L779-L82114:03
sean-k-mooneyyep 14:04
gibibah we have 3 entry point not just two:14:05
gibi1. filters do supports_requests https://github.com/openstack/nova/blob/master/nova/scheduler/filters/pci_passthrough_filter.py#L6214:06
gibi2. host manager do apply_request https://github.com/openstack/nova/blob/master/nova/scheduler/host_manager.py#L31314:06
gibi3. pci_tracker do cosume_request https://github.com/openstack/nova/blob/master/nova/pci/manager.py#L31114:06
gibibut you are right 1 is basically 2 on a copy of the pools14:07
sean-k-mooneythat not all of them14:09
sean-k-mooneyit kind of is but14:09
sean-k-mooneyhttps://github.com/openstack/nova/blob/master/nova/scheduler/filters/numa_topology_filter.py#L105-L11214:09
sean-k-mooneynuma_fit_instance_to_host also takes into acocunt the pci requests14:10
gibiyeah that is 1 with extras, it calls support_request and look into the pools as well14:10
sean-k-mooneyya so supprots_request is the entry point from the filters effectivly14:11
gibithis is not for the faint-hearthed14:11
* gibi hopes he used that idiom in the correct context14:12
dansmithyup14:12
sean-k-mooneyi could have sworn that we had factor the common logic out by the way14:14
sean-k-mooneyi.e. that supprot called consume or that support and consume both called apply14:14
sean-k-mooneyi dont recall why that does nto seam to be the case14:14
gibiit needs some divergence as consume needs to return a specific device while apply only decrase pool count14:15
sean-k-mooneyoh right14:15
sean-k-mooneyconsume is what we run on the compute14:15
gibiyepp14:15
sean-k-mooneyits actully operating not just on the ppoos but the pci_device records and selecting the device14:16
dansmithgibi: another thing that seems messy is that we take a thing, which is a dict'ing of an object, and pop out things that we ignore, and then see if "everything else is the same" right?14:16
dansmithseems like we should opt-in to the things that distinguish them so that new things that get added in later don't cause fracturing of the pools if you don't also update the exclusion list14:17
dansmith(or just do this differently)14:17
sean-k-mooneythat would be more maintianable wehn this was first writtin jay was pretty again adding new tag in the future14:18
sean-k-mooneysince then we have added several14:18
sean-k-mooneybtu never really revisited that orgianl approch14:18
gibidansmith: I think the concept is that a pool is a set of devs with a set of common field values. So it is the defintion of the interesting fields is the question here14:19
sean-k-mooneygibi: yep14:20
gibiand yes I share you feeling that ignoring flags is less maintainable than listing interesting flags14:20
dansmithright14:20
gibiI'm not motivated to change this logic in a bugfix though. I can queue up a refactor after it.14:21
sean-k-mooneyand this is what i mean when i say tis placement like a pool is effectivly an rp with and inventory fo common "fungable" dvices14:21
gibiI would even wrap these dev and pool dicts in proper objects in memory (not ovos) for more readability (and mypy)14:22
gibiI'm bit affraid of what can of worms this opens up14:23
gibiand I have the ovo version bump preemptive unit test and refactor series to get back to as well14:24
gibiI need more time for actually writing code14:24
dansmithgibi: no I'm not suggesting you fix it in this bugfix or even later, I'm just lamenting the design14:24
gibidansmith: OK14:24
dansmith_especially_ if it means more mypy in this code :)14:25
gibish*t I have this from the PCI in Placement work remaining as well https://review.opendev.org/q/topic:%22bp/pci-device-spec-cleanup%22 (danger, it contain mypy changes as well)14:26
dansmithgoing on three years old there...14:26
gibiyeah it is sad14:26
sean-k-mooneyya...14:27
sean-k-mooneythis https://review.opendev.org/c/openstack/nova/+/844491 i think was one fo the more valuable changes14:27
sean-k-mooneyalthough the seise of a whole impoved alot of things14:28
gibimaybe in Flamingo :)14:30
gibiless golang more python :)14:31
sean-k-mooney:)14:33
gibiI don't know what is the relationship of flamingos a pythons, who would eat who14:33
dansmithpythons would eat flamingos no doubt14:34
gibicool then. (we have neither this side of the globe)14:35
gibiand gopher (the golang mascot) would definitely loose againts python14:36
* gibi feels better now14:36
opendevreviewBalazs Gibizer proposed openstack/nova master: Reproduce bug/2098496  https://review.opendev.org/c/openstack/nova/+/94167316:03
opendevreviewBalazs Gibizer proposed openstack/nova master: Ignore metadata tags in pci/stats _find_pool logic  https://review.opendev.org/c/openstack/nova/+/94427716:03
opendevreviewBalazs Gibizer proposed openstack/nova master: Ignore metadata tags in pci/stats _find_pool logic  https://review.opendev.org/c/openstack/nova/+/94427716:09
sean-k-mooneywerid i just got a destop notificaiton form a comment gibi made a few hours ago17:12
sean-k-mooneydansmith: not that im disagreeign but dont we test migration with postgres in the tox jobs17:13
sean-k-mooneyi would not try and use it in production17:13
sean-k-mooneybut we do install it with bindep in the tox env17:14
sean-k-mooneyand the opertunistic database stuff should kick in but maybe that broke at some point17:14
sean-k-mooneywe defintlly dont have stong testin gthere as we only really apply the migration ot an empty db17:14
* sean-k-mooney looks if that even runs17:16
sean-k-mooneyya nova.tests.unit.db.main.test_migrations.TestMigrationsWalkPostgreSQL.test_walk_versions is still running in tox17:18
dansmith(back in a sec)17:20
sean-k-mooneydansmith: its not urgent dont worry. teh prostgress test are still runing but obviously those migration tests dont test that much17:21
sean-k-mooneypointing to https://governance.openstack.org/tc/resolutions/20170613-postgresql-status.html is still the best responce17:21
sean-k-mooneyi was just concerned that those opertuneistic tests broke at some point and we missed it but the pg and mysqlone are running in addtion to sqlite17:23
dansmithsean-k-mooney: we do, but not full of real world data17:26
dansmithso maybe I was less than accurate about 'we don't test it' but testing with an empty DB is not really testing IMHO17:27
dansmithit makes sure all the schema SQL is right, but not much else17:27
sean-k-mooneyya so i know we incorrectly set the coration type on at least one of the tables when movign to alembic17:27
sean-k-mooneyso that might cuase some issues only when there is data17:27
sean-k-mooneyor on some locales but not our default17:28
sean-k-mooneyi think neutron had a postgress job up until about a year ago17:28
dansmithIMHO people that want to run postgres are more than welcome to test and fix the things17:30
sean-k-mooneyya i dont think its unreasonable17:31
sean-k-mooneyi just know that it broke for them at some poitn and no one stepped up to fix it so they droped testing17:32
sean-k-mooneyoh wow17:32
sean-k-mooneythey actully dropped postgress code https://github.com/openstack/neutron/commit/16e4f0af89cc67b7a8901bfd357fd49b86de73c817:32
sean-k-mooneyi pointed out to stephen that we techinially still supprot it 17:33
sean-k-mooneywe just dont test it17:33
sean-k-mooneydansmith: im reluctantly +2 but +2 none the same on the one time use device spec18:09
dansmithI will take a reluctant +2 over the alternative thanks :)18:09
sean-k-mooneyi lost that tab like 4 times today....18:09
sean-k-mooneydansmith: by the way you mentioned a crash when you used the qxl device to test this, you might have better luck with somethign like the random number generator or a virtio-blk device18:11
sean-k-mooneyor igb vfs if your qemu supports it18:11
sean-k-mooneyi have had better look with nic/block devices when palying with double passthough then graphics cards18:12
sean-k-mooneynot sure why but just my personal experince18:12
dansmithyeah, no igb on this box's qemu but yeah I need to use a different device18:14
dansmithhonestly it reboots in seconds and I always need to restart nova services after each fail, so it hasn't been so bad :P18:14
sean-k-mooneyif you try e1000 instead i think that will work18:15
sean-k-mooneyit diefenly works with a doubel passthough of a phsyical e1000 nic but i think the virutal ones work too18:15
opendevreviewDan Smith proposed openstack/nova master: Ignore metadata tags in pci/stats _find_pool logic  https://review.opendev.org/c/openstack/nova/+/94427719:13

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!