VMware vCloud Director Cookbook - Daniel Langenhan - E-Book

VMware vCloud Director Cookbook E-Book

Daniel Langenhan

0,0
39,59 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

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.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 400

Veröffentlichungsjahr: 2013

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

VMware vCloud Director Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Instant Updates on New Packt Books
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Setting Up Networks
Introduction
Network Pools
Setting up an External Network
Getting ready
How to do it...
How it works...
There's more...
Creating 1,000 isolated networks without VXLANs
Getting ready
How to do it...
How it works...
See also
Making VXLANs work
Getting ready
How to do it...
How it works...
There's more...
See also
Integrating the Cisco 1000v into vCD
Getting ready
How to do it...
How it works...
See also
Giving your networks an Edge
Getting ready
How to do it...
How it works...
There's more...
Doing it all(most) without a Distributed Switch
Getting ready
How to do it...
How it works...
2. vCloud Networks
Introduction
Usage of different Network types
Isolated vApp Network
VMs directly connected to an External Network
vApp Network connected via vApp router to an External Network
VMs directly connected to an isolated Organization Network
vApp connected via a vApp router to an isolated Organization Network
VMs connected directly to an Edge device
A vApp connected to an Edge via a vApp router
IP management
Some things you will need for all of the recipes for this chapter
Deploying a vApp with a vApp router
Getting ready
How to do it...
How it works...
Forwarding an RDP (or SSH) session into an isolated vApp
Getting ready
How to do it...
How it works...
There's more…
Creating multiple forwards
Logging network traffic
Other ideas
See also
Accessing a fully isolated vApp or Organization Network
Getting ready
How to do it...
How it works...
There's more…
See also
Using Organization Networks for interconnection between vApps
Getting ready
How to do it…
How it works...
There's more…
Using templates with firewall and NAT settings
Getting ready
How to do it...
How it works...
There's more...
Connecting a physical device to an isolated network
Getting ready
How to do it...
How it works...
Sharpening the Edge
Getting ready
How to do it...
How it works...
There's more...
Using vApp Network fencing
Getting ready
How to do it...
How it works...
There's more...
Creating multitiered vApp Networks
Getting ready
How to do it...
How it works...
There's more...
Downloading and importing a virtual router into vCloud
Setting up the networking
Setting up the web interface
Configuring the WAN interfaces with the correct network settings
Configuring the OPT1 interfaces with the correct network settings
Configuring static routing
See also
Ensuring no change in IP after redeployment
Getting ready
How to do it...
Ensuring no change occurs in IP after redeployment by setting up the vApp
Ensuring no change occurs in IP after redeployment by retrofitting an existing vApp
How it works...
There's more...
Automatic IP management for External Network Pools
Getting ready
How to do it...
How it works...
There's more...
Static DNS Pool
Preallocated DNS pool with a manual IP
Automated setup
Linux and Guest Customization
See also
Creating load-balanced VMs in an organization
Getting ready
How to do it...
How it works...
There's more...
Load balancer methods
See also
Creating a secure connection between organizations (which can be in different vClouds)
Getting ready
How to do it...
How it works...
There's more...
Connecting to other networks in the same organization
Connection to the outside
Public IPs
More VPN possibilities
Monitoring which network resources have been used where
Getting ready
How to do it...
How it works...
See also
3. Better vApps
Introduction
vSphere and vCloud vApps
Roles and rights
Proper vApp startup and shutdown
Getting ready
How to do it...
How it works...
Important changes in vCloud 5.5
There's more...
Power Off
Templates
Adding a VM to a vApp
Getting ready
How to do it…
How it works...
There's more...
Importing a vApp into vCloud
Getting ready
How to do it...
Importing a VM from vSphere
Importing an OVF/OVA into a catalog
Import an OVF/OVA into My Cloud
Importing from Workstation/Fusion
How it works...
Important changes in vCloud 5.5
There's more...
Aftercare
Migrating running VMs
See also
Exporting a vApp from vCloud
Getting ready
How to do it...
Exporting a vApp from a catalog
Exporting a vApp from My Cloud
How it works...
See also
Creating a sandbox environment
Getting ready
How to do it...
Creating an organization for the sandbox
Creating an OvDC for the sandbox
Adding networking
How it works...
Lease time
Allocation model
Networking
There's more...
Fair warning
Using an Edge gateway to give access to the play infrastructure
Using Guest Customization with pre and post deploy
Getting ready
How to do it...
How it works...
There's more...
Limits
Old bugs
Logfiles
Template Guest Customization
See also
Using PowerShell or Perl to perform Guest Customization tasks
Getting ready
How to do it...
Using PowerShell or Perl to perform Guest Customization tasks via the VM Properties
Using PowerShell or Perl to perform Guest Customization tasks via an OS script
How it works...
Windows PowerShell wrapper
Linux Perl wrapper
There's more...
See also
Sharing a vApp
Getting ready
How to do it...
How it works...
There's more...
Joining VMs automatically to domains
Getting ready
How to do it...
How it works...
There's more...
Configuring the organization
Configuring the VM
Using vApp maintenance mode
Getting ready
How to do it...
How it works...
See also
4. Datastores and Storage Profiles
Introduction
Datastores, profiles, and clusters
Thin provisioning
Fast provisioning
Adding a new storage profile to vCD
Getting ready
How to do it...
How it works...
There's more…
See also
Using a specific datastore for templates
Getting ready
How to do it...
How it works...
See also
Using storage profiles for storage tiering
Getting ready
How to do it…
How it works...
See also
Making operations on NFS datastores faster
Getting ready
How to do it...
How it works...
There's more…
See also
Working with vApp templates and their Shadows
Getting ready
How to do it...
How it works...
There's more…
Reducing the chain length of Linked Clones
Getting ready
How to do it...
How it works...
Configuring storage alarms
Getting ready
How to do it...
How it works...
There's more...
Monitoring storage
Getting ready
How to do it...
How it works...
The problems associated with the backup and restore of vCloud
How it works...
5. Working with the vCloud API
Introduction
Logging in to the System organization
Gathering prerequisites and information gathering
Project Onyx
Using PowerShell with vCloud Director
Getting ready
Installing PowerCLI
A PowerShell editor
How to do it...
Connecting vApp
Gathering information
Creating vApp
Powering on vApp
How it works...
See also
Accessing REST with Firefox
Getting ready
How to do it...
The first connection
Gathering information
Creating a new vApp
Powering on
How it works...
See also
Accessing vCD via PHP
Getting ready
How to do it...
Base PHP skeleton
Connecting to vCloud
Gathering information
Creating a new vApp
Powering on the vApp
How it works...
See also
Using vCenter Orchestrator to automate vCloud
Getting ready
How to do it...
The first connection
Gathering information
Creating a new vApp and powering it on
How it works...
There's more…
See also
A scripted cell shutdown
Getting ready
How to do it...
The script
How it works...
There's more…
Adding ISO files to vCD automatically
Getting ready
How to do it...
How it works...
6. Improving the vCloud Design
Introduction
Creating a naming standard
Getting ready
How to do it...
vSphere naming standard
vCloud naming standard
Example of a naming standard notation
How it works...
Using service accounts in the vCloud environment
Getting ready
How to do it...
Creating a service account in AD
Creating a service account in SSO
Assigning a service account in vCenter
Adding a vCloud service account to vCNS
How it works...
AD or SSO?
Understanding vCloud connections
There's more...
See also
Setting up networks for the vCloud VM
Getting ready
How to do it...
Optimal ESXi network setup
Optimal vCD Cell network setup
How it works...
ESXi setup
vCloud Cell setup
See also
Working with vCloud roles
Getting ready
How to do it...
Creating a new role
Assigning a role to a user or a group
How it works...
Changes in vCloud 5.5
There's more...
Keeping your templates under control
Getting ready
How to do it...
Creating the ADMIN Organization
Storage profile
Creating an OvDC
Creating a published catalog
Creating an Organization Network
The ADMIN Organization work cycle
How it works...
Choosing the right Allocation Model
Getting ready
How to do it...
How it works...
The three little Allocation Models
Overcommit, reservation, and limit
vCPU speed
There's more...
See also
Using OvDCs for compute tiering
Getting ready
How to do it...
An example
How it works...
See also
Understanding how the different vCloud types impact the design
Getting ready
How to do it...
How it works...
There's more...
Private vCloud
Public vCloud
Retrofitting a shared directory into an existing vCD Cell
Getting ready
How to do it...
How it works...
There's more...
Connecting more than one vCloud Cell to the same infrastructure
Getting ready
How to do it...
How it works...
See also
Creating multiple vCD Cells for the same vCloud
Getting ready
How to do it...
Preparation of the first cell
Installing the second cell
How it works...
There's more...
See also
Load balancing vCD
Getting ready
How to do it...
Preparation
Configuring the load balancer
The HTTP interface
The console interface
Configuring vCloud for load balancing
How it works...
SSL certificates
Load balancing modes and SSL certificates
See also
Working with catalogs in vCloud 5.5
Getting ready
How to do it...
Configuring sharing, publishing, and subscribing
Sharing an existing catalog
Publishing an existing catalog
Subscribe to a catalog
How it works...
Sharing
Publishing/subscription
There's more...
Synchronizing published/subscribed catalogs
Media & Other
Versioning
7. Operational Challenges
Loading Windows Sysprep packages in vCloud
Getting ready
How to do it...
Downloading and preparing the Sysprep files
Uploading and integrating the Sysprep files
How it works...
See also
Exchanging SSL certificates
Getting ready
How to do it...
Preparation
Deleting an old certificate
Creating a certificate request and importing it
Creating a new self-signed certificate
Finishing touches
How it works...
Self-signed certificates with longer duration
Exporting and importing self-signed certificates
See also
Bypassing SSO login into vCloud
Getting ready
How to do it...
How it works...
There's more...
Backing up vCloud
Getting ready
How to do it...
SSO backup
vCenter backup
vCNS backup
vCloud backup
How it works...
There's more...
See also
Recovering the vCloud system
Getting ready
How to do it...
Restore vSphere from scratch
Restore the vSphere environment from DB
Restore vCNS
Restore vCloud
Restore vCloud DB
Restore one vCloud Cell (in a multicell environment)
How it works...
Changing the name of an organization
Getting ready
How to do it...
How it works...
Shutting down and starting up the vCloud environment
Getting ready
How to do it...
Start-up sequence
Shut-down sequence
How it works...
There's more…
Using metadata to improve provisioning
Getting ready
How to do it...
Creating metadata
Using metadata
How it works...
There's more...
See also
Using vSphere Host Profiles with vCloud
Getting ready
How to do it...
How it works...
Using vCloud with vCenter Auto Deploy
Getting ready
How to do it...
Preparing the infrastructure
Preparing Blade Center
Creating a base ESXi Host Profile
Preparing a base image for Auto Deploy
Testing Deploy
How it works...
See also
Defining a vCloud development cycle
Getting ready
How to do it...
How it works...
There's more...
See also
Making the VM BIOS ID (UUID) unique
Getting ready
How to do it...
How it works...
Importing from Lab Manager into vCloud
Getting ready
How to do it...
Transferring networks
Transferring organizations and their resources
Transferring library or VM template elements
The rest
How it works...
There's more...
Using branding to make vCloud look different
Getting ready
How to do it...
Changes to vCloud
Changing the company name
Changing the logo
Changing the login theme
Changing the theme
How it works...
See also
Putting an ESXi host into maintenance
Getting ready
How to do it...
How it works...
See also
Updating vCloud Cells without interruption
Getting ready
How to do it...
How it works...
See also
Updating a vCloud with only one cell
Getting ready
How to do it...
How it works...
Updating a vCenter in vCloud
Getting ready
How to do it...
How it works...
See also
Updating vCNS
Getting ready
How to do it...
How it works...
Updating an Edge
Updating a vApp Network
Expanding vCD resources
Getting ready
How to do it...
An OvDC storage profile needs more space
A storage profile needs more space
An Organization needs more resources
An OvDC needs more resources
A PvDC needs more resources
How it works...
Resizing a VM hard disk
Getting ready
How to do it...
Not fast-provisioned VMs
Fast-provisioned VMs
How it works...
Cloning a running vApp
Getting ready
How to do it...
Clone to a catalog
Deploy a cloned VM from a catalog
Clone to My Cloud
How it works...
There's more...
Removing infrastructure from vCloud
Getting ready
How to do it...
Removing an ESXi Host from vCloud
Removing a cluster
Removing a cell from vCloud
Removing a vCenter from vCloud
How it works...
8. Troubleshooting vCloud
Introduction
Where to look for help
Looking for errors in the vCloud GUI
Getting ready
How to do it...
Creating an error
Fail log
Direct error messages
Organization of error logs
System logs
How it works...
Filtering the events
There's more
Working with vCloud logfiles
Getting ready
How to do it...
Working with a vCD cell logfile
Cell log
Debug log
vCNS logs
How it works...
Other logfiles
Important logfile locations
Cell.log
Debug log
Log rotate
There's more
Creating and uploading VMware support files
Getting ready
How to do it...
Create vCloud support files
Create vCNS support files
Upload to VMware
How it works...
There's more
Setting up and using vSphere Syslog Collector
Getting ready
How to do it...
Installing VMware Syslog server
Integrating vCloud into Syslog
Working with Syslog
How it works...
See also
Troubleshooting vCloud Router traffic
Getting ready
How to do it…
How it works….
Troubleshooting the Java client
Getting ready
How to do it...
How it works...
See also
Recovering from an outage
Getting ready
How to do it...
How it works...
A. Appendix
Index

VMware vCloud Director Cookbook

VMware vCloud Director Cookbook

Copyright © 2013 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: October 2013

Production Reference: 1171013

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78217-766-1

www.packtpub.com

Cover Image by Daniel Langenhan (<[email protected]>)

Credits

Author

Daniel Langenhan

Reviewers

Cody Bunch

Thomas Hepper

Mitesh Soni

Acquisition Editor

James Jones

Lead Technical Editor

Amey Varangaonkar

Technical Editors

Veena Pagare

Anand Singh

Copy Editors

Brandt D'mello

Kirti Pai

Alfida Paiva

Sayanee Mukherjee

Project Coordinator

Angel Jathanna

Proofreaders

Lindsey Thomas

Jonathan Todd

Indexer

Rekha Nair

Graphics

Ronak Dhruv

Abhinash Sahu

Production Coordinator

Prachali Bhiwandkar

Cover Work

Prachali Bhiwandkar

About the Author

Daniel Langenhan is a client-focused Virtualization Expert with more than 18 years of international industry experience.

His skills span the breadth of virtualization, ranging from architecture, design, and implementation for large multitier enterprise client systems to delivering captivating education and training sessions in security technologies and practices to diverse audiences.

In addition to this, he possesses an extensive knowledge and experience in process management, enterprise-level storage, Linux, and Solaris operating systems.

Utilizing his extensive knowledge, experience, and skills, he has a proven track record of successful integration of virtualization into different business areas, while minimizing cost and maximizing reliability and effectiveness of the solutions for his clients.

He has gained his experience with major Australian and international vendors and clients. Daniel's consulting company is well established with strong industry ties in many verticals, for example, finance, telecommunications, and print. His consulting business also provided services to VMware International.

Daniel is the author of Instant VMware vCloud Starter, Packt Publishing and VMware View Security Essentials, Packt Publishing.

I would like to thank my wife, Renata, for her tireless support and patience in all things. This book would not have been possible without her.

About the Reviewers

Cody Bunch is a Private Cloud/Virtualization Architect, VMware vExpert, and VMware VCP from San Antonio, TX. Cody has authored and co-authored several OpenStack and VMware books. Additionally, he has been a Technical Editor on a number of projects. Cody also regularly speaks at industry events and local user groups.

Cody has also worked on the OpenStack Cloud Computing Cookbook Second Edition, OpenStack Security Guide, Automating VMware vSphere with vCenter Orchestrator, Managing VMware Infrastructure with PowerShell, and VMware VI and VMware vSphere SDK books by Packt Publishing.

Thomas Hepper has worked for more than 20 years in the area of Computer Hardware and Software. With Silicon Graphics workstations, his long journey started through the Unix world (IRIX/HP-UX/AIX/Solaris/Linux). His first contact with the virtual world and Windows came later. Currently, he is responsible for an environment of approximately 1,300 VMs on approximately 150 physical systems, all running on VMware ESXi.

Mitesh Soni is a Technical Lead with iGATE's Cloud Services, Research & Innovation group. He is a Sun Certified Java Programmer, Sun Certified Web Component Developer, and VMware Cloud Professional. He has been involved in thought leadership and technology evangelization via papers, seminars, wikis, and creating solutions related to cloud computing. Mitesh has worked on cloud platforms such as Amazon Web Services, VMware vCloud, CloudStack, and CloudBees. He has published papers in national and international conferences. He is a regular author for cloud computing-related articles in the Open Source For You magazine.

Mitesh is interested in reviewing cloud computing-related books.

www.PacktPub.com

Support files, eBooks, discount offers and more

You might want to visit www.PacktPub.com for support files and downloads related to your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.

Why Subscribe?

Fully searchable across every book published by PacktCopy and paste, print and bookmark contentOn demand and accessible via web browser

Free Access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

Instant Updates on New Packt Books

Get notified! Find out when new books are published by following @PacktEnterprise on Twitter, or the Packt Enterprise Facebook page.

Preface

VMware vCloud has evolved to be one of the most exciting technologies in the last few years. It is not only the follow-up product to VMware Lab Manager but it also opens up your vSphere infrastructure for customer-based management. VMware vCloud allows you to manage your vSphere infrastructure and lets you push work from the administrators back onto the customers. This enables customers to self provide and self administer their resources without impacting their security or resource management.

This book contains the most up-to-date and enterprise-proven concepts to enhance your vCloud productivity. Not only do we discuss vCloud 5.1, but we also talk about the newest release, vCloud 5.5. You will see how to integrate these new features and increase your productivity even more.

We will present recipes that not only deal with the daily tasks but also present you with new ideas and concepts that you may not have thought of before, as well as give you some great tips and shortcuts.

What this book covers

Chapter 1, Setting Up Networks, walks you through the creation of the different networks that exist in vCloud. We will go from External Networks, through VXLANs, and the Cisco 1000v to Edge networks.

Chapter 2, vCloud Networks, plays with all the vCloud networking, routing, and isolation possibilities. Accessing isolated network, working with vCloud routers, as well as Edge and fencing will be investigated.

Chapter 3, Better vApps, delves into all that you can do with vApps. We will discuss the import and export of vApps as well as Guest Customization.

Chapter 4, Datastores and Storage Profiles, focuses on Datastores, storage profiles, and linked clones.

Chapter 5, Working with the vCloud API, introduces you to working with the vCloud API. We will be using PowerShell, PHP, vCenter Orchestrator as well as the REST API to build VMs.

Chapter 6, Improving the vCloud Design, will give you a new understanding of how to design a productive and effective vCloud environment.

Chapter 7, Operational Challenges, introduces you to solutions to combat common and uncommon operational problems. This chapter is a collection of all kinds of useful recipes that will provide you with tips and tricks on how to be more efficient with vCloud Director.

Chapter 8, Troubleshooting vCloud, focuses on logfiles, error finding, and recovery.

Appendix, contains a list of all the abbreviations used used in this book.

What you need for this book

The book was written using vCloud 5.1 and vCloud 5.5; therefore you need at least:

VMware vSphere 5.1 environment (or better)VMware vCloud Director 5.1 (or better)VMware vCloud Network and Security (vCNS) 5.1 (or better)

You can obtain trial licensing for vCloud from http://www.vmware.com/try-vmware.

In this book we will also discuss recipes that require the following software:

Generally used tools:

Flash 11 (or better)Java 7 (or better)Firefox or Internet ExplorerSSHSCP/SFTP

Tools for networks (Chapter 1, Setting Up Networks and Chapter 2, vCloud Networks):

Cisco 1000v and Cisco NSMm0n0Wall

Tools for API usage (Chapter 5, Working with the vCloud API):

VMware vCenter Orchestrator 5.1 (vCO) (or better; the appliance is OK too)VMware PowerCLIPowerGUIFirefox with the REST clientPHP

Who this book is for

VMware vCloud Director Cookbook is aimed at system administrators and technical architects moving from a virtualized environment to cloud environments.

This book assumes some previous knowledge of vCloud that can be obtained by referring to Instant VMware vCloud Starter by Daniel Langenhan. You need basic knowledge of the vCloud GUI as well as some experience with vSphere. An understanding of basic network terminology is beneficial.

The book was written using vCloud 5.1 and vCloud 5.5, but most of the concepts and recipes will also work with vCloud 1.5.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. Setting Up Networks

In this chapter, we will see how to set up the various network resources that we will use in the next chapter. We will cover the following recipes:

Setting up an External NetworkCreating 1,000 isolated networks without VXLANsMaking VXLANs workIntegrating Cisco 1000v into vCDGiving your networks an EdgeDoing it all(most) without a Distributed Switch

Introduction

Network virtualization is what makes vCloud Director such an awesome tool. However, before we go full out in the next chapter, we need to set up network virtualization, and it is what we will be focusing on here.

When we talk about isolated networks, we are talking about vCloud Director making use of different methods of the Network layer 3 encapsulation (OSI/ISO model). Basically, it's the same concept that was introduced with VLANs. VLANs split up the network communication in a network in different totally-isolated communication streams. vCloud makes use of these isolated networks to create networks in Organizations and vApps.

vCloud Director has three different network items listed as follows:

External Network: This is a network that exists outside vCloud, for example, a production network. It is basically a port group in vSphere that is used in vCloud to connect to the outside world. An External Network can be connected to multiple Organization Networks. External Networks are not virtualized and are based on existing port groups on vSwitch or a Distributed Switch (also called a vNetwork Distributed Switch or vNDS).Organization Network: This is a network that exists only inside one organization. You can have multiple Organization Networks in an organization. Organizational networks come in three different types:
Isolated: An isolated Organization Network exists only in this organization and is not connected to an External Network; however, it can be connected to vApp Networks or VMs. This network type uses network virtualization and its own network settings.Routed Network (Edge Gateway): An Organization Network connects to an existing Edge Device. An Edge Gateway allows defining firewall, NAT rules, DHCP services, Static Routes, as well as VPN connections and the load balance functionality. Routed Gateways connect External Networks to vApp Networks and/or VMs. This network uses virtualized networks and its own network settings.Directly connected: This Organization Network is an extension of an External Network into the organization. They directly connect External Networks to vApp Networks or VMs. These networks do NOT use network virtualization and they make use of the network settings of an External Network.
vApp Network: This is a virtualized network that only exists inside a vApp. You can have multiple vApp Networks inside one vApp. A vApp Network can connect to VMs and to Organization Networks. It has its own network settings. When connecting a vApp Network to an Organization Network, you can create a router between the vApp and the Organization Network, which lets you define DHCP, firewall, NAT rules, and Static Routing.

To create isolated networks, vCloud Director uses Network Pools. Network Pools are a collection of VLANs, port groups, and VLANs that can use layer 2 in the layer 3 encapsulation. The content of these pools can be used by Organizations and vApp Networks for network virtualization.

Network Pools

There are four kinds of Network Pools that can be created:

Virtual eXtensible LANs (VXLAN): VXLAN networks are layer 2 networks that are encapsulated in layer 3 packets. VMware calls this Software Defined Networking (SDN). VXLANs are automatically created by vCloud Director (vCD); however, they don't work out of the box and require some extra configuration in vCloud Network and Security (refer to the Making VXLANs work recipe).Network isolation-backed: These have basically the same concept as VXLANs; however, they work out of the box and use MAC-in-MAC encapsulation. The difference is that VXLANs can transcend routers whereas Network isolation-backed networks can't (refer to the Creating isolated networks without 1,000 VXLANs recipe).vSphere port groups-backed: vCD uses pre-created port groups to build the vApp or Organization Networks. You need to pre-provision one port group for every vApp/Organization Network you would like to use.VLAN-backed: vCD uses a pool of VLAN numbers to automatically provision port groups on demand; however, you still need to configure the VLAN trunking. You will need to reserve one VLAN for every vApp/Organization Network you would like to use.

VXLANs and Network isolation-backed networks solve the problems of pre-provisioning and reserving a multitude of VLANs, which makes them extremely important. However, using a port group or VLAN Network Pools can have additional benefits that we will explore later.

So let's get started!

Setting up an External Network

Let's start with something very simple, such as setting up an External Network.

Getting ready

Creating an External Network requires an existing port group in vSphere. This port group can be on a vSwitch, a Distributed vSwitch, or a Cisco 1000v Distributed Switch. The port group can be supported by a VLAN or a physical network.

How to do it...

Log in to vCloud Director with a system administrator (SysAdmin) role.Click on Manage & Monitor.Click on External Networks.Click on the green plus icon (+). Now, the New External Network wizard starts.Select the vCenter that contains the port group and then select the port group you want the External Network connected to. If you have many networks, there is a filter just on the right above the list of the networks, as seen in the following screenshot:Add a subnet definition that contains at least the Gateway address, Network mask, and a Static IP pool by clicking on Add, as shown in the following screenshot:Enter a name for this network and close the wizard.

The External Network will now be created and is ready to be used.

How it works...

An External Network is just a connection between vCloud Director and a port group on vSphere. vCloud Director adds IP management to the port group. When creating an External Network, you have to define a pool. This pool is used to automatically assign IP addresses to VMs, Edge Gateways, or vApp routers attached to this External Network. A Static IP Pool has to contain a minimum of one IP, but can contain the maximum available IPs minus the gateway address. vCloud Director will manage all the IPs assigned though Organization Networks and Edge devices. The IP assignments can be seen by right-clicking on the External Network and selecting IP Allocations as shown in the following screenshot:

Using only one IP in an External Network Static IP Pool is interesting only if all IPs for VMs are assigned manually and no Edge or vApp router is used. If this is not the case, one should assign at least 5 to 10 IPs to the Network Pool. We will make excessive use of the External Network and we will use its IP pool for load balancing, VPNs, and much more.

There's more...

You can assign more than one IP range to an External Network, making it possible to create more than one IP range that can be used. However, IP allocation happens automatically and you are not able to control which IP from what range will be allocated to which specific VM. Creating multiple IP network ranges in External Networks is preferable when used together with IP suballocation in Edge devices.

When a VM is destroyed or undeployed, the IP will be released back to the pool. The setting of the default time for the IP release is set by navigating to Administration | General | IPaddress release timeout. The default value is 0 seconds. This setting specifies how long discarded IP addresses should be held before they can be reused. Think about your ARP tables and how long you have set your router's refresh time. If IP addresses are reallocated to new MAC addresses, a router might not be able to route it properly.

Creating 1,000 isolated networks without VXLANs

Network Pools are essential for network virtualization. If you are not sure about VXLAN networks, here is how you create 1,000 networks using only one VLAN.

Getting ready

As I have already mentioned, we need one VLAN that is trunked to a Distributed Switch. The VLAN doesn't need to be routed. The only other requirement is that the network gear can accommodate a higher MTU.

How to do it...

In the system organization, we click on Manage & Monitor and then on Network pools.Now click on the green plus (+) icon to add a Network Pool.Now click on Network Isolation-backed as shown in the following screenshot:Define how many networks you would like to create. The maximum is 1,000:Type in the VLAN number you would like to use for the Network Pool.Now select the vCenter and the Distributed Switch you want to use.Give the Network Pool a name.After clicking on Next, you will see all the values you have entered.Click on Finish in order to create the Network Pool.Now we need to set the MTU for this VLAN to a minimum of 1524.

A safer choice is 1600, as this makes sure you have enough room for additional encapsulations down the track. Make sure that your physical switching infrastructure can use a higher MTU than the default 1500.

Click on the created Network Pool and select Properties.Click on Network pool MTU and set the MTU to 1600 as shown in the following screenshot:Click on OK.

How it works...

Network isolation-backed networks actually don't use layer 2 and layer 3 encapsulations, but they use the MAC-in-MAC encapsulation. When a new vApp or Organization Network is created, vCD will create a new port group and will then use this port group to encapsulate the traffic on a MAC basis. The same technique was used in VMware Lab Manager, which was then called Host Spanning Networks. This doesn't come without cost. Because of the additional encapsulation, another 24 bits are required for each package, meaning that the MTU should be increased to a minimum of 1524. If you don't change the MTU, you will have a network frame fragmentation.

The good thing is that Network isolation-backed Network Pools are quite fast and easy to configure and set up. They provide you with 1,000 isolated networks for each VLAN. You can define more than one Network isolation-backed network. However, you can only assign one Network Pool to an Organizational virtual Datacenter (OvDC), as there is a one-to-one relationship between them. You cannot create isolated networks before you assign a Network Pool to an OvDC.

To assign a Network Pool to an OvDC:

Navigate to Manage & Monitor | Organizational VDC.Right-click on the OvDC you want the pool assigned to and select Properties.Click on Network pool & Services.Select the network pool you like to assign as shown in the following screenshot:Select the number of networks you would like to assign to the OvDC as shown in the following screenshot.

One of the disadvantages is that the networks are isolated, meaning we can't use them for anything other than vCloud Director.

See also

We will work extensively with vApp and Organization Networks in Chapter 2, vCloud Networks

Making VXLANs work

VXLANs are great, but they don't work out of the box. In the following sections, we discuss how to set them up.

Getting ready

As you already have vCloud set up, you must have a vCloud Network and Security appliance (vCNS) deployed (formally known as vShield), and it should be configured to use your vCenter. For this recipe, you will need to be able to log in to the vCNS appliance with an administrator account.

Additionally, we need a VLAN on which the VXLANs will exist, and having a DHCP in that VLAN makes things easier. If no DHCP is accessible on this VLAN, you will need to provide one IP address per ESXi server in this VLAN.

The Segment ID you have to enter in step 14 in the How to do it… section is rather important, especially when you have multiple vCNS or vCloud installations (not multiple cells). Each of these installations should have a different range. If this is your first VXLAN installation, just use the range that is supplied in the steps.

Last but not least, you should have a multicast address range (see http://en.wikipedia.org/wiki/Multicast_address); this is best arranged with the network administrator. If you can't figure out what to use, the range given in the steps will work fine for a VXLAN that exists only in one location.

Note

If you are using the Cisco 1000v, please check out the Integrating the Cisco 1000v into vCD recipe before continuing here.

How to do it...

Open a browser and browse to the vCNS appliance https://[ip of vCNS].Log in to the appliance (the default username is admin and the password is default).Make sure that you have switched to the Host & Clusters view.Expand the Datacenters folder.Click on your data center.On the right side of the screen, you should now find multiple menus; one of them saysNetwork virtualization, so click on it.Now select Preparation and then Connectivity as shown in the following screenshot:Click on Edit.Select your Cluster.Select the Distributed Switch as well as the VLAN ID for the VXLAN that you want to use and click on Next as shown in the following screenshot:Now select a Teaming policy (for example, Fail Over) and its MTU (for example, 1600) as shown in the following screenshot:Click on Finish.Wait until the agents are installed on all the ESXi servers. The status should then show Normal (you might need to refresh).Click on Segment ID and then on Edit as shown in the following screenshot:You have to now enter a range for the Segment IDs (for example, 5000-6000).Now enter the Multicast address range (for example, 225.1.1.1-225.1.2.254).Click on Finish.We are now done with vCNS and can leave the rest to vCloud Director.Log in to vCloud Director and click on Network pools.The VXLAN pool, which is automatically created with your PvDC, should now show a green tick. If this is not the case, right-click on it and select Repair.

How it works...

VXLANs were created by VMware together with Cisco. The idea was to solve the problems of modern data centers. Typically, these problems relate to the inflexibility of VLAN and Switching boundaries due to too much subnetting, IP, and VLAN management. The idea behind VXLANs is to create virtualized networking that is used on top of the common networking layer. They are in use just like the Network isolation-backed Network Pools we discussed in the other recipe; however, VXLANs have the benefit of being routable, flexible, and can transcend to different locations. This makes them extremely flexible and elegant to use.

VXLANs are actually like VLANs; the main difference is that VLANs (802.1q) have a 12-bit namespace whereas VXLANs have a 24-bit one, which increases the number of VLANs from 4,096 to more than 16 million unique namespaces.

VXLANs use layer 2 in layer 3 encapsulation. This means they use the Internet Protocol (IP, layer 3) to propagate the networks (from layer 2 upward), making them routable and far more flexible across network borders. One could envision VXLANs as a tunnel between two endpoints where additional networks exist.

There's more...

VXLANs don't really exist in vCloud Director; VXLANs are defined in the vCNS appliance. vCNS creates the VXLAN tunnel endpoints and manages the VXLANs for the whole virtual infrastructure. For all this to happen, vCNS must install an agent on each ESXi server. This is done when you click on Finish, as explained in step 12 in the How to do it… section of this recipe. These agents provide the connection between VMs and the VXLANs. As the VXLAN packages are bigger than the common network packages, we have to adjust the MTU to avoid frame fragmentation. A safe setting is 1600. Each agent will be deployed and connected to a new vmknic. The IP for the vmknic is assigned via DHCP; however, this can be changed in vCNS for each ESXi server.

The Fail Over policy that you set on the Distributed Switches depends on what the physical switching architecture can do. If EtherChannels are set up, choose them. Link Aggregation Control Protocol (LACP) can be chosen either in active or passive mode. LACP in an active mode sends out packages to talk to LACP-activated devices, whereas in a passive mode it waits until a LACP-activated device talks to it. If in doubt about all of this, please involve your network team.

If you want to configure VXLANs with Static IPs for each vmknic, follow the ensuing procedure:

Log in to vCNS as an administrator.Navigate to Hosts & Clusters View | Datacenter | [your datacentre] | Network Virtualization | Connectivity as shown in the following screenshot:Write down which vmknic is used for VXLANs.Log in to vCenter as an administrator.Set a fixed IP for each of the vmknics on each ESXi server.

See also

The following are some links for further reading:

VMware's easy to read explanation at http://www.vmware.com/solutions/datacenter/vxlan.htmlCisco's Digging deeper into VXLAN at http://blogs.cisco.com/datacenter/digging-deeper-into-vxlanA good case study on VXLANs at http://it20.info/2012/05/typical-vxlan-use-case/

Integrating the Cisco 1000v into vCD

The Cisco 1000v Distributed Switch is an alternative to the VMware Distributed Switch; however, getting it working with vCloud is a challenge. In the following sections, we will see how to overcome it.

Getting ready

First and foremost, we need the Cisco 1000v installed (refer to the How it works section in this recipe). The next important thing is to hook the Cisco 1000v up to vCenter (refer to the See also section links in this recipe). After all this is done, you can use the Cisco 1000v in vSphere and we can now start linking it up to vCloud.

How to do it...

Log on to the Cisco 1000v Virtual Supervisor Module (VSM).Run the following commands to activate the REST interface of the VSM:
1kv# conf t1kv (Config)# feature network-segmentation-manager1kv (Config)# feature segmentation1kv (Config)# exit1kv # copy running-config startup-config[########################################] 100%1kv# exit
Log out of the Cisco 1000v.Log in to the vCNS (vShield) as an administrator.Click on Settings & Reports.Click on Networking and then on Add Switch Provider as shown in the following screenshot:Now enter the Cisco VSM IP or hostname and the service API URL https://[VSM IP] /n1k/services/NSM.Enter the admin credentials for the VSM and click on OK.

And that's it. Now you can use the Making VXLANs work recipe to create VXLANs using the Cisco 1000v.

How it works...

The Cisco 1000v replaced the VMware Distributed Switch. The benefit of this is that you can use the Cisco tools and Cisco language to configure it. For all intents and purposes, it acts and behaves like a Cisco physical switch. One of the drawbacks is that there can be maximal 63 hosts (63 hosts and one Cisco v1000) connected to one Cisco 1000v and the integration between Cisco and VMware isn't as smooth as it may appear to be.