The VMware Cloud Provider Lifecycle Manager CLI allow you to perform different VMware Cloud Provider Lifecycle Manager tasks.

By default, the VMware Cloud Provider Lifecycle Manager CLI package is installed with the VMware Cloud Provider Lifecycle Manager appliance. You can configure it to use the localhost as an API endpoint.

Additionally to running the CLI on the VMware Cloud Provider Lifecycle Manager appliance, you can install the VMware Cloud Provider Lifecycle Manager CLI package on remote Linux machines running the Python PIP package.

Log in to the VMware Cloud Provider Lifecycle Manager appliance by using CLI

You can log in to the VMware Cloud Provider Lifecycle Manager appliance by using CLI.

To enable the communication between the VMware Cloud Provider Lifecycle Manager REST API and the CLI, the VMware Cloud Provider Lifecycle Manager CLI needs a session token from VMware Cloud Provider Lifecycle Manager. You can obtain this token by authenticating the CLI against the VMware Cloud Provider Lifecycle Manager REST API. If the sessions times out, you must re-authenticate the CLI session.

Procedure

  1. Initiate the login.
    vcplcm login
  2. Enter the user name and password.

Available CLI Commands

The CLI provides instructions about the available commands and parameters. The help information is printed as a system output, based on the command context, whenever the command is incomplete, or upon running the --help command.

For some command prompts, the CLI has default values and you can hit enter to use these values.

The CLI commands match the REST API functionality.

CLI Command Description
vcplcm config set Initiate the CLI configuration.
vcplcm config get Obtain information about the current CLI configuration.
vcplcm login Log in to VMware Cloud Provider Lifecycle Manager.
vcplcm info about Obtain information about the VMware Cloud Provider Lifecycle Manager API.
vcplcm environment create -i "file:/tmp/my_env.json" --action validate [--ignore_validation <true|false>] Run a pre-validation for the specified in the JSON file environment.
env_json='{"environmentName":"myenv", ...}'vcplcm environment create -i "$env_json" --action deploy [--ignore_validation <true|false>] Using a JSON text, create a product environment in VMware Cloud Provider Lifecycle Manager.
vcplcm environment create -i "file:/tmp/my_env.json" --action deploy [--ignore_validation <true|false>] Using a JSON file or text, deploy a product.
vcplcm environment create -i <node_spec as file or text> --action import [--ignore_validation <true|false>] Import an existing product environment into VMware Cloud Provider Lifecycle Manager.
vcplcm environment get [-e <environment-id>] Obtain information about an existing environment from VMware Cloud Provider Lifecycle Manager.
vcplcm product add_node -e <environment-id> -p <product-id> -i <node_spec as file or text> [--disable_rollback <true|false>] Add a node to an existing product in VMware Cloud Provider Lifecycle Manager.
vcplcm product delete_node -e <environment-id> -p <product-id> -n <node_id> [--force <true|false>] Delete a node from an existing product in VMware Cloud Provider Lifecycle Manager.
vcplcm product redeploy_node -e <environment-id> -p <product-id> -n <node_id> [--force <true|false>] Redeploy a node of an existing product in VMware Cloud Provider Lifecycle Manager.
vcplcm product update_node -e <environment-id> -p <product-id> -n <node_id> -i <node_spec as file or text> [--force <true|false>] [--ignore_validation <true|false>] Update a node of an existing product in VMware Cloud Provider Lifecycle Manager.
vcplcm product get_node -e <environment-id> -p <product-id> [-n <node_id>] Obtain information about a node of an existing product in VMware Cloud Provider Lifecycle Manager.
vcplcm product get_certificate -e <environment-id> -p <product-id> Obtain certificate details for an existing product in VMware Cloud Provider Lifecycle Manager.
vcplcm product update_certificate -e <environment-id> -p <product-id> -i <certificate_spec as file or text> Update certificates of an existing product in VMware Cloud Provider Lifecycle Manager.
vcplcm product upgrade -e <environment-id> -p <product-id> -i <upgrade_spec as file or text> --action validate Validate the upgrade of an existing product in VMware Cloud Provider Lifecycle Manager.
vcplcm product upgrade -e <environment-id> -p <product-id> -i <upgrade-spec as file or text> --action upgrade [--disable_rollback <true|false>] [--ignore_validation <true|false>] Upgrade an existing product.
vcplcm task get [-t <task_id>] Obtain task details.
vcplcm task update -t <task_id> -a cancel Cancel a running task.

Run the VMware Cloud Provider Lifecycle Manager Environment Designer

VMware Cloud Provider Lifecycle Manager provides an environment designer functionality.

This is an interactive CLI that allows generating a basic deployment of one of the supported products, modification of this design as well as an option to validate and deploy the environment.

By using save option that is available in the desinger, you can save the generated design to a file to refer to it in the future. In the file, the information about passwords and license keys is removed. If you want to use the file for future deployments, in the design file, you must populate the password and license key fields.

Procedure

  1. SSH to the VMware Cloud Provider Lifecycle Manager appliance console and log in as vcplcm.
  2. To initiate the interactive CLI, run the command.
    vcplcm environment design
    The following operations are available in the designer.
    Operation Description
    Initialize a new design

    Initialize the deployment of a basic environment for a product. You must provide the product type and version, the number of nodes, network settings for the first node, deployment infrastructure details, as well as other necessary input based on the chosen product type.

    The system generates a JSON structure that is used to deploy a product with VMware Cloud Provider Lifecycle Manager.

    VMware Cloud Provider Lifecycle Manager generates a design based on the input, assuming consecutive IP addresses and hostnames for the nodes.

    Note: Before initiating the deployment, verify the design by running the command.
     Print the design
    Load from json

    Alternatively, you can load an existing JSON structure into the designer. This allows viewing and modifying the design within the designer.

    Edit the current design

    You can use a text editor to modify the generated or loaded design.

    This is a basic editor that allows modifying the JSON structure. However, it does not validate the changes.

    Print the design

    The generated or loaded design can be printed to the screen.

    If the design is intended for use outside of the designer, you must copy out the design from the printed screen.

    Login to VCP LCM

    To validate, deploy or obtain information about a task, first you must logg in to VMware Cloud Provider Lifecycle Manager.

    Validate the designed environment

    Validate an existing environment in VMware Cloud Provider Lifecycle Manager.

    The operation can take up to five minutes to complete.

    Deploy the designed environment

    By providing a design, deploy the generated or loaded environment in VMware Cloud Provider Lifecycle Manager.

    The operation triggers the deployment, but does not wait for the task to complete. Instead the task ID is returned. Deployment can take a long time to complete.

    Get the status of a started deploy or validation task

    Obtain status information about the last triggered task.

    The design mode is running and prompting you for an action until you stop it. To cancel the design mode you can either press the CTRL and C keyboards keys, or the C or Q keyboard keys.

What to do next

The environment you design by using the designer does not persist anywhere unless you save it. After stopping the designer, the content is lost. You must save the design or deploy directly from the designer. Due to security reasons, the saved design file does not contain any passwords or license keys.

Install CLI on Other Machines

To execute commands against the VMware Cloud Provider Lifecycle Manager appliance from a remove Linux machine, you must first download the existing CLI package from the VMware Cloud Provider Lifecycle Manager appliance and install it n the target machine.

After you download the CLI package, you can install it on the target Linux machine.

Prerequisites

  • Install Python 3.6 or later on the target Linux machine.
  • Install the Python package manager PIP on the target Linux machine.
  • Verify that the target Linux machine has access to a PIP repository (e.g. by having access to Internet).

Other dependencies of the CLI are automatically resolved and installed by PIP.

Procedure

  1. To download the CLI package from VMware Cloud Provider Lifecycle Manager, navigate to https://<vcplcm-host-address>:<port-number>/public/vcplcm_cli-1.2.0-py3-none-any.whl.
  2. On the target Linux machine, install the CLI package.
    pip3 install vcplcm_cli-1.2.0-py3-none-any.whl --user

What to do next

Configure the CLI with the target VMware Cloud Provider Lifecycle Manager endpoint and log in to the appliance by using the CLI. For information about CLI, see Using the VMware Cloud Provider Lifecycle Manager Command-Line Interface.

Configure the CLI

To enable the execution of CLI commands against VMware Cloud Provider Lifecycle Manager from a remote Linux machine, you must first configure the CLI with the target VMware Cloud Provider Lifecycle Manager endpoint.

The deployed VMware Cloud Provider Lifecycle Manager appliance contains a preconfigured CLI and you do not need to run further configurations. But if you want to run CLI commands against the VMware Cloud Provider Lifecycle Manager appliance from a remote Linux machine, you must run the configuration set.

By default, the VMware Cloud Provider Lifecycle Manager CLI uses port 9443 for communication with the localhost.

You can configure the CLI to communicate with other VMware Cloud Provider Lifecycle Manager endpoints.

Procedure

  1. SSH to the VMware Cloud Provider Lifecycle Manager appliance console and log in as vcplcm.
  2. To start configuring the VMware Cloud Provider Lifecycle Manager CLI, run the command.
    vcplcm config set
  3. Configure the CLI with the target VMware Cloud Provider Lifecycle Manager endpoint.
    vcplcm config set --hostname vcplcm-host-name --port port-number