Using vCD-CLI for vCloud Director

VMware vCloud Director vCD-CLI  is a command line interface for vCloud Director using short, easy-to-remember commands to administer vCD. it also allows tenants to perform certain operations for convenience and automation.

vCD-CLI is Python based and fully open source and licensed under the Apache 2.0 license. Installation process is very easy and can be installed on various platforms .  pls check INSTALL.md, which has detailed installation instructions for Mac OS X, Linux, and Windows.

if you are using VMware’s container service extension , you need to add extension to vCD-CLI.

Installation

Here are steps which is followed for the installation on Photon OS v2 , Photon OS minimal installs lack standard tools like pip3 and even ping, so you need to install a number of packages using tdnf.

  • #tdnf install -y build-essential python3-setuptools python3-tools python3-pip python3-devel
  • 1.png
  • #pip3 install –user vcd-cli
  • 2.png
  • Set PATH  using  #PATH=$PATH:~/.local/bin
  • 3.png
  • Run #vcd (if everything goes well , you should see as below)
  • 4.png

Command Use

  • Login to vcd #vcd login cloud.corp.local system administrator –password <********> -w -i  -> this will login to vCD system.
    • 51.png
  • Let’s create a PVDC using vcd-cli , to create Provider VDC run this:
    • 7.png
    • 8.png
    • VC NAME and -t NSX-T name should be as per vCD Console
    • -r – Resource Pool – Name should be as per VC cluster name
    • -e to enable the PVDC.
    • -s – storage profile name, i am choosing all.
    • PVDC get created successfully.
    • 9.png
  • Let’s now create an organisation
    • to create an organisation run this: #vcd org create T1 Tenant1 -e
    • 10.png

so if you see this is very easy way to create object in vCD using command lines , an script can be written to automate some of the routine tasks and jobs. Refer here for more command syntax.