Scripted components cleanup from VCF Operations 9.1
search cancel

Scripted components cleanup from VCF Operations 9.1

book

Article ID: 441333

calendar_today

Updated On:

Products

VMware Cloud Foundation VMware vSphere Foundation

Issue/Introduction

  • In VCF Operations 9.1, on the Build Lifecycle VCF Management > Components page, installed components are listed and new components can be added. For manually-added components such as VCF Operations for Networks, Log Management, Real-Time Metrics or VCF Automation, there is no "Delete" option available.
  • In VCF Operations 9.0, this type of action is possible on the Fleet Management > LifecycleComponents page, by clicking the three vertical dots next to a component and selecting Delete.

Environment

  • VCF 9.1
  • VVF 9.1

Resolution

Table of Contents

Script Usage

The LCM component cleanup script "cleanup_component.py" attached to this KB enables administrators to manage Day-N deployed components visible in the VCF Operations UI.

This script can be used to:

  • List components: View all deployed components currently eligible for removal.
  • Delete components: Safely remove inoperable or misconfigured components from the system so they can be redeployed later through VCF Operations.

Notes:

  • If a component is running a version older than 9.1, it is removed solely from the Fleet lifecycle. The script does not delete the corresponding infrastructure deployments, such as vCenter or VCF Services Runtime.
  • VSP refers to VCF Management Services.
  • This script can be run from any system with Python installed that has network access to the Fleet and VCF Management Services components.
  • Replace the placeholder FQDN such as <fleet-lcm-fqdn> with the actual values. These values can be obtained from VCF Operations UI -> Build -> Lifecycle -> VCF Management -> Components (e.g. vsp01.example.com for <vcf-services-runtime-fqdn>).
  • Use username 'admin' as the value for <vcf-services-runtime-username> and the password of vmware-system-user, both the accounts have the same password.

Running the Script

The commands required to list and delete a component vary depending on the component type. Steps mentioned below explain the syntax to execute the script.

Warning: Prior to deletion, verify that you have a backup of any critical component data which needs to be retained, such as logs or database backups.

  1. OVA Components

    Deleting an OVA-based deployment removes it from Fleet lifecycle and also deletes the associated virtual machines from vCenter.

    1. List components deployed on vCenter

      python cleanup_component.py list ova-component --fleet-fqdn <fleet-lcm-fqdn> --vcf-services-runtime-fqdn <vcf-services-runtime-fqdn> --vcf-services-runtime-username <vcf-services-runtime-username>
    2. Delete component deployed on vCenter

      python cleanup_component.py delete ova-component --component-id <ova-component-id> --fleet-fqdn <fleet-lcm-fqdn> --vcf-services-runtime-fqdn <vcf-services-runtime-fqdn> --vcf-services-runtime-username <vcf-services-runtime-username> --vcenter-username <vcenter-username>
  2. VCF Management Services Components


    Deleting a VSP-based deployment removes it from Fleet lifecycle and also deletes the associated deployment from VCF Services Runtime.

    1. List components deployed on VCF Services Runtime

      python cleanup_component.py list vsp-component --fleet-fqdn <fleet-lcm-fqdn> --vcf-services-runtime-fqdn <vcf-services-runtime-fqdn> --vcf-services-runtime-username <vcf-services-runtime-username>
    2. Delete component deployed on VCF Services Runtime

      python cleanup_component.py delete vsp-component --component-id <vsp-component-id> --fleet-fqdn <fleet-lcm-fqdn> --vcf-services-runtime-fqdn <vcf-services-runtime-fqdn> --vcf-services-runtime-username <vcf-services-runtime-username>
  3. VCF Automation


    VCF Automation is a multi-component deployment:

    VCF Automation
    Migration Service Engine
    VCF Automation VCF Services Runtime

    Prior to redeployment, remove the following components:

    1. VCF Automation and Migration Service Engine

      You must remove VCF Automation and the Migration Service Engine before you remove the VCF Automation VCF Services Runtime.

      1. List components deployed on VCF Services Runtime

        python cleanup_component.py list vsp-component --fleet-fqdn <fleet-lcm-fqdn> --vcf-services-runtime-fqdn <vcf-services-runtime-fqdn> --vcf-services-runtime-username <vcf-services-runtime-username>
      2. Delete component deployed on the VCF Automation VCF Services Runtime

        python cleanup_component.py delete vsp-component --component-id <vsp-component-id> --fleet-fqdn <fleet-lcm-fqdn> --vcf-services-runtime-fqdn <vcf-services-runtime-fqdn> --vcf-services-runtime-username <vcf-services-runtime-username> --vcfa-vcf-services-runtime-fqdn <vcfa-vcf-services-runtime-fqdn> --vcfa-vcf-services-runtime-username <vcfa-vcf-services-runtime-username>
    2. VCF Automation VCF Services Runtime

      Warning: Deleting a VCF Services Runtime requires this script to be executed as the root user inside the SDDC Manager virtual machine.

      1. List VCF Services Runtime

        python cleanup_component.py list vsp-cluster --fleet-fqdn <fleet-lcm-fqdn> --vcf-services-runtime-fqdn <vcf-services-runtime-fqdn> --vcf-services-runtime-username <vcf-services-runtime-username>
      2. Delete VCF Services Runtime

        python cleanup_component.py delete vsp-cluster --component-id <vsp-cluster-id> --fleet-fqdn <fleet-lcm-fqdn> --vcf-services-runtime-fqdn <vcf-services-runtime-fqdn> --vcf-services-runtime-username <vcf-services-runtime-username> --vcenter-username <vcenter-username>

Additional Information

SHA256 Checksum:

cleanup_component.py - 27A82D393333D17261EF1E8629A69AD6C40659A8537DF961DE95E545FE656F5B

Attachments

cleanup_component.py get_app