WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Uncategorized / vCloud Director Report 1.0.0

vCloud Director Report 1.0.0

01.16.2012 by William Lam // 4 Comments

Over the winter holiday I started to explore the vCloud API and one of our SDKs, vCloud SDK for PHP. VMware provides two additional vCloud SDKs: Java and .NET. I had used Java in college and I wanted to stay away from anything Windows related, so I thought I give PHP a try and it was the closest thing to Perl 😉

Since this was my first time using the vCloud API and SDK, I thought what better way to learn than to create a script similar to my vSphere Health Check Report for vCloud Director? This not only helped me to understand the objects in vCloud Director from an API perspective but no such reporting tool exists today for administrators and end users of vCloud Director.

Here is an example of what a report could look like: vCloudDirectorReport.html

To use the script, you will need the following per-requiste:

  • Install vCloud SDK for PHP, take a look at article on how to get setup.
  • Running vCloud Director 1.5 (Script uses the new API Query Service)
  • Download both config.php which includes configuration parameters for the script and vmwarevCloudDirectorReport.php script.

To get a list of the available commandline options, just type "php vmwarevCloudDirectorReport.php":

php vmwarevCloudDirectorReport.php

Error: missing required parameters
Usage:

[Script]
VMware vCloud Director Report v1.0.0

[Description]
This script provides a detail report of your VMware vCloud Director system

[Usage]
# php vCloudReport.php -s -u -p [Options]

-s|--server [req] IP or hostname of the vCloud Director.
-u|--user [req] User name in the form user@organization for the vCloud Director instance.
-p|--pswd [req] Password for user.
-t|--type [req] Type of report [system|orgadmin|orguser].

[Options]
-r|--report [opt*] Name of html output file (e.g. vCloudReport.html).

[Examples]
# php query.php -s 127.0.0.1 -u admin@system -p password -t system
# php query.php -s 127.0.0.1 -u admin@coke -p password -t orgadmin
# php query.php -s 127.0.0.1 -u admin@pepsi -p password -t orguser

The config.php can be used to store the vCloud URL and credentials or you may specify it via the commandline using -s, -u and -p arguments. In addition, you will also need to specify -t flag which is based on the type of user you are logging into whether that is system (administrator), orgadmin or orguser.

The report can easily be customized by toggling parameters in config.php which includes the following parameters:

Depending on the report type, certain flags will be applicable. By default, all flags are enabled but you my disable ones you do not wish to see.

Here is an example of the script logging into vCloud Director instance with the administrator account in the System organization:

This is the first iteration of the script, I plan on adding additional information and if you have any feedback/suggestions, please leave a comment below.

More from my site

  • How To Run The SilverLining Fling Without Installing It In vCloud Director
  • Scripts to Extract vCloud Director Chain Length and Linked Clone Mappings
  • Quick Tip - Using ovftool to connect to vCloud Director behind a 2-Factor Authentication portal
  • Creating your own 3rd Party Content Library for vSphere 6.0 & vCloud Director 5.x
  • How to deploy vSphere 6.0 (VCSA & ESXi) on vCloud Director and vCloud Air?

Categories // Uncategorized Tags // php, sdk, vcd, vcloud director

Comments

  1. *protectedJanakan says

    01/17/2012 at 11:07 pm

    Very useful post! Thanks for sharing!

    Reply
  2. *protectedrajeshn123 says

    03/29/2012 at 7:20 am

    Thanks for this amazing work. My 2 cents.
    1. It's pulling templates from public catalogs as well in vApp templates field. It should only pull templates beloging to catalogs of this Org.
    2. The tasks are pulled as - Last task first. Kindly reverse the order so that we can see the most recent tasks first in the list.
    Thanks and looking forward to more updates.

    Reply
  3. *protectedWilliam says

    04/09/2012 at 2:55 pm

    @rajeshn123,

    1. I'm using the Query Service to extract all configs from vCD and it'll list all things you have access to which will include public catalogs
    2. I've gone ahead and checked in the change

    Reply
  4. *protectedBastiaan says

    10/21/2016 at 2:15 am

    To support SDK 5.5 and up you need to add the SDK version at login. Change line 131 to:

    $service->login($server, array('username'=>$user, 'password'=>$pswd), $httpConfig, '5.5');

    Or '5.6' depending on your verison.

    Thanks for the script!

    Reply

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025