-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add deleting cells automation #846
Add deleting cells automation #846
Conversation
Still require more testing and adding more func/kuttle tests |
f67ed5e
to
8fc5a10
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use this locally but it fails with:
❯ oc logs nova-cell1-cell-delete-tw8ts
+ sudo -E kolla_set_configs
sudo: unable to send audit message: Operation not permitted
INFO:__main__:Loading config file at /var/lib/kolla/config_files/config.json
INFO:__main__:Validating config file
INFO:__main__:Kolla config strategy set to: COPY_ALWAYS
INFO:__main__:Copying service configuration files
INFO:__main__:Deleting /etc/nova/nova.conf
INFO:__main__:Copying /var/lib/openstack/config/nova-blank.conf to /etc/nova/nova.conf
INFO:__main__:Setting permission for /etc/nova/nova.conf
INFO:__main__:Copying /var/lib/openstack/config/01-nova.conf to /etc/nova/nova.conf.d/01-nova.conf
INFO:__main__:Setting permission for /etc/nova/nova.conf.d/01-nova.conf
INFO:__main__:Copying /var/lib/openstack/bin/delete_cell.sh to /bin/delete_cell.sh
INFO:__main__:Setting permission for /bin/delete_cell.sh
INFO:__main__:Copying /var/lib/openstack/config/my.cnf to /etc/my.cnf
INFO:__main__:Setting permission for /etc/my.cnf
INFO:__main__:Writing out command to execute
++ cat /run_command
+ CMD=/bin/ensure_cell_mapping.sh
+ ARGS=
+ sudo kolla_copy_cacerts
sudo: unable to send audit message: Operation not permitted
+ [[ ! -n '' ]]
+ . kolla_extend_start
+ echo 'Running command: '\''/bin/ensure_cell_mapping.sh'\'''
Running command: '/bin/ensure_cell_mapping.sh'
+ umask 0022
+ exec /bin/ensure_cell_mapping.sh
/usr/local/bin/kolla_start: line 22: /bin/ensure_cell_mapping.sh: No such file or directory
6c7718b
to
c7e80ca
Compare
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/4f7309eceb0b40788c94630721b7dbec ❌ openstack-meta-content-provider NODE_FAILURE Node request 100-0007561214 failed in 0s |
c7e80ca
to
8d09b32
Compare
recheck |
Tried this again locally by deleting cell1. I see two issues:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found more leftovers. See inline.
Also we need to call cleanServiceFromNovaDb in the reconcileDelete of the NovaConductor to ensure that the nova service is also deleted form the nova api DB. |
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/2009990370ba428c97acb4d073f5198b ✔️ openstack-meta-content-provider SUCCESS in 2h 31m 38s |
8d09b32
to
eb8a8b0
Compare
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/c15b74bd5d604f8885fe61832ad48869 ✔️ openstack-meta-content-provider SUCCESS in 3h 39m 35s |
eb8a8b0
to
b316362
Compare
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/9b2f094508b3481bb79b652b9a624e3b ✔️ openstack-meta-content-provider SUCCESS in 2h 47m 22s |
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
We need to delete only nova finalizer
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I consider this ready now (except the mariadb-operator dependency). I cannot approve it as I wrote a sizeable chunk of fixes for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened trackers for the remaining items
- script: | | ||
oc get -n nova-kuttl-default Secret/nova-cell1-manage-config-data || exit 0 | ||
exit 1 | ||
# TODO(gibi): this needs an openstack-operator change to clean up the cell1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tracked in https://issues.redhat.com/browse/OSPRH-10549 now
Both CR is created by the nova controller for the given cell, so when that cell is deleted the CRs also needs to be deleted. We also need to delete the secret connected to the MariaDBAccount as mariadb-operator does not delete it today. It also added graceful handling of NotFound during resource deletion and refactored the cleanup logic to avoid bugs if the delete needs to be retried. This now depends on the openstack-k8s-operators/mariadb-operator#268 instead of copying that change.
the mariadb-operator dependency now landed, so for me this is ready to go. |
I'm assuming the nova cells use case is unusual enough that the routines here are still needing to deal with MariaDBAccount and MariaDBDatabase explicitly, rather than using the new DeleteDatabaseAndAccountFinalizers routine, is that correct? |
Yes. We do call DeleteDatabaseAndAccountFinalizers but we also need to explicitly delete the MariaDBDatabase CR afterwards as it is owned by the Nova CR but the Nova CR is not going away, just the NovaCell CR, so we cannot rely on the k8s garbage collector to delete the MariaDBDatabase. |
gibis concerns have either been adress, are tracked by a follow up jira issue or we have delegated part of the db handeling to the maraidb operator so clearing this stale review
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mrkisaolamb, SeanMooney The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
0721f8b
into
openstack-k8s-operators:main
close: OSPRH-105