PCDdebugger Utility for PCD Troubleshooting

PCDdebugger

PCDdebugger is a command-line Python script designed to simplify and accelerate the troubleshooting process for PCD environments. It automates the collection of diagnostic information for various services and resources, consolidating the output into a structured directory for easy analysis and sharing.

Features

  • Comprehensive Data Collection: Gathers detailed information for key PCD resources including VMs (Nova), images (Glance), networks (Neutron), ports, volumes (Cinder), stacks (Heat), and users (Keystone).
  • Kubernetes Integration: Performs a complete MySQL dump from a specified Kubernetes namespace, essential for debugging control plane issues.
  • Dependency Traversal: Automatically discovers and collects data for resources related to a specified VM, such as its ports, volumes, network, subnets, image, and flavor.
  • Organized Output: Saves all collected data into a timestamped directory, with subfolders for each service, making the information easy to navigate.
  • Archive Option: Includes a --zip flag to automatically create a compressed archive of the collected data, ready for sharing.

Prerequisites

Before running the script, ensure the following are installed and configured on your machine:

  • Python 3.6+
  • pcd client: Authenticated and configured to connect to your pCD cloud. (Ensure your rc file is sourced).
  • kubectl: Authenticated and configured to connect to your Kubernetes cluster.( This is required only in case of mysql dump)
  • yq: A command-line YAML processor, used for parsing data from Consul.

Installation

  1. Clone the repository:
Bash
Copy
  1. cd PCDdebugger
  2. Make the script executable (optional but recommended):
Bash
Copy

Usage

The basic command structure is:

command
Copy

Examples

  • Collect all information for a specific VM: This will gather details of the VM, its ports, volumes, network, subnets, image, and flavor.
Bash
Copy
  • Collect details for a specific Glance image:
Bash
Copy
  • Collect details for a Neutron network and its subnets: .
Bash
Copy
  • Perform a MySQL dump from a Kubernetes cluster: The --namespace flag is required for this operation.
Bash
Copy
  • Combine multiple flags and create a zip archive:
Bash
Copy
  • Specify a custom output directory and create a zip archive:
Bash
Copy
Example
Copy

Command-Line Flags:

  • --vm <ID_OR_NAME>: Collect details for a specific Nova VM and its related resources.
  • --image <ID_OR_NAME>: Collect details for a specific Glance image.
  • --network <ID_OR_NAME>: Collect details for a specific Neutron network and its subnets.
  • --port <ID_OR_NAME>: Collect details for a specific Neutron port.
  • --volume <ID_OR_NAME>: Collect details for a specific Cinder volume.
  • --stack <ID_OR_NAME>: Collect details for a specific Heat stack.
  • --user <ID_OR_NAME>: Collect details for a specific Keystone user.
  • --mysql-dump: Perform a MySQL dump of all databases. Requires --namespace.
  • --namespace <NAMESPACE>: The Kubernetes namespace to use for the MySQL dump.
  • --output <DIRECTORY>: Specify a custom directory for the output files.
  • --zip: Compress the final output directory into a .zip file.
  • --help: Show the help message and exit.

All output is saved to a directory named PCDdebugger-<TIMESTAMP> by default.

What It Collects

Status of all Compute, Networking, Image and Storage Services and many more.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard