Bundle cleanup script fails to clean up NSX-T patch bundle.
search cancel

Bundle cleanup script fails to clean up NSX-T patch bundle.

book

Article ID: 318846

calendar_today

Updated On: 08-22-2024

Products

VMware Cloud Foundation

Issue/Introduction

Symptoms:

  • Bundle cleanup script throws the foreign key constraint violation while cleaning up the upgrades entries for the provided bundle id.

  • Bundle CleanUp logs (/var/log/vmware/vcf/lcm/bundle_cleanup.log) contain the following log snippet:

2022-10-07 23:00:25,682 [INFO] root: Performing cleanup for bundle with IDs : ['aaf7a21c-####-####-####-##########fa']
2022-10-07 23:00:28,938 [ERROR] root: b'ERROR:  update or delete on table "upgrade" violates foreign key constraint "FK309gdb4jpsxjg1u3f3jtae5c6" on table "upgrade_plan_upgrade"\n'
2022-10-07 23:00:28,938 [ERROR] root: b'DETAIL:  Key (upgrade_id)=(be598aee-####-####-####-##########44) is still referenced from table "upgrade_plan_upgrade".\n'
2022-10-07 23:00:28,939 [ERROR] root: Error: ERROR:  update or delete on table "upgrade" violates foreign key constraint "FK309gdb4jpsxjg1u3f3jtae5c6" on table "upgrade_plan_upgrade"
DETAIL:  Key (upgrade_id)=(be598aee-f936-402b-8b54-d81ee1915d44) is still referenced from table "upgrade_plan_upgrade".

 

Environment

VMware Cloud Foundation 4.3.x
VMware Cloud Foundation 4.4.x
Vmware Cloud Foundation 4.5
VMware Cloud Foundation 4.2.x

Cause

VCF LCM bundle cleanup script fails to remove the NSX-T patch bundles associated with upgrade data due to the underlying correlation between the upgrade and upgrade plan database entries.

Resolution

This issue is resolved in VMware Cloud Foundation 4.5.1.

Workaround:

To workaround the issue, please follow the below mentioned steps:

Download the attached latest bundle cleanup script (bundle_cleanup.py) and update the script in SDDC Manager

  1. Open an SSH session to the SDDC Manager VM and switch to the root user:

 > su -
  1.  Copy the downloaded bundle_cleanup.py to /opt/vmware/vcf/lcm/lcm-app/bin/ replacing the older bundle_cleanup.py script.

  2. Run the following command to change ownership and permissions of the bundle_cleanup.py

 > chown vcf_lcm:vcf /opt/vmware/vcf/lcm/lcm-app/bin/bundle_cleanup.py
 > chmod 750 /opt/vmware/vcf/lcm/lcm-app/bin/bundle_cleanup.py
 > vi +':wq ++ff=unix' /opt/vmware/vcf/lcm/lcm-app/bin/bundle_cleanup.py

  1. The updated bundle cleanup script can now be used to remove any patch bundles. If the patch was enabled using Async Patch tool, the patch can be disabled using the Async Patch tool.



Attachments

bundle_cleanup get_app