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

Using Guest Customization with pre and post deploy


When you use Guest Customization Scripts, it's important to define when they are running.

Getting ready

We will need a vApp with VMs in it. To test the results in this recipe, it is good if you have a Linux and a Windows VM so that you can test the results better.

How to do it...

  1. Double-click on the vApp to enter it.

  2. Select a VM that you want to configure with Guest Customization.

  3. Right-click on the VM and select Properties.

  4. Click on Guest OS Customization.

  5. Make sure you have enabled Guest Customization and then scroll down to the end of the page.

  6. In the large textbox, enter the following scripts depending on your operating system:

    • The following is the Linux script:

      #!/bin/sh
      if [ x$1 == x"precustomization" ]; then
      /bin/date > /tmp/VMStatus
      echo VM Precustomization >> /tmp/VMStatus
      Hostname >> /tmp/VMStatus
      elif [ x$1 == x"postcustomization" ]; then
      /bin/date >> /tmp/VMStatus
      echo postcustomization >> /tmp/VMStatus
      Hostname...