Friday, August 21, 2015

vCloud Air CLI as Docker container


Now have the ability to consume vCA (vCloud Air) services through vCA CLI Docker image.



vCA CLI – Command Line Interface for VMware vCloud Air was launched recently for Ubuntu and Mac OS X. It supports vCloud Air On Demand and Subscription model, it also supports standalone vCloud Director. Now, it can be leveraged independent of any OS or any linux distribution. In this blog, it will be demonstrated that how to take advantage of the packaged vCA CLI Docker image to quickly get going with vCA CLI regardless of what client OS Distribution you’re using as long as you have access to Docker engine.

1. Docker can be installed as per the below documentation for variety of OS;

     https://docs.docker.com/installation/

2.  After the installation of the docker engine. Just pull the vca-cli docker image from docker             hub;

     docker pull vkohli/vca-cli 

3.  Run the docker container and attach to its bash shell;
      $docker run –i –t vkohli/vca-cli /bin/bash
      root@aba17a142b96:/# vca
      Usage: vca [OPTIONS] COMMAND [ARGS]...

      VMware vCloud Air Command Line Interface.
      Options:
        -p, --profile <profile>         Profile id
        -v, --version                            Show version
        -d, --debug                               Enable debug
        -j, --json                                    Results as JSON object
        -x, --xml                                   Results as XML document
        -i, --insecure                           Perform insecure SSL connections
        -h, --help                                  Show this message and exit.
      
      Commands:
        blueprint                                 Operations with Blueprints        
        catalog                                     Operations with Catalogs        
        deployment                           Operations with Deployments        
        dhcp                                          Operations with Edge Gateway DHCP Service        
        disk                                            Operations with Independent Disks        
        events                                       Operations with Events        
        example                                   vCloud Air CLI Examples       
        firewall                                     Operations with Edge Gateway Firewall Rules        
        gateway                                   Operations with Edge Gateway        
        instance                                   Operations with Instances        
        login                                          Login to a vCloud service        
        logout                                       Logout from a vCloud service        
        nat                                             Operations with Edge Gateway NAT Rules        
        network                                   Operations with Networks        
        org                                             Operations with Organizations        
        plan                                           Operations with Plans        
        status                                        Show current status        
        vapp                                         Operations with vApps        
        vdc                                            Operations with Virtual Data Centers (vdc)        
        vm                                             Operations with Virtual Machines (VMs)        
        vpn                                            Operations with Edge Gateway VPN
vCA-CLI normal functionality on single Host
vCA-CLI functionality with Docker Container

The advantage of having the vca-cli docker image is to;

1. Run it independent of the underlying OS,the only requirement is docker engine.

2. All the dependencies and installation process of vCA-CLI is taken care in the packaged docker image.

3. Multi-user support: Currently vCA-CLI does not support multi-user login and usage from the same host machine. But using docker image one host machine can be used to support mutli-user requirement as multiple docker containers (independent instance of vca-cli) can be spawned for each user on the same host as shown in the figures above.


Start using the vca-cli, please visit the official github page for more details;

https://github.com/vmware/vca-cli