nova-cloud-controller should periodically perform cleanup of deleted instance records

Bug #2066940 reported by Paul Goins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Nova Cloud Controller Charm
Triaged
Wishlist
Unassigned

Bug Description

The nova database is not automatically trimmed over time. On more heavily-used clouds, this means that the database can significantly bloat in size from all the soft-deleted instances.

OpenStack provides two relevant nova-manage commands for this purpose: "nova-manage db archive_deleted_rows" and "nova-manage db purge".

The nova-cloud-controller charm appears to have an action for the former, and nothing for the latter, but nothing that allows for e.g. "purge any soft-deleted instances older than 90 days".

As a result, without unmanaged intervention, more heavily used environments may suffer from database bloat over time due to the ever-increasing number of soft-deleted instances taking more and more MySQL disk space.

Revision history for this message
Paul Goins (vultaire) wrote :

As a stopgap, I did write the following for one of the environments I manage and linked it in as a daily cron job. Maybe it can be a starting point for such functionality?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-cloud-controller (master)
Changed in charm-nova-cloud-controller:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-nova-cloud-controller (master)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921361
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/02adbab96924b5f4f12ccb148df1ef0242acb0df
Submitter: "Zuul (22348)"
Branch: master

commit 02adbab96924b5f4f12ccb148df1ef0242acb0df
Author: james lin <email address hidden>
Date: Wed Jun 5 17:10:07 2024 +0800

    Add new action purge-data

    The action will run
    `nova-manage db purge --verbose --all`
    to delete rows from shadow tables.

    Related-Bug: 2066940
    Change-Id: I4602a9cf38126b50bfe188b68a75cff1d2597342

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-cloud-controller (stable/2024.1)

Related fix proposed to branch: stable/2024.1
Review: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921724

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-nova-cloud-controller (stable/2024.1)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921724
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/4c1155cdcaffb9290686f03edc48d793cc6657e2
Submitter: "Zuul (22348)"
Branch: stable/2024.1

commit 4c1155cdcaffb9290686f03edc48d793cc6657e2
Author: james lin <email address hidden>
Date: Wed Jun 5 17:10:07 2024 +0800

    Add new action purge-data

    The action will run
    `nova-manage db purge --verbose --all`
    to delete rows from shadow tables.

    Related-Bug: 2066940
    Change-Id: I4602a9cf38126b50bfe188b68a75cff1d2597342
    (cherry picked from commit 02adbab96924b5f4f12ccb148df1ef0242acb0df)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-cloud-controller (stable/zed)

Related fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921744

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-cloud-controller (stable/yoga)

Related fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921745

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-cloud-controller (stable/xena)

Related fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921746

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-cloud-controller (stable/wallaby)

Related fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921747

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-cloud-controller (stable/victoria)

Related fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921748

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-cloud-controller (stable/ussuri)

Related fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921749

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-cloud-controller (stable/2023.2)

Related fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921904

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-nova-cloud-controller (stable/2023.1)

Related fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921905

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-nova-cloud-controller (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921904
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/676b663177cc179a149bb2df84abd97e06273d10
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 676b663177cc179a149bb2df84abd97e06273d10
Author: james lin <email address hidden>
Date: Wed Jun 5 17:10:07 2024 +0800

    Add new action purge-data

    The action will run
    `nova-manage db purge --verbose --all`
    to delete rows from shadow tables.

    Related-Bug: 2066940
    Change-Id: I4602a9cf38126b50bfe188b68a75cff1d2597342
    (cherry picked from commit 02adbab96924b5f4f12ccb148df1ef0242acb0df)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-nova-cloud-controller (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921905
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/a7f028a148cfd3e31dd514e327cdf0b51f63e47b
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit a7f028a148cfd3e31dd514e327cdf0b51f63e47b
Author: james lin <email address hidden>
Date: Wed Jun 5 17:10:07 2024 +0800

    Add new action purge-data

    The action will run
    `nova-manage db purge --verbose --all`
    to delete rows from shadow tables.

    Related-Bug: 2066940
    Change-Id: I4602a9cf38126b50bfe188b68a75cff1d2597342
    (cherry picked from commit 02adbab96924b5f4f12ccb148df1ef0242acb0df)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-nova-cloud-controller (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921744
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/e2442ef7bd5e65d5ff465b8002632436302169ea
Submitter: "Zuul (22348)"
Branch: stable/zed

commit e2442ef7bd5e65d5ff465b8002632436302169ea
Author: james lin <email address hidden>
Date: Wed Jun 5 17:10:07 2024 +0800

    Add new action purge-data

    The action will run
    `nova-manage db purge --verbose --all`
    to delete rows from shadow tables.

    Related-Bug: 2066940
    Change-Id: I4602a9cf38126b50bfe188b68a75cff1d2597342
    (cherry picked from commit 02adbab96924b5f4f12ccb148df1ef0242acb0df)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-nova-cloud-controller (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921745
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/59404ff046d4ef1aed53ddcd1b918e4c88bc0777
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 59404ff046d4ef1aed53ddcd1b918e4c88bc0777
Author: james lin <email address hidden>
Date: Wed Jun 5 17:10:07 2024 +0800

    Add new action purge-data

    The action will run
    `nova-manage db purge --verbose --all`
    to delete rows from shadow tables.

    Related-Bug: 2066940
    Change-Id: I4602a9cf38126b50bfe188b68a75cff1d2597342
    (cherry picked from commit 02adbab96924b5f4f12ccb148df1ef0242acb0df)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-nova-cloud-controller (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/921747
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/0e02e957a751b3e61b03644d3e70d402b3c0d49e
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 0e02e957a751b3e61b03644d3e70d402b3c0d49e
Author: james lin <email address hidden>
Date: Wed Jun 5 17:10:07 2024 +0800

    Add new action purge-data

    The action will run
    `nova-manage db purge --verbose --all`
    to delete rows from shadow tables.

    Related-Bug: 2066940
    Change-Id: I4602a9cf38126b50bfe188b68a75cff1d2597342
    (cherry picked from commit 02adbab96924b5f4f12ccb148df1ef0242acb0df)

tags: added: in-stable-wallaby
tags: added: in-stable-victoria
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.