PCD CLI - pcdctl

PCD CLI (pcdctl) is a unified command line interface (CLI) tool to manage all your Private Cloud Director services. PCD CLI lets you install, manage, update Platform9 host agent and related software components on your hypervisor hosts. It also enables you to run all supported operations across all Private Cloud Director services. The goal of PCD CLI is to be a single unified tool that enables you to control all Private Cloud Director services and automate them.

Before You Install

Before you install PCD CLI, please note the following:

  • When using PCD CLI to prepare and onboard a new host to be added to Private Cloud Director, you need to install and run the CLI on the host being added. Ability to perform remote install and onboarding of new host using PCD is coming in the future.

  • When using product_acronym CLI to control your Private Cloud Director services, you can run PCD CLI on any node with network connectivity to your Private Cloud Director environment.

Prerequisites

  • If using PCD CLI to onboard a new host into your Private Cloud Director setup, make sure to install PCD CLI on that host. Also ensure that the host prerequisites are met before using PCD CLI to onboard a new host.

  • If using PCD to access your Private Cloud Director services, you can install it on any Ubuntu machine with network access to your Private Cloud Director setup.

Installation

To install PCD CLI pcdctl, execute the following command on the machine you are installing the CLI on:

bash <(curl -s https://pcdctl.s3.us-west-2.amazonaws.com/pcdctl-setup)

To view available commands and their information, use the help command:

pcdctl --help

For help with a specific command, run the following:

pcdctl [command] --help

Global Flags

Following global flags apply to any run of pcdctl

--log-dir string path to save pcdctl logs

--no-prompt disable all user prompts

--verbose print verbose logs

Configuration

Before using pcdctl with your Private Cloud Director environment, you need to configure it:

  1. Navigate to Access & Security -> API Access -> pcdctl RC in the Private Cloud Director UI

  2. Copy the contents to a new file named pcdctlrc

  3. Update OS_PASSWORD with your Private Cloud Director password

  4. Run source pcdctlrc to set the required environment variables

Configuration Commands

config set

Sets the configuration details, including Account URL etc, in ~/pf9/db/config.json

Run this command first prior to running any other pcdctl commands to set the information about your account url and credentials once instead of having to specify it for each command.

Parameters:

-u, --account-url string – Sets account URL

-h, --help – Displays help for set

-p, --password string – Sets password (use 'single quotes' to pass password)

-r, --region string – Sets region

-t, --tenant string – Sets tenant

-e, --username string – Sets the username

config get

Retrieves the current configuration settings

Host Onboarding & Management Commands

prep-node

The prep-node command allows you to add a new host to your Private Cloud Director environment. This command prepares the host with required pre-requisites by downloading and installing a set of required software packages on the host, so that it can be used in your Private Cloud Director environment.

authorize-node

This command sssigns a Private Cloud Director role to the host.

Flags:

-h, --help help for authorize-node

--role string role for the host

decommission-node

Decommissions this host from PCD management plane and purges all PCD components on the host.

Parameters:

-h, --help help for decommission-node

-f, --force force decommission node purging everything

-r, --skip-installed-role-check Skip checking for installed roles

deauthorize-node

Removes roles from an onboarded node.

Parameters:

-h, --help help for deauthorize-node

-H, --skip-host-removal Skip host removal

-r, --skip-role-removal Skip role removal

-t, --timeout string Timeout for the operation (default "5m")

PCD Operation

pcdctl supports all core Private Cloud Director operations. The standard format is:

Examples

Volume Operations

Sample output:

Domain Operations

Sample output:

Availability Zone Operations

Sample Output:

Network Operations

Troubleshooting

If you encounter issues:

  • Ensure your configuration file is sourced correctly

  • Verify network connectivity to your Private Cloud Director environment

  • Check that you have the necessary permissions for the operation

  • Review logs for detailed error information

Last updated

Was this helpful?