The basics of vcd-cli

In this blog I will intruduce you into the basics of vcd-cli and multitude of possibilities this tool offers.

vcd-cli is a command line interface for vCloud director and is being maintained by VMware.

I feel that vcd-cli is a powerful tool that can make your daily tasks a but easier.

For certain tasks I find vcd-cli to be easier to use than for instance PowerCLI, espacially when it comes down to VM resource management.

Installing the package

On of the first things you need to do before you can start using vcd-cli is install the package on your machine.

The package is available for:

  • Windows
  • Linux
  • Photon OS
  • Mac OS X

You can also add additional extensions for vcd-cli like  container-service-extension so that you can work with kubernetes in vCloud director. Of course this will only work if you have the CSE extention installed. More info on CSE can be found here

Using vcd-cli

Now lets have a look what we can do with vcd-cli.

To get started you need to login using the vcd-cli:

Now that I am logged in we can start by listing all the command available to us  using the vcd –h command

vcd-cli

As you can see you have quit a view commands at your disposal.

Now lets see what we can do with these commands

Adding a vApp

Power off a VM

Adding CPU and Memory resources to a VM

As mentioned before resource management is easier in my opinion then with PowerCLI.

Below a example of a VM called “CentOS6” that is in need of some more power.

Lets first see the amount of resources currently assigned to the VM:

add_resources

And as you can see the VM currently has 2 CPU’s assigned and 1 GB of memory.

Now lets change that to 4 CPU’s and 2 GB of memory like so:

vcdcli_updatecommand

The command completed successfully, lets check to see if this is indeed the case by running the vcd vm info command again:

vcdcli-result

And voila my VM now has 4 CPU’s and 2 GB of memory.

I hope I have been able to give you some insides into the basics of vcd-cli.

To find out more information regarding vcd-cli please visit  http://vmware.github.io/vcd-cli/

Here you will find installation instructions but also a list of all the commands available when using vcd-cli.

Check our other vCloud Director related articles here

51 total views, 3 views today

AboutArjen Kloosterman

Pre-Sales Consultant @ Uniserver Internet

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code