| Posted | Nick | Remark | |
|---|---|---|---|
| #openstack-nova - 2022-04-07 | |||
| 12:37:03 | Uggla | I don't think so | |
| 12:37:15 | sean-k-mooney | you have to run the sycn for each db | |
| 12:37:23 | sean-k-mooney | cell0 is kind of special | |
| 12:37:33 | sean-k-mooney | but in general you run the sync per cell | |
| 12:37:50 | sean-k-mooney | devstack should already do this | |
| 12:37:58 | sean-k-mooney | how exactly did it fail | |
| 12:39:35 | Uggla | it seems it doesn't fail. But cell1 has not the share_mapping table and the version within alambic_version table has not evolved. | |
| 12:39:50 | Uggla | I may miss something but .... | |
| 12:40:01 | sean-k-mooney | where did you create it | |
| 12:40:12 | sean-k-mooney | do you have the link to your patch | |
| 12:40:24 | Uggla | sure | |
| 12:40:48 | Uggla | https://review.opendev.org/c/openstack/nova/+/831193 | |
| 12:41:13 | sean-k-mooney | ok you modified the main db model | |
| 12:41:19 | sean-k-mooney | that should be correct | |
| 12:41:32 | sean-k-mooney | i just wanted to make sur eyou did not put it in the api db by mistake | |
| 12:41:35 | Uggla | All tests unit + func looks fine with tox. | |
| 12:42:03 | Uggla | I mean a functional test using the api + db is working fine. | |
| 12:42:30 | Uggla | But on devstack the migration seemed to not fan out to all cell. | |
| 12:42:37 | Uggla | It happens only on cell0 | |
| 12:43:43 | Uggla | sean-k-mooney, we can share a gmeet session, if you would like to see it. | |
| 12:43:45 | sean-k-mooney | the dbs are set up here | |
| 12:43:46 | sean-k-mooney | https://github.com/openstack/devstack/blob/master/lib/nova#L818-L871= | |
| 12:44:56 | Uggla | oh ok I get it . | |
| 12:45:03 | Uggla | If necessary, the --config-file argument can be used to point to the correct nova.conf file for the given cell. | |
| 12:45:52 | sean-k-mooney | yes | |
| 12:46:01 | sean-k-mooney | https://github.com/openstack/devstack/blob/master/lib/nova#L843= | |
| 12:46:09 | sean-k-mooney | is where the db sync shoudl happen for cell 1 | |
| 12:46:23 | sean-k-mooney | using the cell1 conductor config | |
| 12:46:28 | Uggla | I did not understand the doc correctly | |
| 12:47:32 | sean-k-mooney | so we are doing $NOVA_BIN_DIR/nova-manage --config-file $conffile db sync --local_cell | |
| 12:47:55 | sean-k-mooney | --local_cell disables faning out ot other celsl as part of the sync | |
| 12:47:58 | chateaulav | bauzas: great PTG so far! I am otherwise held up today, but i will be there tomorrow just fyi | |
| 12:48:09 | sean-k-mooney | ack | |
| 12:48:34 | sean-k-mooney | Uggla: have you tried runnign that manually | |
| 12:48:39 | Uggla | yep it is a bit ambiguous IMHO. | |
| 12:48:47 | Uggla | I'm gonna try. | |
| 12:49:16 | sean-k-mooney | nova-manage --config-file /etc/nova/nova-conductor-1.conf db sync --local_cell | |
| 12:49:25 | sean-k-mooney | i think that woudl be the right path but its something like that | |
| 12:49:58 | sean-k-mooney | ah its /etc/nova/nova_cell1.conf | |
| 12:51:01 | Uggla | nova-manage --config-file /etc/nova/nova_cell1.conf db sync correct ? | |
| 12:51:06 | sean-k-mooney | yes | |
| 12:51:20 | sean-k-mooney | that is what devstack ran | |
| 12:51:24 | Uggla | ERROR: Could not access cell0. | |
| 12:51:52 | sean-k-mooney | odd... | |
| 12:51:56 | sean-k-mooney | let me try that myself | |
| 12:52:42 | bauzas | chateaulav: no worries | |
| 12:53:18 | Uggla | sean-k-mooney, I got this: https://paste.openstack.org/show/bw9C4K0JEaD2eH2kM3TF/ | |
| 12:53:19 | sean-k-mooney | Uggla: you are missing --local_cell | |
| 12:53:40 | sean-k-mooney | that disablise it trying to connect to cell0 | |
| 12:53:46 | sean-k-mooney | when syncign cell 1 | |
| 12:54:06 | sean-k-mooney | stack@controller:/home/vagrant$ nova-manage --config-file /etc/nova/nova_cell1.conf db sync --local_cell | |
| 12:54:10 | sean-k-mooney | that should work | |
| 12:54:11 | Uggla | sean-k-mooney, sounds good ! I'm gonna check | |
| 12:54:38 | bauzas | correct ^ | |
| 12:55:19 | Uggla | it is ok regarding the tables \o/ | |
| 12:56:06 | sean-k-mooney | so how did you configure devstack to use your patch | |
| 12:56:08 | Uggla | but I'm unclear if this is specific onlyfor devstack ? | |
| 12:56:22 | sean-k-mooney | no you have to do this for all installers | |
| 12:57:09 | sean-k-mooney | nova-manage can try and discover all the cells via the api db technially but that assuem either you store the password in the db which we discurage or you use the same password on all db instances | |
| 12:57:11 | bauzas | https://github.com/openstack/devstack/blob/master/lib/nova#L818 | |
| 12:57:46 | bauzas | and https://github.com/openstack/devstack/blob/master/lib/nova#L847 | |
| 12:58:00 | sean-k-mooney | in generall its simpler to have one config file per cell and run the comand once per cell | |
| 12:58:04 | Uggla | for devstack I use my patch by configuring a git remote on my repo and "pulling" it | |
| 12:58:10 | bauzas | context : https://docs.openstack.org/nova/latest/admin/cells.html#configuring-a-new-deployment | |
| 12:58:27 | sean-k-mooney | Uggla: ok so you set NOVA_REPO and NOVA_BRANCH before you stacked | |
| 12:58:48 | sean-k-mooney | and you did not already have /opt/stack/nova right | |
| 12:58:56 | sean-k-mooney | before you ran stack.sh | |
| 12:59:09 | Uggla | not sorry, I had a already installed devstack and replace the code with mine + restart | |
| 12:59:19 | sean-k-mooney | oh ok | |
| 12:59:41 | sean-k-mooney | so doing sudo systemctl restart devstack@n-* | |
| 12:59:47 | Uggla | yep | |
| 12:59:50 | sean-k-mooney | works only for python changes | |
| 12:59:59 | sean-k-mooney | if you chagne the db you have to manually sync again | |
| 13:00:15 | Uggla | ack | |
| 13:00:43 | sean-k-mooney | 99% of the time we are not touching the db so we dont usually call that out | |
| 13:00:52 | Uggla | do we agree that the doc for db migration is this one: https://docs.openstack.org/nova/latest/admin/upgrades.html | |
| 13:01:07 | sean-k-mooney | yes it is | |
| 13:01:34 | sean-k-mooney | """Using the newly installed nova code, run the DB sync. First run nova-manage api_db sync, then nova-manage db sync. nova-manage db sync should be run for all cell databases, including cell0. If necessary, the --config-file argument can be used to point to the correct nova.conf file for the given cell.""" | |
| 13:01:45 | Uggla | any objection if I propose a minor update to make it clearer ? | |
| 13:02:15 | sean-k-mooney | im not sure what is not clear but sure we can review it | |
| 13:02:28 | sean-k-mooney | its always ok to propose updates to docs ectra | |
| 13:02:34 | sean-k-mooney | we will just review it as normal | |
| 13:02:47 | sean-k-mooney | you could add an example i guess | |
| 13:02:47 | Uggla | sean-k-mooney, that's clearly what I was looking. And I was confuse by the fact that it was not clear for me is all cells will be updated or not. | |
| 13:03:52 | Uggla | And more confuse by that: --local_cell Only sync db in the local cell: do not attempt to fan-out to all cells | |
| 13:03:59 | sean-k-mooney | well it says ""nova-manage db sync should be run for all cell databases"" | |
| 13:04:14 | sean-k-mooney | that imperitive directing you to run it for each cell | |
| 13:05:04 | sean-k-mooney | Uggla: feel free to add a note with examples or other changes if you think it would help make it cleaner | |
| 13:05:11 | Uggla | I agree, but I had the doubt if it was automatic or normal. | |
| 13:07:53 | sean-k-mooney | Uggla: https://github.com/openstack/nova/blob/master/nova/cmd/manage.py#L193-L195= | |
| 13:08:22 | Uggla | sean-k-mooney, clearly I understood it incorrectly. But I think this is mainly due to: "Only sync db in the local cell: do not attempt to fan-out to all cells" --> so without this option I thought it will configure all cells | |
| 13:08:46 | sean-k-mooney | not quite | |
| 13:09:00 | sean-k-mooney | without it it will do cell0 and the curernt cell | |
| 13:09:21 | sean-k-mooney | each nova.conf will only have one cell db configured | |
| 13:09:46 | sean-k-mooney | we do not have the code required to loop over all the cells in the api db and update them automatically | |
| 13:09:57 | sean-k-mooney | so without --local_cell it does cell0 and the local cell | |
| 13:10:04 | sean-k-mooney | with it it only does the local cell | |
| 13:10:09 | sean-k-mooney | cell1 in this case | |
| 13:10:27 | sean-k-mooney | cell0 is speical its not a real cell | |
| 13:10:42 | sean-k-mooney | it used for instance that could not be schduled to a host | |