Book Image

VMware vCloud Director Cookbook

By : Daniel Langenhan
Book Image

VMware vCloud Director Cookbook

By: Daniel Langenhan

Overview of this book

VMware vCloud Director is an enterprise software solution that enables the building of secure, private clouds by pooling together infrastructure resources into virtual data centers. The tool enables self-service via a web interface to reduce the management overhead and offers amazing possibilities for production and development environments. Thus, the tool will ensure efficient management of resources with data center efficiency and business agility. "VMWare VCloud Director Cookbook" will cover a lot of ground, ranging from easy to complex recipes. It will not only dive into networks, data-stores, and vApps, but also cover vCloud design improvements, troubleshooting, and the vCloud API. "VMWare VCloud Director Cookbook" is split into different sections, each of which deals with a special topic in vCloud - from networks, to vApps, to storage and design. This book contains over 80 recipes with the difficulty levels ranging from simple to very advanced. You will learn how to automate vCloud easily and quickly with the API, and also learn how to isolate a vApp and still fully access it without risking the network. Design considerations that need to be addressed while deploying the vCloud and more will also be looked into. "VMWare VCloud Director Cookbook" will make your life as an admin a lot easier by providing you with some good recipes that have been proven to work in small to large enterprises.
Table of Contents (16 chapters)
VMware vCloud Director Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Appendix
Index

Accessing vCD via PHP


This is how you use PHP to work with vCloud.

Getting ready

Download the PHP vCloud API for vCloud from http://www.vmware.com/go/vcloudsdkforphp.

I assume you will use PHP on Linux, so you might need a Linux VM with PHP libraries and the PHP base configuration. You probably need the HTTP_Request2 and Net_URL2 libraries.

Untar the download into the directory from where you would like to use the files. Place the new script in the main directory (vCloudPHP-5.1.2). You can move them; however, that requires you to reconfigure the pointer to the libraries.

If you are playing on a Windows environment, the base install might be different and you will need to follow the instructions that come with the Windows installer.

How to do it...

In this section, we will create a program that will deploy a new VMs from a command line. We will put some variables inside the program and some to use via the command line. The script we are using is an adapted and simplified version of the base hellovcloud...