390

How to Cheat at Configuring Vmware Esx Server

Embed Size (px)

Citation preview

  • David Rule Jr.

  • This page intentionally left blank

  • Elsevier, Inc., the author(s), and any person or fi rm involved in the writing, editing, or production (collectively Makers) of this book (the Work) do not guarantee or warrant the results to be obtained from the Work.

    There is no guarantee of any kind, expressed or implied, regarding the Work or its contents. The Work is sold AS IS and WITHOUT WARRANTY. You may have other legal rights, which vary from state to state.

    In no event will Makers be liable to you for damages, including any loss of profi ts, lost savings, or other incidental or consequential damages arising out from the Work or its contents. Because some states do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.

    You should always use reasonable care, including backup and other appropriate precautions, when working with computers, networks, data, and fi les.

    Syngress Media, Syngress, Career Advancement Through Skill Enhancement, Ask the Author UPDATE, and Hack Proofi ng, are registered trademarks of Elsevier, Inc. Syngress: The Defi nition of a Serious Security Library, Mission Critical, and The Only Way to Stop a Hacker is to Think Like One are trademarks of Elsevier, Inc. Brands and product names mentioned in this book are trademarks or service marks of their respective companies.

    PUBLISHED BYSyngress Publishing, Inc.Elsevier, Inc.30 Corporate DriveBurlington, MA 01803

    How to Cheat at Confi guring VmWare ESX ServerCopyright 2007 by Elsevier, Inc. All rights reserved. Printed in the United States of America. Except as permitted under the Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher, with the exception that the program listings may be entered, stored, and executed in a computer system, but they may not be reproduced for publication.

    Printed in the United States of America1 2 3 4 5 6 7 8 9 0

    ISBN 13: 978-1-59749-194-5

    Publisher: Andrew WilliamsPage Layout and Art: SPi

    For information on rights, translations, and bulk sales, contact Matt Pedersen, Commercial Sales Director and Rights, at Syngress Publishing; email [email protected].

  • This page intentionally left blank

  • Lead Author

    David Rule Jr. (VMware VCP, VAC, MCP, Citrix CCEA, CCA) is a Senior Consultant for Choice Solutions LLC, an Overland Park, KS-based systems integrator that provides IT design, project management, and support for enterprise computing systems. Davids primary role is in developing virtualization strategies for Choice Solutions clients.

    v

  • Contributing Authors

    Al Muller is a consultant for Callisma, a wholly owned subsidiary of AT&T. He has been in the IT fi eld since 1995, getting his start as a database administrator in the Navy. In 2002 he began using VMwares GSX Server and within a year was involved in his fi rst virtualization project. Since then, he has been an eager proponent of virtualization technology and has worked on a number of different server consolidation and virtualization projects.

    He holds a bachelors degree in English and plans on writing a series of books on the virtual evolution taking place in data centers worldwide and the tools required to leverage and support a virtual infrastructure.

    Stephen Beaver (CCNA, MCSE, MCP+I, VCP), Technical Editor of VMware ESX Server: Advanced Technical Design Guide. He is currently a systems engineer with Florida Hospital in Orlando, FL. Stephen is the lead architect for all the virtual systems throughout the hospital. As such, he develops and touches every part of all things virtual through all the systems lifecycle from design, testing, integration and deployment to operation management and strategic planning. Stephen background includes positions as a senior engineer with Greenberg Traurig P.A where he designed and deployed their virtual infrastructure worldwide. Stephen has over 10 years of experience in the industry with the last three years almost completely dedicated to virtualization. Stephen is also one of the most active participants in the VMware Technology Network forums as well as being a presenter for VMWorld 2005 and the upcoming VMWorld 2006.

    David E. Hart (MCSE#300790, ASE #220919, VCP #4970) is a senior consultant with Callisma. He currently provides senior-level strategic and technical consulting to all Callisma clients in the south-central region of the U.S. His specialties include virtualization technologies, Microsoft Active Directory design and implementation, emerging technology planning, collaboration architecture and design, content delivery design and implementations, enterprise operating systems troubleshooting and optimization, and desktop

    vi

  • architecture design and implementation. Davids background spans over 15 years in the industry and includes positions at one of the top fi ve consulting fi rms as the South Central Microsoft Practice and VMware Lead for seven years, Microsoft Practice Lead and Senior Microsoft Consultant at a top three telecommunication company for fi ve years, and Desktop Enterprise Practice Lead for a nationwide consulting fi rm for two years.

    I wish to thank my peers at Callisma for asking me to contribute to this book. I also wish to thank my biggest supporters: my wife, Nirma, for putting up with me and all the noise and heat coming from my offi ce, and my two sons, Izzy and Corbin, for letting me work when theyd rather have daddy time. Lastly, Id like to thank my parents, Don and Judy, for always encouraging me to follow my dreams.

    David Payne is an IT enthusiast with a decade of real-world experience in the data center. David is currently CTO of Xcedex, the only U.S.-based professional services fi rm solely focused on virtualization solutions. David has been key in developing the virtualization practice for Xcedex Professional Services. Specifi cally over the last four years, David has been engaged in dozens of virtualization initiatives, providing architecture guidance and hands on services for organizations of all sizes across the United States. His practical approach has taken some of the largest US companies in fi nance, retail, and manufacturing beyond the marketing spin and into real results with todays virtualization technologies. David is a VMware Authorized Consultant (VAC) and a VMware Certifi ed Professional (VCP).

    Xcedex is a VMware Premier Partner, joining this invitation-only program as one of the fi rst 10 partners in 2004. Xcedex is recognized nationwide for its professionalism, deep knowledge of virtual infrastructure, and experience in real-world implementations. With a laser focus on virtualization consulting, Xcedex has become one of the top go-to service delivery partners for VMware, Dell, and EMC.

    Jeremy Pries is a Virtualization Architect at Xcedex. He has an extensive background in computing infrastructure dating back 10 years, with experience ranging from networking and storage to security and Intel based operating systems. Jeremys current focus is 100% on virtualization technologies, gaining valuable experience on some of the largest ESX implementations. Jeremys

    vii

  • specialty is fi lling gaps in management tools to speed project timelines and increase accuracy. His expertise has made him one of the most sought after Xcedex architects. Jeremy is a VMware Authorized Consultant (VAC) and a VMware Certifi ed Professional (VCP).

    Xcedex is a VMware Premier Partner, joining this invitation-only program as one of the fi rst 10 partners in 2004. Xcedex is recognized nationwide for its professionalism, deep knowledge of virtual infrastructure, and experience in real-world implementations. With a laser focus on virtualization consulting, Xcedex has become one of the top go-to service delivery partners for VMware, Dell, and EMC.

    Paul Summitt (MCSE, CCNA, MCP+I, MCP) holds a masters degree in mass communication. Paul has served as a network, an Exchange, and a database administrator, as well as a Web and application developer. Paul has written on virtual reality and Web development and has served as technical editor for several books on Microsoft technologies. Paul lives in Columbia, MO, with his life and writing partner, Mary.

    Andy Jones (MCSE+I, MCT, CCIA, CCEA, CCI, CCNA, CCDA, MCIW, Network+, A+,) is the Services Director for MTM Technologies, previously known as Vector ESP. He provides comprehensive solutions focused on Citrix and Microsoft technologies for clients ranging from 50 to 50,000 users, focusing mainly on architecting and deploying Access Infrastructure solutions for enterprise customers. One of Andys primary focuses is in developing best practices, processes and methodologies surrounding Access Infrastructure that take into consideration and integrate with virtually every part of a customers infrastructure.

    In addition to fi eld work and business development, Andy regularly instructs Microsoft and Citrix courses. Andy holds a masters degree from Morehead State University.

    David E. Williams works as an Infrastructure Manager for the John H. Harland Company in Atlanta, GA. Harland is one of the leading software companies focused on fi nancial institutions, one of the largest check printers in the country, and the leader in testing and assessment solutions for the education market. In addition to managing IT resources, he is also a senior

    viii

  • architect and an advisory engineer, providing technical direction and advice to Harlands management team in long-range planning for new or projected areas of enterprise projects.

    He is also a principal at Williams & Garcia, LLC, a consulting practice specializing in delivering effective enterprise infrastructure solutions. He specializes in the development of advanced solutions based on Microsoft technologies and strategic infrastructure designs.

    David studied Music Engineering Technology at the University of Miami, and he holds MCSE, MCDBA, VCP, and CCNA certifi cations.

    ix

  • This page intentionally left blank

  • Contents

    Chapter 1 Installing VMware ESX Server 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    ESX Server 3 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Downloading the latest Installation Media . . . . . . . . . . . . . . . . . . . . . . . . . . . 3ESX Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Solutions Fast Track . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    Chapter 2 Installing Virtual Center. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26VirtualCenter Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Installing Virtual Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27VirtualCenter Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42Adding Hosts to VirtualCenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48Confi guring ESX Server Networking in VirtualCenter . . . . . . . . . . . . . . . . . . . 53Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

    Chapter 3 Creating Virtual Machines and Gold Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67Creating Virtual Machine Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68Deploying Virtual Machines from templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

    Chapter 4 Physical to Virtual Migrations (P2V) . . . . . . . . . . . . . . . . . . . . . . . 85Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86Installing VMware Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87Using VMware Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

    Part II Scripting VMware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

    Chapter 5 Scripted Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110Setting Up the Scripted Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

    Creating the Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

    xi

  • Remote Network Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

    Chapter 6 An Introduction to ESX Native Tools and How to Use Them . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122Esxtop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

    Esxtop Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122The Virtual Machine World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124System World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126The Service Console World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

    Some Other Helpful Esxtop Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126%USED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126%Ready. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126%EUSED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126%MEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

    vmkfstools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127Viewing Contents VMFS Partition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127Import/Export Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127Adding a New Virtual Disk, Blank Virtual Disk,

    and Extending Existing Virtual Disks . . . . . . . . . . . . . . . . . . . . . . . . 128vmware-cmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

    vmkusage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

    Chapter 7 Scripting and Programming for the Virtual Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134VMware Scripting APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

    What Are the VMware Scripting APIs? . . . . . . . . . . . . . . . . . . . . . . . . . . . 136Installing the VMware Scripting APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137Putting the VMware Scripting APIs to Work for You . . . . . . . . . . . . . . . . . 138

    Working with the VmCOM API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138VmConnectParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141VmCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142VmServerCtl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143VmCtl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144Managing Guests with User-Defi ned Variables . . . . . . . . . . . . . . . . . 150

    Working with the VmPerl API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150VMware::VmPerl::ConnectParams . . . . . . . . . . . . . . . . . . . . . . . . . . 151VMware::VmPerl::Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152

    xii Contents

  • VMware::VmPerl::VM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153VMware::VmPerl::Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

    Putting It All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157Example 1: Disconnecting Devices from Every Registered VM . . . . . 157Example 2: Simple GUI to List All Virtual Machines . . . . . . . . . . . . . 159Example 3: Test Automation with VMware . . . . . . . . . . . . . . . . . . . . 162

    VMware Virtual Infrastructure SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163What Is the VMware Virtual Infrastructure SDK? . . . . . . . . . . . . . . . . . . . . 164

    The VI SDK Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165Overview of the VMware Virtual Infrastructure Web Service . . . . . . . . . 167

    What Are Web Services? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167VMware VI SDK Conformance and Web Service Standards . . . . . . . . 168

    Operations Available Using the Virtual Infrastructure SDK . . . . . . . . . . . 168Operations for Basic Web Service Client Interaction . . . . . . . . . . . . . 168Operations for Element Management . . . . . . . . . . . . . . . . . . . . . . . . 168Operations for Virtual Computing . . . . . . . . . . . . . . . . . . . . . . . . . . 169

    Developing with the Virtual Infrastructure SDK 1.1 . . . . . . . . . . . . . . . . . . 170Preparing the Virtual Infrastructure Web Service . . . . . . . . . . . . . . . . . . 171Working with the VMware WSDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173Virtual Infrastructure SDK 1.1 Concepts and Terminology. . . . . . . . . . . 176

    Path Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178Programming Logic for the SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . 179Data Models and Datatypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

    Developing Your Management Application . . . . . . . . . . . . . . . . . . . . . . 181The Connection Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181Handling SSL Certifi cates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183Obtaining with Object Handles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185Retrieving Items and Performing Operations . . . . . . . . . . . . . . . . . . 188Updating Interior Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191

    Developing with the Virtual Infrastructure SDK 2.0 . . . . . . . . . . . . . . . . . . 192Features Added to Virtual Infrastructure 2.0 . . . . . . . . . . . . . . . . . . . . . . 192Preparing the Virtual Infrastructure 2.0 Web Service . . . . . . . . . . . . . . . 194Working with the VMware VI SDK 2.0 WSDLs . . . . . . . . . . . . . . . . . . 196Virtual Infrastructure SDK 2.0 Concepts and Terminology. . . . . . . . . . . 197

    Data and Managed Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197Managed Entity Inventory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198Host Agent versus VirtualCenter Feature Set . . . . . . . . . . . . . . . . . . . 198Data Models and Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199Programming Logic for the VI SDK 2.0 . . . . . . . . . . . . . . . . . . . . . . 203

    Contents xiii

  • xiv Contents

    Developing Your Management Application . . . . . . . . . . . . . . . . . . . . . . 204Managed Object Browser and Other Tools . . . . . . . . . . . . . . . . . . . . 205The Connection Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209Handling SSL Certifi cates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211Retrieving Property Information . . . . . . . . . . . . . . . . . . . . . . . . . . . 212Other Retrieval Mechanisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

    Performing Advanced Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218Power Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218Virtual Machine Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219Working with Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220Working with Scheduled Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

    Other VMware SDKs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222VMware Guest SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222VMware CIM SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

    Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

    Chapter 8 Building a VM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228Creation of Virtual Machines Utilizing

    Command-Line Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228Creation of a Virtual Machine Confi guration File . . . . . . . . . . . . . . . . . . . 228

    Creating Your Virtual Machine Confi guration File . . . . . . . . . . . . . . . . . 230Creation of a Virtual Machine Disk File . . . . . . . . . . . . . . . . . . . . . . . . . . . 234Registering Virtual Machines with ESX Server . . . . . . . . . . . . . . . . . . . . . 236

    Scripting Creation of Virtual Machines in ESX Shell . . . . . . . . . . . . . . . . . . . . 237Scripting Creation of Virtual Machines in Perl Scripts . . . . . . . . . . . . . . . . . . . 243

    Modifying Scripted VM Creation with Perl . . . . . . . . . . . . . . . . . . . . . . . . 250Perl Script Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251

    VmPerl Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254Cloning Virtual Machines Utilizing ESX Shell Scripts . . . . . . . . . . . . . . . . . . . 254Cloning Virtual Machines Utilizing VmPerl Scripts . . . . . . . . . . . . . . . . . . . . . 258Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267

    Chapter 9 Modifying VMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270The Virtual Machine VMDK File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270

    VMDK Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272Version=1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272CID=2af6d34d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272parentCID=ffffffff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272fi le.createType=twoGbMaxExtentSparse . . . . . . . . . . . . . . . . . . . . . . 272

  • The Size in Sectors Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273The Disk Data Base Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273

    The Virtual Machine Confi guration vmx File . . . . . . . . . . . . . . . . . . . . . . 275vmx File Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276

    confi g.version = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276Scsi0:0.present = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276Scsi0:0.name = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276Scsi0:0.mode = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276scsi0.present = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277scsi0.virtualDev = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277ethernet0.present = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277ethernet0.connectionType = . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278ethernet0.devName = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278ethernet0.networkName = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278Ethernet0.addressType = vpx . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278Ethernet0.generatedAddress = . . . . . . . . . . . . . . . . . . . . . . . . . . . 278Ethernet0.virtualDev = vlance or vmxnet or e1000 . . . . . . . . . 279

    Floppy Drives and CD-ROMs for Virtual Machines . . . . . . . . . . . . . . . 279Graphics Emulation, Unique Identifi ers. . . . . . . . . . . . . . . . . . . . . . . . . 279Priority, VMware Tools Settings, and Suspend . . . . . . . . . . . . . . . . . . . . 280

    isolation.tools.dnd.disable = True or False . . . . . . . . . . . . . . . . . . 281suspend.Directory = /vmfs/vmhba1:0:83:1 . . . . . . . . . . . . . . . . . . 281

    Autostart, Autostop, and Time Sync Options . . . . . . . . . . . . . . . . . . . . . 281The tools.syncTime Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282

    Virtual Machine Conversion from IDE to SCSI . . . . . . . . . . . . . . . . . . . . . . . 282ddb.adapterType = buslogic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283ddb.adapterType = lsilogic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283Scripted Disconnect of IDE Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285

    Dynamic Creation of Virtual Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

    Chapter 10 Instant Disk: How to P2V for Free . . . . . . . . . . . . . . . . . . . . . . 297Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298What Is a P2V? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298P2V Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

    VMware P2V Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299Platespin PowerConvert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299Barts/Ghost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300

    The Big Secret of P2V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300Instant Disk Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

    Contents xv

  • xvi Contents

    The Bad News . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301Prepping the ESX Host: Setting Up FTP

    on ESX Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301Prepping the Source Machine: Install the SCSI Driver . . . . . . . . . . . . . . . . . . . 304

    Installing the SCSI Driver in Windows 2000/2003 . . . . . . . . . . . . . . . . . . . 305Installing the SCSI Driver in Windows NT . . . . . . . . . . . . . . . . . . . . . . . . 312

    Continue Prepping the Source Machine: Validate . . . . . . . . . . . . . . . . . . . . . . . 314The Linux Rescue CD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

    Booting the Rescue CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315At the Command Prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321Finding the Hard Drives and Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

    Linux and Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323Virtual Disk Files on the VMFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323Starting the FTP Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325Creating a New Virtual Machine and Pointing

    It to a New VMDK File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326Windows VMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

    Post-P2V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

    Chapter 11 Scripting Hot Backups and Recovery for Virtual Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332Anatomy of a VM Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

    Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335Layered REDO Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

    Hot VM Backup Sample Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339Choosing the Target for VM Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

    NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342Attributes of NFS for VM Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343

    Pros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343Cons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343

    CIFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343Attributes of CIFS for VM Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . 344

    Pros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344Cons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344

    FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344Attributes of FTP for VM Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344

    Pros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344Cons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

  • Contents xvii

    VMFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345Attributes of Copies to VMFS for VM Backups . . . . . . . . . . . . . . . . . . . 345

    Pros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345Cons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

    Existing VM Backup Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346vmsnap.pl, vmsnap_all, and vmres.pl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .347vmbk.pl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347Commercial Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348

    VMX File Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349Incorporating Hot VM Backups into Your Recovery Plan . . . . . . . . . . . . . . . . 352

    Crash Consistent State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355Hot VM Backups as Part of the Recovery Plan . . . . . . . . . . . . . . . . . . . . . 355

    1st Step: Take an Inventory of Your Virtual Machines . . . . . . . . . . . . . 3562nd Step: Determine the Recovery Point Objective for Each VM . . . 3573rd Step: Determine the Recovery Time Objective for Each VM . . . . 3574th Step: Apply the Right Backup Job to the Need . . . . . . . . . . . . . . 3575th Step: Document Your Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 358

    Hybrid Backup Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

    Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363

  • 1Chapter 1

    Solutions in this chapter:

    VMware ESX Server 3 Installation Overview

    VMware ESX Server 3 Prerequisites

    VMware ESX Server 3 Installation

    Summary

    Solutions Fast Track

    Frequently Asked Questions

    Installing VMware ESX Server 3

  • 2 Chapter 1 Installing VMware ESX Server 3

    IntroductionVMware ESX Server 3 installs on Bare Metal. Unlike some virtualization applications VMware ESX Server 3 is also the Operating System. When installing VMware ESX Server 3 you do not need to fi rst install another operating system such as Windows 2003 server or Linux fi rst. You instead simply need to install VMware ESX Server 3 on the Server.

    The installation of VMware ESX Server 3 can be quite simple. A typical installation takes under thirty minutes. If you have ever in installed Red Hat Linux or other popular Linux distributions you will fi nd the installation very similar. The installation of VMware ESX server 3 simply get the server up and running on VMware. Most of the settings that are critical for a successful VMware deployment are confi gured after the initial installation; they are confi gured using the VMware Infrastructure Client. We will cover this in the next chapter which will focus on post installation tasks.

    There are three main methods for the installation of VMware ESX server 3:

    Graphical

    Text

    Scripted

    This chapter will focus on the graphical method of installation.

    PrerequisitesESX Server 3 RequirementsESX Server requires a computer with the following specifi cations:

    Two or more physical processors

    1500 MHz Intel or AMD 32 Bit Processor

    1500 MHz Intel or AMD 64 Bit Processor

    1GB RAM One or more Ethernet cards

    Unpartitioned space on a SCSI disk, or SAN LUN.

  • Installing VMware ESX Server 3 Chapter 1 3

    Downloading the latest Installation Media1. Open your browser and go to www.vmware.com/download

    2. Click on the Download link shown in Figure 1.1.

    NOTEVMware ESX Server 3 has a very specifi c hardware compatibility list (HCL). Before installing VMware ESX Server 3 you should always ensure that you are using compatible hardware. The VMware ESX Server 3 compatibility guide can be found at the following location. http://www.vmware.com/pdf/vi3_systems_guide.pdf

    Figure 1.1 Download Link

    3. Under VMware ESX Server 3 click Download Now as shown in Figure 1.2.

  • 4 Chapter 1 Installing VMware ESX Server 3

    4. Enter your VMware username (e-mail address) and password to continue. If you do not currently have a username registered click the New Users link shown in Figure 1.3.

    Figure 1.2 Download Now

  • Installing VMware ESX Server 3 Chapter 1 5

    5. Click YES to accept the license agreement shown in Figure 1.4.

    Figure 1.3 New Users Link

    Figure 1.4 License Agreement

    6. Click ISO image to download the latest image on the installation media shown in Figure 1.5.

  • 6 Chapter 1 Installing VMware ESX Server 3

    7. Use your favorite CD burning software to create a CD from the ISO image.

    ESX Installation1. Power on the machine with the VMware ESX Server CD in the CD-ROM

    drive shown in Figure 1.6. (Note be sure that all SAN Fiber connections are disconnected at this point.)

    Figure 1.5 Download the Latest ISO

  • Installing VMware ESX Server 3 Chapter 1 7

    2. You can choose to test the media or skip the test if you are using media that you know if reliable. Note when using media for the fi rst time it is advisable to choose to test the media fi rst. (See Figure 1.7.)

    Figure 1.6 Introduction Screen

  • 8 Chapter 1 Installing VMware ESX Server 3

    3. At the Welcome screen choose Next. (See Figure 1.8.)

    Figure 1.7 Media Test

  • Installing VMware ESX Server 3 Chapter 1 9

    4. At the Keyboard Confi guration screen accept the defaults and click Next. (See Figure 1.9.)

    Figure 1.8 Welcome to the ESX Server 3 Installer

  • 10 Chapter 1 Installing VMware ESX Server 3

    5. At the Mouse Confi guration screen select Wheel Mouse (PS2), and click Next. (See Figure 1.10.)

    Figure 1.9 Select Keyboard

  • Installing VMware ESX Server 3 Chapter 1 11

    6. At the End User License Agreement screen click Next. (See Figure 1.11.)

    Figure 1.10 Mouse Confi guration

  • 12 Chapter 1 Installing VMware ESX Server 3

    7. A Warning may appear stating that the partition table was unreadable. This is normal especially on new systems. You need to click Yes to continue. (See Figure 1.12.)

    Figure 1.11 End User License Agreement

  • Installing VMware ESX Server 3 Chapter 1 13

    8. At the Partitioning Options screen you can choose either recommended or Advanced. For most installations you should choose Reccommended. Advaned is used when you would like to create the partitioning manually. (See Figure 1.13.)

    Figure 1.12 Partition Table Warning

  • 14 Chapter 1 Installing VMware ESX Server 3

    9. After choosing a partitioning method you will receive a pop up warning notifi ying you that by continuing all partitions will be removed. Choose Yes to continue. (See Figure 1.14.)

    Figure 1.13 Partitioning Options

  • Installing VMware ESX Server 3 Chapter 1 15

    10. The Partition Disks screen shows the current disk layout and allows you to Edit, Add, or Remove partitions. (See Figure 1.15.)

    ESX Server supports up to 256 LUNs for operation (Only 128 are supported during installation)

    The minimum LUN capacity for VMFS3 is 1.2 GB

    VMFS 3 is supported on Fibre Channel, iSCSI, and NAS external devices.

    Figure 1.14 Remove All Partitions Warning

  • 16 Chapter 1 Installing VMware ESX Server 3

    11. The Advanced options screen allows you to choose from which device the ESX server will boot. For most impletations that are using internal drives for the ESX operating system the default should be fi ne. (See Figure 1.16.)

    Figure 1.15 Partition Disks

  • Installing VMware ESX Server 3 Chapter 1 17

    12. At the network confi guration screen you need to put in the specifi c network settings for the ESX server. There are a few things to pay specifi c attention to at this point. (See Figure 1.17.)

    First it if much easier to put in the specifi c IP information at this point. If you choose DHCP here and intend to give it a static IP address later you will fi nd that dong it later requires much more work.

    Second in the Host name fi eld it is important to use the fully qualifi ed domain name. This is required for the HA feature of ESX to work properly. Also the DNS entry for the ESX server needs to be entered manually on the DNS servers.

    Third if you are usng VLAN Taging on the network interface used for the service console you need to put in the VLAN ID that correcponds with the ip address used for the Service Console.

    Figure 1.16 Advanced Options

  • 18 Chapter 1 Installing VMware ESX Server 3

    Figure 1.17 Network Confi guration

    NOTEBefore installing VMware ESX Server 3 make sure that you have already determined the IP address information and hostname. IP address and DNS settings are critical for advanced features like High Availability (HA) to function properly.

  • Installing VMware ESX Server 3 Chapter 1 19

    13. At the Time Zone Selection screen you can choose from selecting your timezone form the Map, Location, or UTC Offset. Note you using the location tab is a easy way to scroll down and select your timezone. (See Figure 1.18.)

    Figure 1.18 Time Zone Confi guration

    At the Set Root Password screen you will choose the password for the Root user account. (See Figure 1.19.)

  • 20 Chapter 1 Installing VMware ESX Server 3

    14. At the About to Install screen you can review the installation settings. If the settings look correct you will choose Next to start the installation. (See Figure 1.20.)

    Figure 1.19 Set Root Password

  • Installing VMware ESX Server 3 Chapter 1 21

    15. At the Installing Packages screen you can monitor the status of the installation. (See Figure 1.21.)

    Figure 1.20 About to Install

  • 22 Chapter 1 Installing VMware ESX Server 3

    Figure 1.21 Installing Packages

  • Installing VMware ESX Server 3 Chapter 1 23

    SummaryAs you have most likely found the installation on VMware ESX Server 3 is very straight forward. The most important thing to keep in mind before installing VMware ESX Server 3 is to check the compatibility guides and ensure that you are installing VMware ESX Server 3 on compatible hardware.

    Solutions Fast TrackPre-Installation

    Set the BIOS time before you begin the installation

    Go to www.vmware.com/download to get the latest installation media

    Make sure that you have the Hostname ad IP address before you begin the installation

    Installation Ensure that SAN volumes are assigned and zoned.

    If using VLAN Trunking to the Service console, ensure that the ports are confi gured correctly on the switch and test network connectivity.

    If using VLAN Trunking to the Service console, also make sure to set the appropriate VLAN ID is set on the Network Confi guration screen.

  • 24 Chapter 1 Installing VMware ESX Server 3

    Frequently Asked QuestionsQ: What is the minimum size for a VMFS 3 partition?A: 1200 MB

    Q: How many LUNs are supported during installation?A: 128

    Q: What types of external storage is supported by VMFS 3A: Fibre Channel, iSCSI, and NAS

    Q: Before installing VMware ESX server 3 where should you go to get the latest media?A: www.vmware.com/download

    Q: What should you check before choosing a server to install VMware ESX server 3 on?A: http://www.vmware.com/pdf/vi3_systems_guide.pdf

  • 25

    Chapter 2

    Solutions in this chapter:

    Installing VirtualCenter

    Adding ESX Hosts to VirtualCenter

    Confi guring ESX networking through VirtualCenter

    Confi guring VMFS datastores

    Frequently Asked Questions

    Installing Virtual Center

  • 26 Chapter 2 Installing Virtual Center

    IntroductionVMware VirtualCenter is the management application used to administer and confi gure both ESX servers, and the virtual machines.

    VirtualCenter OverviewVMware VirtualCenter manages the entire ESX server farm. From within the VirtualCenter console you can do the following:

    Server templates are deployed from this console for rapid deployment of virtual machines. Templates are stored server confi gurations that are used to deploy consistent virtual server builds rapidly.

    The console allows administrators to view and adjust resources dynamically.

    It has several different performance views that look at the physical ESX servers as well as virtual server resources.

    It is the interface that is used to move virtual machines between different ESX hosts without powering off the virtual machines. This feature is called VMotion.

    The console allows the administrator to defi ne permissions to the various parts of ESX and VirtualCenter using Active Directory users and groups.

    Figure 2.1

  • Installing Virtual Center Chapter 2 27

    Installing Virtual CenterOnce the database is confi gured, run the VirtualCenter executable from the VirtualCenter installation media.

    1. At the VMware VirtualCenter Installer click VirtualCenter Management Server.

    Figure 2.2

    2. At the VMware VirtualCenter Server 2.0 screen choose Next.

    Figure 2.3

  • 28 Chapter 2 Installing Virtual Center

    3. At the VMware VirtualCenter Server 2.0 License Agreement screen accept the license agreement and click Next.

    Figure 2.4

    4. At the Customer Information screen fi ll in the user information and click Next.

    Figure 2.5

  • Installing Virtual Center Chapter 2 29

    5. At the Destination Folder screen you can leave it as the default, or you can choose an alternate installation directory. When completed click Next.

    Figure 2.6

    6. At the Setup Type screen select Typical, and click Next.

    Figure 2.7

  • 7. At the VMware VirtualCenter Database screen you can choose to either use the built in MSDE database, or use an existing database such as Microsoft SQL, or Oracle. It is advised that you utilize a SQL or Oracle database for production use, but the MSDE database can suffi ce for testing and proof of concept. Once you have chosen the appropriate option click Next. (If you choose to use a MSDE database you can skip forward to step 9).

    8. Prepare a SQL Server database to work with Virtual Center: Open Enterprise Manager on the Microsoft SQL server create a SQL Server database. Right click on Databases, and select New Database.

    Figure 2.8

    Figure 2.9

  • Installing Virtual Center Chapter 2 31

    9. Enter the name for the database, and click OK.

    Figure 2.10

    10. Create a virtualcenter account for the database by opening Security>Logins>New Login

    Figure 2.11

  • 32 Chapter 2 Installing Virtual Center

    11. Enter the Name for the user, choose SQL Server Authentication, and click OK.

    Figure 2.12

    12. Choose the Database Access tab. Click the checkbox for the VirtualCenter database, click the checkbox for db_owner, and click OK.

  • Installing Virtual Center Chapter 2 33

    13. On the VirtualCenter server go Start>Settings>Control Panel>Administrative Tools> Data Sources (ODBC).

    Figure 2.14

    Figure 2.13

  • 34 Chapter 2 Installing Virtual Center

    14. Select the System DSN tab and click Add

    Figure 2.15

    15. Select SQL Server, and click Finish.

    Figure 2.16

  • Installing Virtual Center Chapter 2 35

    16. For the Name enter VirtualCenter, enter a description, choose from the Server dropdown the SQL server that has the VirtualCenter database, and click Next.

    Figure 2.17

    Figure 2.18

  • 36 Chapter 2 Installing Virtual Center

    17. Select SQL Server authentication, check the box for Connect to SQL Server, enter the Login ID and password that was created on the SQL server, and click Next.

    Figure 2.19

    18. Choose VirtualCenter from the default database dropdown, and click Next.

    Figure 2.20

  • Installing Virtual Center Chapter 2 37

    19. Leave the defaults, and click Finish.

    Figure 2.21

    20. Click on the Test Data Sources button.

    Figure 2.22

  • 38 Chapter 2 Installing Virtual Center

    21. The test results should complete successfully, and click OK.

    Figure 2.23

    22. The Database Information screen will appear. Enter the DSN name, Username and password for the ODBC settings.

    Figure 2.24

  • Installing Virtual Center Chapter 2 39

    23. At the License Server screen choose Install a local VMware License Server, and click Next.

    Figure 2.25

    24. At the Licensing Info screen browse to your license fi le (This can be downloaded online from your VMware account). Then click Next.

    Figure 2.26

  • 40 Chapter 2 Installing Virtual Center

    25. At the VMware VirtualCenter Web Service screen you can customize the ports used by the web service. For most installations the default settings are recommended. Click Next to continue.

    Figure 2.27

    26. At the VMware VirtualCenter Web Server screen you can customize the ports used by Apache, and you can also check the boxes seen below if you would like to automatically stat this service. Click Next to continue.

  • Installing Virtual Center Chapter 2 41

    27. At the Installation Complete screen click Finish to complete the installation.

    Figure 2.28

    Figure 2.29

  • 42 Chapter 2 Installing Virtual Center

    28. You can now log into VirtualCenter by opening the VMware Virtual Infrastructure client and logging in with a local or domain admin account.

    Figure 2.30

    VirtualCenter Confi guration1. Go to Start>All Programs>VMware> VMware Virtual Infrastructure Client 2.0

    to open the VMware VirtualCenter management Interface.

    Figure 2.31

  • Installing Virtual Center Chapter 2 43

    2. You should see the default confi guration of VirtualCenter as shown below.

    3. Right Click on Hosts & Clusters, and select New Datacenter.

    Figure 2.32

    Figure 2.33

  • 44 Chapter 2 Installing Virtual Center

    4. Once the Datacenter is created right click on it, and select New Cluster. (The main purpose of crating the cluster is to enable and confi gure the VI3 Enterprise features DRS, and HA.)

    Figure 2.34

    5. At the Cluster Features screen you will need to name the cluster.

  • Installing Virtual Center Chapter 2 45

    6. To enable VMware HA, and VMware DRS, select the corresponding check boxes.

    Figure 2.35

    Figure 2.36

  • 7. At the VMware DRS screen you can choose the appropriate automation level. The picture below shows the different automation levels, and also the descriptions for the levels. For most implementations you can leave it at the default which is Fully automated, and leave the slide bar in the middle. This allows the benefi ts of automated DRS, while at the same time not being overly aggressive with the migrations. Once this is confi gured click Next.

    Figure 2.37

    8. At the Vmware HA screen, you can choose the number of host failures allowed before VMware HA stops failing over virtual servers. You also need to choose the Admission Control settings for the cluster. Admission Control manages what to do with the failed vms if there are insuffi cient remaining resources in the cluster. Click Next to continue.

    46 Chapter 2 Installing Virtual Center

  • 9. At the Ready to Complete screen review the settings and c lick Finish to continue.

    Figure 2.38

    Figure 2.39

  • 48 Chapter 2 Installing Virtual Center

    Adding Hosts to VirtualCenter1. To add a host to the Cluster right click on the cluster and click Add Host.

    Figure 2.40

  • Installing Virtual Center Chapter 2 49

    2. At the Specify Connection Settings screen enter in the ESX sever name (Note: In order for VMware HA to function properly it is important to use the fully qualifi ed domain name and also make sure that its registered with your DNS servers). Also enter in the username and password for the server and click Next.

    Figure 2.41

    3. At the Host Information screen review the confi guration and click Next.

  • 50 Chapter 2 Installing Virtual Center

    4. At the Choose the Destination Resource Pool screen you can choose how you want VMware VirtualCenter to handle any preexisting resources pools on the host, and then Next.

    Figure 2.42

  • Installing Virtual Center Chapter 2 51

    5. At the Ready to Complete screen review the settings and then Finish.

    Figure 2.43

  • 52 Chapter 2 Installing Virtual Center

    6. After clicking Finish you should see the following task appear at the bottom of VirtualCenter.

    Figure 2.44

    Figure 2.45

    7. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

  • Installing Virtual Center Chapter 2 53

    Confi guring ESX Server Networking in VirtualCenter

    1. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.46

    2. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

  • 3. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.47

    Figure 2.48

  • Installing Virtual Center Chapter 2 55

    4. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.49

    5. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

  • 56 Chapter 2 Installing Virtual Center

    6. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.50

  • Installing Virtual Center Chapter 2 57

    7. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.51

  • 58 Chapter 2 Installing Virtual Center

    8. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.52

    Figure 2.53

  • Installing Virtual Center Chapter 2 59

    10. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    9. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.54

  • 60 Chapter 2 Installing Virtual Center

    11. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.55

  • Installing Virtual Center Chapter 2 61

    12. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.56

  • 62 Chapter 2 Installing Virtual Center

    13. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.57

    Figure 2.58

  • Installing Virtual Center Chapter 2 63

    14. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.59

    15. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

  • 64 Chapter 2 Installing Virtual Center

    16. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.60

  • Installing Virtual Center Chapter 2 65

    17. After the task completes you should see the following in VirtualCenter. (Note: Repeat this process for each VMware ESX server that you need to add to VirtualCenter.)

    Figure 2.62

    Figure 2.61

  • 66 Chapter 2 Installing Virtual Center

    Frequently Asked QuestionsQ: Can I Update my ESX servers without any disruption to the virtual servers?A: When using VMware in conjunction with a SAN environment you can put the ESX server

    in Maintenance mode which will migrate the running VMs over to another running ESX host.

  • 67

    Chapter 3

    Solutions in this chapter:

    Creating a Virtual Machine

    Creating a Template

    Deploying VMs from a Template

    Frequently Asked Questions

    Creating Virtual Machines and Gold Images

  • 68 Chapter 3 Creating Virtual Machines and Gold Images

    Creating Virtual Machine Templates1. To create a Template right-click the virtual machine that will be used as a template

    and choose New Template from this Virtual Machine (See Figure 3.1.)

    Figure 3.1 Creating a New Template

    2. Enter the name for the template, give the template a description, and click Next. (See Figure 3.2.)

  • Creating Virtual Machines and Gold Images Chapter 3 69

    3. Choose the second option on a datastore to store the template on a VMFS volume, and click Next. (See Figure 3.3.)

    Figure 3.2 Entering Description

    Figure 3.3 Locating on a Datastore

  • 70 Chapter 3 Creating Virtual Machines and Gold Images

    4. Choose the VMFS volume where the template will be stored, and click Next.(See Figure 3.4.)

    Figure 3.4 Choosing the Volume

    5. Click Finish. (See Figure 3.5.)

    Figure 3.5 Completing the Template Wizard

  • Creating Virtual Machines and Gold Images Chapter 3 71

    Deploying Virtual Machines from templates1. From the VirtualCenter console choose Templates from the toolbar, right click on

    the template that is to be deployed, and choose Deploy Virtual Machine from this template (See Figure 3.6.)

    Figure 3.6 Deploying the Virtual Machine

    2. Click Next. (See Figure 3.7.)

  • 3. Give the virtual machine a name, this will be the name that will show up in VirtualCenter, and click Next. (See Figure 3.8.)

    Figure 3.7 Welcome to the Deployment Wizard

    Figure 3.8 Naming the Virtual Machine

  • 4. Choose what virtual machine group that the server will belong to, and click Next. (See Figure 3.9.)

    Figure 3.9 Assigning the Virtual Machine Group

    5. Choose the physical ESX server that will host the virtual machine. The window shows the current performance statistics on each ESX server to give information on which server has the most available resources. Click Next. (See Figure 3.10.)

    Figure 3.10 Selecting the Physical ESX Server

  • 74 Chapter 3 Creating Virtual Machines and Gold Images

    6. Choose the datastore where the virtual machine virtual disk will be stored, and click Next. (See Figure 3.11.)

    Figure 3.11 Choose the Datastore

    7 Choose what Virtual Switch the virtual machine will use, and click Next.(See Figure 3.12.)

  • Creating Virtual Machines and Gold Images Chapter 3 75

    8. Choose the amount of Memory, and Resource Priority for the virtual machine, and click Next. (See Figure 3.13.)

    Figure 3.12 Selecting the Virtual Switch

    Figure 3.13 Selecting Memory Size

  • 76 Chapter 3 Creating Virtual Machines and Gold Images

    9. Choose Start the guest customization wizard and click Next. (See Figure 3.14.)

    Figure 3.14 Guest Customization

    10. Click Next. (See Figure 3.15.)

    Figure 3.15 Customization Wizard

  • Creating Virtual Machines and Gold Images Chapter 3 77

    11. Enter the Registration information for the Operating System, and click Next.(See Figure 3.16.)

    Figure 3.16 Entering Registration Information

    12. Enter the network name for the virtual machine, and click Next. (See Figure 3.17.)

    Figure 3.17 Naming the Computer

  • 78 Chapter 3 Creating Virtual Machines and Gold Images

    13. Enter the OS license, and the License Mode. Click Next. (See Figure 3.18.)

    Figure 3.18 Entering the License

    14. Enter the password for the Local Administrator account. Click Next. (See Figure 3.19.)

    Figure 3.19 Entering the Password

  • Creating Virtual Machines and Gold Images Chapter 3 79

    15. Enter the time zone for the server. Click Next. (See Figure 3.20.)

    Figure 3.20 Assigning the Time Zone

    16. Choose Custom Settings if the virtual machine will not use DHCP. Click Next. (See Figure 3.21.)

    Figure 3.21 Selecting Custom Settings

  • 80 Chapter 3 Creating Virtual Machines and Gold Images

    17. Enter the network information for the virtual machine. Click Next.(See Figure 3.22.)

    Figure 3.22 Entering Information for the Virtual Machine

    18. window shows the IP information assigned to the Virtual Machine. Click Next. (See Figure 3.23.)

    19. Enter the Workgroup or Domain information. Also give domain admin credentials if the machine is going to be a part of a domain. Click Next. (See Figure 3.24.)

  • Creating Virtual Machines and Gold Images Chapter 3 81

    Figure 3.23 IP Information

    Figure 3.24 Assigning the Workgroup Domain

    20. Click the check box for Generate New Security ID (SID). Click Next.(See Figure 3.25.)

  • 82 Chapter 3 Creating Virtual Machines and Gold Images

    Figure 3.25 Generate SID

    21. Click Finish to complete the wizard. (See Figure 3.26.)

    Figure 3.26 Completing the Wizard

  • Creating Virtual Machines and Gold Images Chapter 3 83

    Frequently Asked QuestionsQ: Can I Update my ESX servers without any disruption to the virtual servers.A: When using VMware in conjunction with a SAN environment you can put the ESX

    server in Maintenance mode which will migrate the running VMs over to another running ESX host.

  • This page intentionally left blank

  • 85

    Chapter 4

    Solutions in this chapter:

    Transform a physical machine into a VMware virtual machine

    Hot vs. cold cloning

    Import Microsoft Virtual PC and Virtual Server VMs

    Summary

    Frequently Asked Questions

    Physical to Virtual Migrations (P2V)

  • 86 Chapter 4 Physical to Virtual Migrations (P2V)

    IntroductionVMware Converter offers a user friendly way to take your physical servers and simply migrate that to your VMware ESX environment. This product was originally known and VMware P2V which stands for Physical to Virtual. Without VMware takes a duplicate image of your physical servers and converts them to a virtual machine which prevents the need to reinstall operating systems and applications to move your applications into the VMware ESX environment. Once moved to the VMware ESX environment the virtual machine the can retain its original server name and active directory sid. The virtual machine is essentially the exact same machine with the only difference being that it now sees VMware virtual hardware rather than its old physical hardware.

    Table 4.1 Supported Operating Systems

    Table 4.2 VMware Converter editions and features

  • Physical to Virtual Migrations (P2V) Chapter 4 87

    Installing VMware Converter1. First you will need to download the VMware converter software, which can be

    found at www.vmware.com/download.

    2. At the Welcome to the Installation Wizard for VMware Converter screen click Next to continue. (See Figure 4.1.)

    Figure 4.1 Welcome Screen

    3. At the End-User License Agreement screen select I accept the terms in the License Agreement option and click Next to continue.

  • 88 Chapter 4 Physical to Virtual Migrations (P2V)

    TIPIt is advisable to reboot a source machine and check the event logs before migrating a physical server to a virtual machine. This will give you a good baseline of the current system state so you can be aware of any potential problems before virtualizing the system.

    4. At the Destination Folder screen confi rm the installation path and click Next to continue. (See Figure 4.2.)

    Figure 4.2 Destination Folder

  • Physical to Virtual Migrations (P2V) Chapter 4 89

    5. At the Ready to Install screen confi rm the settings and click Next to continue. (See Figure 4.3.)

    Figure 4.3 Install Screen

    6. At the Custom Setup screen confi rm the installation options and click Next to continue. (See Figure 4.4.)

  • 7. At the Ready to Install screen confi rm the settings and click Next to continue. (See Figure 4.5.)

    Figure 4.4 Custom Setup

    Figure 4.5 Install Wizard

    8. At the Installing VMware Converter screen you can monitor the installation progress. (See Figure 4.6.)

  • Physical to Virtual Migrations (P2V) Chapter 4 91

    Figure 4.6 Install Status

    9. At the Installation Completed screen you can select Run VMware Converter now and click Finish to complete the installation. (See Figure 4.7.)

    Figure 4.7 Install Complete

  • 92 Chapter 4 Physical to Virtual Migrations (P2V)

    Using VMware Converter1. At the Welcome to VMware Converter screen you can choose which mode

    you plan to use VMware Converter. You can run in Starter Mode for free, or if you have the appropriate license then you can run the product in Enterprise mode. (See Figure 4.8.)

    2. The following screen is displayed when you fi rst run the VMware Converter product. (See Figure 4.9.)

    Figure 4.8 License Information

    TIPMake sure that you know the local administrator user name and password before virtualizing the server. When virtual machines fi rst come up they may not have network access so initially domain accounts may not be able to logon.

  • Figure 4.9 VMware Converter

    3. To begin the conversion process choose Import Machine. (See Figure 4.10.)

    Figure 4.10 Begin the Conversion Process

  • 4. At the Welcome to the VMware Converter Import Wizard select Next to proceed. (See Figure 4.11.)

    5. At the What do you want to Import screen select Next to proceed. (See Figure 4.12.)

    Figure 4.11 Import Wizard

    Figure 4.12 What to Import?

  • Physical to Virtual Migrations (P2V) Chapter 4 95

    NOTEYou should pay special attention when using the Hot Cloning option. Once you start the cloning operation any data that is changed on the source machine will not be replicated to the destination. For this reason it is advised that you make sure to use caution when using this feature to make sure that users are not changing data during the migration.

    6. At the Source Login screen type in the name or IP Address of the source machine to import, and the Authentication information, then select Next to proceed. (See Figure 4.13.)

    Figure 4.13 Source Login

  • 96 Chapter 4 Physical to Virtual Migrations (P2V)

    7. At the Warning: Remote Installation Required screen choose the uninstall options and select Next to proceed. (See Figure 4.14.)

    Figure 4.14 Warning

    8. At the Source Data screen you can change resize the volumes that you are importing (See step 9 for details). (See Figure 4.15.)

    NOTEIt is important to disable or uninstall server hardware agents such and HP Insight manager, Dell OpenMange, or IBM Director once the server has been virtualized. This will prevent the agents from causing issues when it cant see its original hardware.

  • Physical to Virtual Migrations (P2V) Chapter 4 97

    Figure 4.15 Source Data

    9. At the Source Data screen you can select the volumes that you would like to import. Note: at this point you can also choose to change the destination size for the new volumes. This is advantageous when you are importing a volume with a great deal of free space and want to shrink the amount of unused free space on the destination volume. Once you have chosen the appropriate settings select Next to continue. (See Figure 4.16.)

  • 98 Chapter 4 Physical to Virtual Migrations (P2V)

    10. At the Destination screen select Next to continue onto the Destination selection screen. (See Figure 4.17.)

    Figure 4.16 Choose the Source Data Disks

    Figure 4.17 Destination Screen

  • Physical to Virtual Migrations (P2V) Chapter 4 99

    11. At the Destination Type screen you can choose which VMware product that you are using as the destination and then select Next to proceed. (See Figure 4.18.)

    Figure 4.18 Destination Type

    12. At the Destination Login screen enter the authentication information for the target machine and select Next to continue. (See Figure 4.19.)

  • 100 Chapter 4 Physical to Virtual Migrations (P2V)

    Figure 4.19 Destination Login

    13. At the Virtual Machine name and Location screen input you preferred information and select Next to continue. (See Figure 4.20.)

    Figure 4.20 Virtual Machine Name and Location

  • Physical to Virtual Migrations (P2V) Chapter 4 101

    14. At the Networks screen choose the virtual network to attach the virtual machine to and select Next to continue. (See Figure 4.21.)

    Figure 4.21 Networks

    15. At the Customization screen you can choose to change details such as the hostname and network IP Address and select Next to continue. (See Figure 4.22.)

  • 102 Chapter 4 Physical to Virtual Migrations (P2V)

    Figure 4.22 Customization

    16. Once the conversion starts you can monitor the progress of the conversion from the VMware Converter console. (See Figure 4.23.)

  • 17. You will see the status change from In Progress to Competed what the progress reaches 100%. (See Figure 4.24.)

    Figure 4.23 Converter Console

    Figure 4.24 Progress Screen

  • 104 Chapter 4 Physical to Virtual Migrations (P2V)

    18. At the Ready to Complete screen you can review the conversion summary and then select Finish to continue. (See Figure 4.25.)

    Figure 4.25 Ready to Complete

  • Physical to Virtual Migrations (P2V) Chapter 4 105

    SummaryVMware converter is a great tool that can be used to simplify and speed up the process of migrating your physical servers to virtual machines. One thing to keep in mind is that it clones your physical servers and that also include operating system issues that you may have with that server. For some systems you may fi nd it advisable to create a new virtual machine and migrate the applications and fi les over to that new system to get a fresh start.

  • 106 Chapter 4 Physical to Virtual Migrations (P2V)

    Frequently Asked QuestionsQ: What editions are available for VMware Converter?A: VMware converter comes in two versions, Starter Edition, and Enterprise Edition.

    Q: Can I use this product to make a copy of my workstation?A: Yes this product supports Windows 2000 Professional and Windows XP.

    Q: Can I convert a server from one hardware manufacturer to a VMware server running on a different physical server from a different hardware manufacturer?

    A: Yes, for example you can take a server running on Dell hardware and migrate it to a VMware server running on HP hardware.

    Q: Can I convert a server without making any changes to the source machine?A: Yes, VMware Converter enterprise has an option to use a boot disk on the physical

    server to avoid the need to install the VMware converter agent.

    Q: Can I shrink or extend disk sizes when migrating a machine?A: Yes, This is especially benefi cial when you have a source machine with a large amount

    of free space and you want to use space more effi ciently on the destination storage.

  • Part II

    Scripting VMware

  • This page intentionally left blank

  • 109

    Chapter 5

    Scripted Installation

    Solutions in this chapter:

    Setting Up the Scripted Installation

    Reviewing the Kickstart File

    Remote Network Installation

    Summary

  • 110 Chapter 5 Scripted Installation

    IntroductionIf you are setting up your virtual infrastructure or plan on scaling it out and will be building ESX host servers, this chapter is a must for you. The scripted installation method is a fast, effi cient, and sure way to provision ESX hosts, and youll be amazed at how simple it is to set up. Well also review the Kickstart fi le so you fully understand how this install method works, and touch on the remote network install procedure as well.

    Setting Up the Scripted InstallationSetting up the scripted installation correctly will make the process run smoothly and provide you with a very satisfactory experience. As a result, youll likely choose this method over any other for setting up ESX hosts that have similar confi gurations. Youll set up the scripta Kickstart confi guration fi lebased on parameters you would normally select during an ESX server install. If you want the exact confi guration of the ESX server where you are setting up the Kickstart fi le, then make the same choices you made when you built it originally. (You did document that, right?)

    After you have set up the Kickstart fi le, you have two options for building new ESX servers: 1) From the new ESX server, insert the ESX Server installation CD in the local CD-ROM; or 2) install ESX Server across the network from installation fi les hosted on another ESX server. This second option is convenient if your data center or server room is geographically remote or just a pain to get to.

    Additionally, the scripted installation method can run unattended. However, like any unattended install of software, if something goes wrong, youll be prompted to respond, and the install will hang until you do so.

    Creating the ScriptSo to begin, as a prerequisite for the scripted installation method, you need to have an ESX server built and ready to perform the setup for the scripted installation. Some of the unique parameters you will be setting include the following:

    Installation Type Two types are available: 1) Initial Installation (for a new install), and 2) Upgrade (if you are upgrading an existing ESX server such as an ESX Server 2.5 host).

    Root Password

    Time Zone

  • Scripted Installation Chapter 5 111

    IP Address Information It is recommended you statically set your ESX server IP address.

    Disk Partition Information

    Licensing Data This is a new feature in ESX 3.0.

    You can choose DHCP if you want, but it is a good idea to have the IP information at hand, and its recommended that your ESX server have static IP addresses.

    To create the script, log on to the prebuilt ESX Server via a Web browser. You will be presented with the Web page shown in Figure 5.1.

    Figure 5.1 The VMware ESX Server 3.0 Welcome Web Page

    From this page, click the Log In To The Scripted Installer link under the ESX Server Scripted Installer heading. You will then be presented with the Scripted Install Web page, as shown in Figure 5.2.

  • 112 Chapter 5 Scripted Installation

    You must now input the information you want for the Kickstart script. In this example, the Installation Type fi eld is set to Initial Installation, which means that this Kickstart fi le will be for new servers. If you want to have a script for upgrading existing ESX servers, you would change the install type to Upgrade.

    In the Installation Method box, you can select one of the following three methods:

    CD-ROM This method allows you to install ESX Server from the CD-ROM of the new server itself. This method may require physical access to the server itself.

    Remote This method allows you to install ESX Server from a remote server that contains the ESX Installation fi les. If you choose this method, you will also need to include the URL and port number of the remote server.

    NFS This method allows you to use an NFS mount point. In the Remote Server URL, you would input the hostname of the NFS server and the mount point. For example, esx01:loadesx, where esx01 is the server name and loadesx is the mount point.

    In the Network Method section, you can choose DHCP if you want to give your ESX server a dynamic IP address. Alternatively, you can select Static IP if you want to set your ESX server with a static IP.

    Figure 5.2 The Scripted Install Web Page

  • Scripted Installation Chapter 5 113

    In the Time Zone section, choose the time zone you would like your ESX server to be in. In the Reboot After Installation fi eld, select Yes so your ESX server will reboot itself after the installation is complete.

    Make sure you give the Root account a strong password and click Next.If you chose to give your ESX server a static IP address, the next window youll see will

    concern networking options (see Figure 5.3).

    Swiss Army Knife

    Modifying IP InformationAs mentioned earlier in this chapter, its recommended that you give your ESX server a static IP address, although you can use DHCP to provision new ESX servers from the same Kickstart fi le. If you choose this method, its a good idea to go back and statically set the IP information and change the hostname, or to create multiple Kickstart fi les with different hostnames and statically set the IP information.

    Figure 5.3 The Networking Options Page

  • 114 Chapter 5 Scripted Installation

    Next, input all of the IP information needed. Enter the specifi c information for your new ESX server, including the hostname and IP address, the subnet mask in the Netmask fi eld, the gateway, and the nameserver (DNS). Use fully qualifi ed domain names if you are running domains such as esxhost01.domian-name.net. Select which network device you would like the service console to run on and click Next.

    The End User License Agreement (EULA) windows will appear (see Figure 5.4).

    Figure 5.4 EULA

    Of course, read the EULA and check the I Have Read And Accept The Terms In The License Agreement checkbox, then click Next.

    The Partition Confi guration page should appear. Its here that you select how your ESX servers disk will be partitioned. A basic example can be seen in Figure 5.5.

  • Scripted Installation Chapter 5 115

    If you modify this, which surely you will, make sure you give it at least the minimum required space to do so. Also, be aware that some SCSI card manufacturers do not use SDA, employing instead other devices, such as Compaq (HP)s CCISS.

    From the Drive list, choose a drive such as SDA, IDE (use /dev/hda), CCISS, or one of many others. In the next column, choose the mount point, such as root (/), boot (/boot ), vmfs (vmfs3), swap (swap), and so on. Give each mount point a size in the Size column (in megabytes, but do not use MB as a suffi x, such as in 102MB; use only the number 102, as shown in Figure 5.5). Lastly, provide the type in the Type column, which offers four choices: ext3, swap, vmkcore, and vmfs3.

    New to ESX 3.0 is the Licensing Mode. Thus, you must select the appropriate mode for your installation:

    Figure 5.5 The Partition Confi guration Page

  • 116 Chapter 5 Scripted Installation

    Server Based This mode allows you to obtain a license automatically from your license server, which may have been set up on your VirtualCenter server.

    File Based This mode allows you to upload a license fi le.

    Post Install This mode allows you to confi gure your licensing after the install is complete.

    Once you have completed the partitioning information and licensing mode, click Next.In the preceding example, Server Based Licensing was chosen, so the next page that

    appears is that for Server Based Licensing Information, as shown in Figure 5.6. You will add your license server information on this page.

    Figure 5.6 The Server Based Licensing Information Page

    Fill in the License Server information, including its port numberfor example, 8555. In the Additional Options section, you may select vSMP (virtual symmetric multi-processing) and/or Consolidated Backup.

    Additionally, you can select any VirtualCenter options as well. Click Next when you have fi nished.

    If you chose File Based licensing, youll be presented with the page shown in Figure 5.7.

  • Scripted Installation Chapter 5 117

    Figure 5.7 The File Based Licensing Information Page

    Input the license fi le, or click the Browse button to browse and select the license fi le. Once youve done so, click Next.

    Now you can choose Download Floppy Image or Download Kickstart Image. The differences between these two include the following:

    Floppy Image This provides you with a disk image of a VMware ESX Server boot disk which can be used for unattended, scripted installations of ESX Server.

    Kickstart Image This provides the kickstart image that can be used by third-party deployment tools.

    If you selected Download Floppy Image, save the image with an .img fi le extension. If you did not select DHCP in the preceding step because you want to create multiple images for multiple ESX hosts, go back and change the hostname and static IP information and save the fl oppy images with unique names.

    VMware has modifi ed the handling of partition tables so that ESX Server 2.5 automatically clears only the LUNs you specifi cally designate in the Management Interface.

    NOTEIf you are considering booting from your SAN, you should adhere to the following recommendations and work closely with your SAN Administrator:

    Only present the LUN used for the operating system of the ESX Server installation (known as the boot LUN) to the ESX host you are building. Do not present the boot LUN to any other ESX host or server. Do not share boot LUNs between servers.

    During the installation, ensure that you mask off all additional LUNslike for your vmfs partitionsother than the boot LUN during the installation.

  • 118 Chapter 5 Scripted Installation

    Remote Network InstallationUsing a remote network installation to install ESX Server, create a boot fl oppy image to run the installation instead of scripting the installation. During the installation, you are asked to specify the location of the ESX Server CD-ROM.

    To perform a remote network installation with a boot fl oppy, you need to follow three steps. First, use dd, rawwritewin, or rawrite to create a fl oppy image called bootnet.img. This fi le is located on the ESX Server CD-ROM in the /images directory. The second step is to put the boot fl oppy in your ESX host, and then boot the server. When the installation starts, you will be prompted to choose one of the following selections:

    HTTP This is the preferred installation method. Specify the name of the remote machine where the ESX Server CD-ROM is located, the root directory (/), and HTTP port 8555.

    NFS You must have an NFS server set up. Copy the ESX Server CD-ROM to the NFS server and point the new system to the NFS server.

    FTP You must have an FTP server set up. Copy the ESX Server CD-ROM to the FTP server and point the new system to the FTP server.

    The third step is to complete the installation, which is very similar to installing ESX Server normally.

  • Scripted Installation Chapter 5 119

    SummaryThis chapter should have given you a good understanding of how to quickly scale out your virtual infrastructure using scripted installation methods. You should now be able to create an installation script that is customized for either one specifi c ESX host or many.

  • This page intentionally left blank

  • 121

    Chapter 6

    Solutions in this chapter:

    Esxtop

    Vmkfstools

    Vmware-cmd

    Vmkusage

    Summary

    An Introduction to ESX Native Tools and How to Use Them

  • 122 Chapter 6 An Introduction to ESX Native Tools and How to Use Them

    IntroductionThis chapter is going to review the tools that come native to all ESX servers. It is important that, one, you understand these tools exist, and, two, you know how to use them from the command line and how you can incorporate them into scripts. VMware provides some very powerful tools that are built on native Linux functionality and that are expanded for use within the ESX host and the virtual machines residing on them.

    EsxtopEsxtop is a very simple yet powerful tool which can be used for diagnosing performance issues of the ESX host as well as the virtual machines. In Linux, there exists a comparable command-line tool called Top which can be used similarly for Linux OSes to gather performance metrics. VMware has expanded Esxtop to provide metrics specifi c to virtualization. Esxtop provides real-time monitoring of virtual machine processes (also known as worlds). Worlds are simply virtual machine processes run by the VMkernel. VMware has identifi ed three types of worlds, or virtual machine processes, which exist in ESX Server. These are

    Virtual Machine

    System

    Service Console

    But before delving too deep into specifi c processes or the worlds that Esxtop monitors, lets take a quick look at Esxtop when you run it.

    Esxtop OverviewEsxtop comes installed natively when you install ESX Server, so there is nothing you need to load. To run Esxtop, you need to access the service console of your ESX host. Once at the service console, type [root@esx01 root]# esxtop.

    The output displayed will be similar to that shown in Figure 6.1.

  • An Introduction to ESX Native Tools and How to Use Them Chapter 6 123

    Quickly going through the output, note on the top line the time, which in this example is 9:37 a.m. This server has been up 15 days, 4 hours, and 31 minutes and is running 20 worlds. These worlds are not all virtual machines (we will explain each of the different worlds further in the chapter). The load average shows the load the ESX hosts CPUs are under. A load average of 1.0 means that the CPU is being fully utilized; thus, an average of 0.5 would mean that the CPU is only being utilized at approximately 50 percent. You can see from the example in Figure 6.1 that the CPUs are hardly being touched on this ESX host, the highest running at 5-percent utilization. However, if you run Esxtop and fi nd that your CPUs are running consis