Top Banner
481

Virtualization With Microsoft Virtual Server 2005 (2006)

Mar 21, 2016

Download

Documents

Marcos Toledo

To register your book, visit www.syngress.com/solutions. Once registered, you can access our [email protected] Web pages. There you will find an assortment of value-added features such as free e-booklets related to the topic of this book, URLs of related Web sites, FAQs from the book, corrections, and any updates from the author(s). DOWNLOADABLE E-BOOKS CUSTOM PUBLISHING SYNGRESS OUTLET SOLUTIONS WEB SITE ULTIMATE CDs SITE LICENSING
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Virtualization With Microsoft Virtual Server 2005 (2006)
Page 2: Virtualization With Microsoft Virtual Server 2005 (2006)

www.syn g r e s s . c o m

Syngress is committed to publishing high-quality books for IT Professionals anddelivering those books in media and formats that fit the demands of our cus-tomers. We are also committed to extending the utility of the book you purchasevia additional materials available from our Web site.

SOLUTIONS WEB SITETo register your book, visit www.syngress.com/solutions. Once registered, you canaccess our [email protected] Web pages. There you will find an assortmentof value-added features such as free e-booklets related to the topic of this book,URLs of related Web sites, FAQs from the book, corrections, and any updates fromthe author(s).

ULTIMATE CDsOur Ultimate CD product line offers our readers budget-conscious compilations ofsome of our best-selling backlist titles in Adobe PDF form. These CDs are the perfectway to extend your reference library on key topics pertaining to your area of exper-tise, including Cisco Engineering, Microsoft Windows System Administration,CyberCrime Investigation, Open Source Security, and Firewall Configuration, toname a few.

DOWNLOADABLE E-BOOKSFor readers who can’t wait for hard copy, we offer most of our titles in download-able Adobe PDF form. These e-books are often available weeks before hard copiesand are priced affordably.

SYNGRESS OUTLETOur outlet store at syngress.com features overstocked, out-of-print, or slightly hurtbooks at significant savings.

SITE LICENSINGSyngress has a well-established program for site licensing our e-books onto serversin corporations, educational institutions, and large organizations. Contact us [email protected] for more information.

CUSTOM PUBLISHINGMany organizations welcome the ability to combine parts of multiple Syngressbooks, as well as their own content, into a single volume for their own internal use.Contact us at [email protected] for more information.

Visit us at

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page i

Page 3: Virtualization With Microsoft Virtual Server 2005 (2006)

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page ii

Page 4: Virtualization With Microsoft Virtual Server 2005 (2006)

Virtualization with

Rogier Dittner Technical Editor

David Rule Jr.Ken MajorsMatthijs ten SeldamTwan GrotenhuisGeoffrey Green

Microsoft®

VirtualServer 2005

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page iii

Page 5: Virtualization With Microsoft Virtual Server 2005 (2006)

Syngress Publishing, Inc., the author(s), and any person or firm involved in the writing, editing, or produc-tion (collectively “Makers”) of this book (“the Work”) do not guarantee or warrant the results to beobtained from the Work.

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

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

You should always use reasonable care, including backup and other appropriate precautions, when workingwith computers, networks, data, and files.

Syngress Media®, Syngress®,“Career Advancement Through Skill Enhancement®,”“Ask the AuthorUPDATE®,” and “Hack Proofing®,” are registered trademarks of Syngress Publishing, Inc.“Syngress:TheDefinition of a Serious Security Library”™,“Mission Critical™,” and “The Only Way to Stop a Hacker isto Think Like One™” are trademarks of Syngress Publishing, Inc. Brands and product names mentionedin this book are trademarks or service marks of their respective companies.

KEY SERIAL NUMBER001 HJIRTCV764002 PO9873D5FG003 829KM8NJH2004 AMY FILL IN005 CVPLQ6WQ23006 VBP965T5T5007 HJJJ863WD3E008 2987GVTWMK009 629MP5SDJT010 IMWQ295T6T

PUBLISHED BYSyngress Publishing, Inc.800 Hingham StreetRockland, MA 02370

Virtualization with Microsoft® Virtual Server 2005Copyright © 2006 by Syngress Publishing, Inc.All rights reserved. Printed in Canada. Except as permittedunder the Copyright Act of 1976, no part of this publication may be reproduced or distributed in anyform or by any means, or stored in a database or retrieval system, without the prior written permission ofthe publisher, with the exception that the program listings may be entered, stored, and executed in a com-puter system, but they may not be reproduced for publication.

Printed in Canada1 2 3 4 5 6 7 8 9 0ISBN: 1-59749-106-3

Publisher:Andrew Williams Page Layout and Art: Patricia LupienAcquisitions Editor: Gary Byrne Copy Editor: Michelle MelaniTechnical Editor: Rogier Dittner Indexer: Richard CarlsonCover Designer: Michael Kavish

Distributed by O’Reilly Media, Inc. in the United States and Canada.For information on rights, translations, and bulk sales, contact Matt Pedersen, Director of Sales and Rights,at Syngress Publishing; email [email protected] or fax to 781-681-3585.

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page iv

Page 6: Virtualization With Microsoft Virtual Server 2005 (2006)

Acknowledgments

v

Syngress would like to acknowledge the following people for their kindnessand support in making this book possible.

Syngress books are now distributed in the United States and Canada byO’Reilly Media, Inc.The enthusiasm and work ethic at O’Reilly are incredible,and we would like to thank everyone there for their time and efforts to bringSyngress books to market:Tim O’Reilly, Laura Baldwin, Mark Brokering, MikeLeonard, Donna Selenko, Bonnie Sheehan, Cindy Davis, Grant Kikkert, OpolMatsutaro, Steve Hazelwood, Mark Wilson, Rick Brown,Tim Hinton, KyleHart, Sara Winge, Peter Pardo, Leslie Crandell, Regina Aggio Wilkinson, PascalHonscher, Preston Paull, Susan Thompson, Bruce Stewart, Laura Schmier, SueWilling, Mark Jacobsen, Betsy Waliszewski, Kathryn Barrett, John Chodacki,Rob Bullington, Kerry Beck, Karen Montgomery, and Patrick Dirden.

The incredibly hardworking team at Elsevier Science, including JonathanBunkell, Ian Seager, Duncan Enright, David Burton, Rosanna Ramacciotti,Robert Fairbrother, Miguel Sanchez, Klaus Beran, Emma Wyatt, KristaLeppiko, Marcel Koppes, Judy Chappell, Radek Janousek, Rosie Moss, DavidLockley, Nicola Haden, Bill Kennedy, Martina Morris, Kai Wuerfl-Davidek,Christiane Leipersberger,Yvonne Grueneklee, Nadia Balavoine, and ChrisReinders for making certain that our vision remains worldwide in scope.

David Buckland, Marie Chieng, Lucy Chong, Leslie Lim,Audrey Gan, Pang AiHua, Joseph Chan, June Lim, and Siti Zuraidah Ahmad of Pansing Distributorsfor the enthusiasm with which they receive our books.

David Scott, Tricia Wilden, Marilla Burgess, Annette Scott, Andrew Swaffer,Stephen O’Donoghue, Bec Lowe, Mark Langley, and Anyo Geddes of Woodslanefor distributing our books throughout Australia, New Zealand, Papua NewGuinea, Fiji,Tonga, Solomon Islands, and the Cook Islands.

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page v

Page 7: Virtualization With Microsoft Virtual Server 2005 (2006)

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page vi

Page 8: Virtualization With Microsoft Virtual Server 2005 (2006)

vii

Technical Editor and Lead Author

Rogier Dittner (MCSE NT4, 2000, 2003, MCDBA, MCT, MSFPractitioner) is a consultant at a Microsoft partner offering solutionsbased on Microsoft technology to customers.As a consultant hesupports the sales organization and takes part in planning anddesigning complex Microsoft-oriented implementations.

Because of his personal interest in Microsoft products and morethan 10 years’ experience, he has deep technical working knowledgein a broad range of Microsoft products. Within his company he per-forms the leading role in operations management solutions andtraining.

He would like to thank his wife and children for giving him thetime and space to write (Pascalle, bedankt, je bent een schat!).

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page vii

Page 9: Virtualization With Microsoft Virtual Server 2005 (2006)

viii

Geoffrey Green (Citrix CCA, CCNA, HP ASE, MCSE, RSACSE, VMware VCP) is a senior systems consultant with MTMTechnologies, where he provides MTM clients in the Ohio Valleyregion with advanced infrastructure assessment, design, and imple-mentation solutions.As an information technology generalist, Geoffhas developed a broad range of field experience in many areas,including Citrix Access Infrastructure; Cisco routing, switching, andfirewalls; Virtual Infrastructure from both VMware and Microsoft;HP ProLiant server and storage technology; RSA SecurID tech-nology; and the whole range of Microsoft server technologies. Hehas provided integrated infrastructure solutions to clients for over 11years.

Geoff currently lives in Cincinnati, OH, with his wife, Colleen,and his two dogs,Trinity and Spock.

Geoff wrote Chapter 9.

Twan Grotenhuis (MCT, MCSE NT4, 2000 and 2003,MCSE+messaging 2000 and 2003, CCNA) is a consultant withSylis Netherlands. He currently provides strategic and technical con-sulting to several of the Sylis customers in the Netherlands. His spe-cialties include Microsoft Exchange and ISA architecture, design,implementation, troubleshooting and optimization.Twan has beeninvolved in several Virtual Server 2005 projects where virtualizationof physical servers was his main focus.

Twan wrote Chapter 8.

Contributing Authors

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page viii

Page 10: Virtualization With Microsoft Virtual Server 2005 (2006)

ix

Andy Jones (MCSE+I, MCT, CCIA, CCEA, CCI, CCNA,CCDA, MCIW, Network+,A+) is the Services Director for MTMTechnologies, previously known as Vector ESP. He provides compre-hensive solutions focused on Citrix and Microsoft technologies forclients ranging from 50 to 50,000 users, focusing mainly on archi-tecting and deploying Access Infrastructure solutions for enterprisecustomers. One of Andy’s primary focuses is in developing bestpractices, processes, and methodologies surrounding AccessInfrastructure that take into consideration and integrate with virtu-ally every part of a customer’s infrastructure.

In addition to field work and business development,Andy regu-larly instructs Microsoft and Citrix courses.Andy holds a master’sdegree from Morehead State University.

Andy cowrote Chapter 6.

I would like to thank my family,Amy, Julia, and Jocelyn, without yourpatience and support my contribution would not have been possible. I wouldalso like to thank my fellow consultants who have helped in ways thatcannot be expressed. Finally, I would like to thank the editors for this projectfor their assistance in helping me “refine” my work. I would like to dedicatemy contribution to this work to my brother Jeremy and my mother. I loveyou both and miss you dearly.

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page ix

Page 11: Virtualization With Microsoft Virtual Server 2005 (2006)

x

Kenneth Majors (MCSE, MCSA, Project+, VMware VCP, CitrixCCEA, CCA, IBM X-Series Expert,Avaya ACA) is a consultant forChoice Solutions LLC, a systems integrator headquartered inOverland Park, KS. Choice Solutions provides IT design, projectmanagement, and support for enterprise computing systems.Kenneth is a key contributor to defining best practices for deploy-ment and implementation of Microsoft technologies, includingWindows Server, Virtual Server, and SharePoint; Citrix PresentationServer; VMware ESX; and development of documentation standards.He develops technology solutions and methodologies focused onimproving client business processes.These technology solutionstouch every part of a system’s life cycle from assessment, blueprint,construction, and deployment on projects to operational manage-ment and strategic planning for the business process.

Kenneth holds a bachelor’s degree from Colorado TechnicalUniversity. He currently resides in Olathe, KS, with his lovely, sup-portive wife, Sandy, and near their children,Tabitha and Keith, andtheir grandsons, Wesley and Austin.

Kenneth wrote Chapters 3 and 4.

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page x

Page 12: Virtualization With Microsoft Virtual Server 2005 (2006)

xi

David Rule Jr. (VMware VCP, VAC, MCP, Citrix CCEA, CCA) isa Senior Consultant for Choice Solutions LLC, an Overland Park,KS-based systems integrator that provides IT design, project man-agement, and support for enterprise computing systems. David’s pri-mary role is in developing virtualization strategies for ChoiceSolutions’ clients.The strategies include the virtualization of bothservers and storage, including the development of best practice andstandards documentation.The combination of virtual servers andstorage provides systems with enterprise-class stability, performance,and scalability.These technologies are implemented to provideclients with environments that facilitate management of and increasethe performance of day-to-day operations while also making themmore reliable and cost-effective.

David is currently working toward completing a degree fromPark University in Computer Information Systems Management.He resides in Shawnee, KS, with his wife, Kristine, and their twowonderful children, Christian and Collin.

David wrote Chapters 1 and 2.

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page xi

Page 13: Virtualization With Microsoft Virtual Server 2005 (2006)

xii

Matthijs ten Seldam (MCSE, CISSP) is a principal consultantwith the infrastructure technologies group at Microsoft ConsultingServices. His expertise focuses on virtualization, platform manage-ment and deployment, security, and networking. One of his special-ties is automation of management tasks through various interfaceslike WMI and COM using languages like VBScript and C#.

He has developed technical training material on Virtual Server2005 R2 and delivers this to customers and partners. He currentlyprovides consulting to enterprise customers, delivers technical work-shops, and runs early adoption programs of the next generation ofvirtualization products like Virtual Server 2005 R2 Service Pack 1and System Center Virtual Machine Manager.

Matthijs wrote Chapters 5 and 7. He also contributed the scripts forAppendix C.

Some of the code presented throughout this book is available for downloadfrom www.syngress.com/solutions. Look for the Syngress icon in the marginsindicating which examples are available from the companion Web site.

Companion Web Site

406_VIRTUAL_FM.qxd 9/11/06 12:11 PM Page xii

Page 14: Virtualization With Microsoft Virtual Server 2005 (2006)

Chapter 1 Introduction to Microsoft Virtual Server . . . . . . . . . . . . . . . . . . . 1

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2Microsoft Virtual Server 2005 R2 and DynamicsSystem Initiative . . . . . . . . . . . . . . . . . . . . . . . . . . .2What Is Virtualization,and When Should You Use It? . . . . . . . . . . . . . . . . .3

Advantages of Virtualization . . . . . . . . . . . . . . . .3Production Data Centers . . . . . . . . . . . . . . . .4Test and Development Data Centers . . . . . . . .5Disaster Recovery . . . . . . . . . . . . . . . . . . . . .6

What Virtualization Tools Are Available? . . . . . . . . . .7Third-Party Virtualization Tools . . . . . . . . . . . . .7

How Does Virtualization Work? . . . . . . . . . . . . . . .9Virtual PC versus Virtual Server 2005 . . . . . . . . . .10

Features That Are Found in Both Virtual PC and Virtual Server 2005 R2 . . . . . . .10Differences between Virtual PC and Virtual Server 2005 R2 . . . . . . . . . . . .11

Supported Features in Virtual PC . . . . . . . . .11Supported Features in Virtual Server 2005 R2 . . . . . . . . . . . . . . . .12

Scenarios for the Use of Virtual PC . . . . . . . . .13Help Desk . . . . . . . . . . . . . . . . . . . . . . . . . .13Training . . . . . . . . . . . . . . . . . . . . . . . . . . . .13Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14Legacy Applications . . . . . . . . . . . . . . . . . . .14

Virtual Server 2005 versus Virtual Server 2005 R2 14Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15Solutions Fast Track . . . . . . . . . . . . . . . . . . . . . . . .15Frequently Asked Questions . . . . . . . . . . . . . . . . . .17

xiii

Contents

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xiii

Page 15: Virtualization With Microsoft Virtual Server 2005 (2006)

xiv Contents

Chapter 2 Installing and Configuring a Virtual Server. . . . . . . . . . . . . . . 19

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20Determining the Physical Size of the Server . . . . . .20

Physical Server Sizing . . . . . . . . . . . . . . . . . . . .20Evaluating Existing Physical Servers . . . . . . .21Planning for New Virtual Servers . . . . . . . . .21

Installing Virtual Server 2005 R2 . . . . . . . . . . . . . .22Preinstallation Tasks . . . . . . . . . . . . . . . . . . . . .22Installation Tasks . . . . . . . . . . . . . . . . . . . . . . . .23

Setting Up a Virtual Server Administration Web Site . . . . . . . . . . . . . . . . . . . .28

Virtual Server Administration Web Site Installation . . . . . . . . . . . . . . . . . . . . .29

Installing in a Multiserver Environment . . . . .29Virtual Machine Remote Console . . . . . . . . . . . . .35

Setting Access Permissions for the Virtual Machine Remote Console . . . . . . . .35

Setting Default Location and Search Paths . . . . . . .37Setting Resource Allocation . . . . . . . . . . . . . . . . . .39Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42Solutions Fast Track . . . . . . . . . . . . . . . . . . . . . . . .42Frequently Asked Questions . . . . . . . . . . . . . . . . . .44

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xiv

Page 16: Virtualization With Microsoft Virtual Server 2005 (2006)

Contents xv

Chapter 3 Virtual Machines . . . . . . . . . . . . . . . 45Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46Creating the Virtual Server . . . . . . . . . . . . . . . . . .47

Using the Administration Web Page . . . . . . . . .49Virtual Machine Configuration . . . . . . . . . . .53

Adding Hardware to the Server . . . . . . . . . . . . . . .75Building the Host Server . . . . . . . . . . . . . . . . .75

Processors . . . . . . . . . . . . . . . . . . . . . . . . . .75Memory . . . . . . . . . . . . . . . . . . . . . . . . . . .76Storage Systems . . . . . . . . . . . . . . . . . . . . . .76Network Cards . . . . . . . . . . . . . . . . . . . . . . .77COM an LPT Ports . . . . . . . . . . . . . . . . . . .77USB Ports . . . . . . . . . . . . . . . . . . . . . . . . . .77

Installing a Windows OS . . . . . . . . . . . . . . . . . . . .78Loading the Operating System . . . . . . . . . . . . .79

Booting from the Virtual Floppy Disk Drive 81Starting the Virtual Machine . . . . . . . . . . . . .83Installing the Operating System . . . . . . . . . . .87

Installing Virtual Machine Additions . . . . . . . . . . .89Removing Virtual Machine Additions . . . . . . . .91

Installing a Non-Windows OS . . . . . . . . . . . . . . . .92Creating the Virtual Machine . . . . . . . . . . . . . .93Virtual Machine Additions for Linux . . . . . . . . .96

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105Solutions Fast Track . . . . . . . . . . . . . . . . . . . . . . .106Frequently Asked Questions . . . . . . . . . . . . . . . . .109

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xv

Page 17: Virtualization With Microsoft Virtual Server 2005 (2006)

xvi Contents

Chapter 4 Virtual Networks . . . . . . . . . . . . . . 111Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .112Introduction to Virtual Networks . . . . . . . . . . . . .112

Virtual Networks . . . . . . . . . . . . . . . . . . . . . .113Viewing the Virtual Networks . . . . . . . . . .114

Using the “Internal Network” . . . . . . . . . . . . . . .122Using the Loopback Adapter . . . . . . . . . . . . . .124

Installing the Loopback Adapter . . . . . . . . .124Configuring Host-to-Guest Networking and File Sharing . . . . . . . . . . .128Using the ICS . . . . . . . . . . . . . . . . . . . . . .133

Creating a Virtual Network . . . . . . . . . . . . . . . . .139Binding a Physical Network Adapter to a Virtual Network . . . . . . . . . . . . . . .141

Changing the Binding of a Virtual Network . .142Changing the Virtual Network for a Virtual Machine . . . . . . . . . . . .145

Using the Virtual Server Network Services . . . . . .147Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .152Solutions Fast Track . . . . . . . . . . . . . . . . . . . . . . .153Frequently Asked Questions . . . . . . . . . . . . . . . . .155

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xvi

Page 18: Virtualization With Microsoft Virtual Server 2005 (2006)

Contents xvii

Chapter 5 Virtual Disks. . . . . . . . . . . . . . . . . . 157Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .158Removable Virtual Disks . . . . . . . . . . . . . . . . . . .158

CD/DVD Drive . . . . . . . . . . . . . . . . . . . . . . .159Floppy Disk Drive . . . . . . . . . . . . . . . . . . . . .161

Virtual Hard Disks . . . . . . . . . . . . . . . . . . . . . . .166Dynamically Expanding Virtual Hard Disk . . .168

Compacting . . . . . . . . . . . . . . . . . . . . . . . .170Converting . . . . . . . . . . . . . . . . . . . . . . . . .177

Fixed-Size Virtual Hard Disk . . . . . . . . . . . . .178Converting . . . . . . . . . . . . . . . . . . . . . . . . .179

Differencing Virtual Hard Disk . . . . . . . . . . . .180Chaining . . . . . . . . . . . . . . . . . . . . . . . . . .186Merging . . . . . . . . . . . . . . . . . . . . . . . . . . .187

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192Solutions Fast Track . . . . . . . . . . . . . . . . . . . . . . .192Frequently Asked Questions . . . . . . . . . . . . . . . . .194

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xvii

Page 19: Virtualization With Microsoft Virtual Server 2005 (2006)

xviii Contents

Chapter 6 Introduction to ADS and Virtual Server Migration Tool . . . . . . . . . 197

Automated Deployment Services . . . . . . . . . . . . .198Rapid Deployment Using ADS . . . . . . . . . .198

What Components Does ADS Use? . . . . . . . . . . .200ADS Controller Service . . . . . . . . . . . . . . .200ADS Network Boot Service . . . . . . . . . . . .200ADS Image Distribution Service . . . . . . . . .201

ADS Host Server Requirements . . . . . . . . . . .202ADS Client-Server Requirements . . . . . . . . . .202ADS Network and Management Requirements . . . . . . . . . . . . . .203

Installing ADS . . . . . . . . . . . . . . . . . . . . . . . . . . .204Installation Options . . . . . . . . . . . . . . . . . . . .204Installation Process . . . . . . . . . . . . . . . . . . . . .205

Post-Installation: Configuring ADS . . . . . . . . . . . .214Automatically Accepting New Clients . . . . . . .214Enabling Multicast . . . . . . . . . . . . . . . . . . . . .218

Administration Agent Installing . . . . . . . . . . . . . .219Adding Hardware Drivers in the Boot OS . . . . . .223Editing Using the Sequence Editor . . . . . . . . . . .223Installing Virtual Server Migration Toolkit onto the Virtualization Server . .227Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .231Solutions Fast Track . . . . . . . . . . . . . . . . . . . . . . .231Frequently Asked Questions . . . . . . . . . . . . . . . . .233

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xviii

Page 20: Virtualization With Microsoft Virtual Server 2005 (2006)

Contents xix

Chapter 7 Managing Virtual Server . . . . . . . . 235Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .236The Management Interface . . . . . . . . . . . . . . . . .236

Configuring a Central Virtual Server Management Site . . . . . . . . . . .237

Using the Virtual Server COM API . . . . . . . . . . .247Using the Virtual Server Programmer’s Guide 248Connecting to the Virtual Server COM Object . . . . . . . . . . . . . .254

Accessing a Virtual Server Using Script . . . . . . . .256Listing Virtual Server Properties . . . . . . . . . . .256Setting Virtual Server Properties . . . . . . . . . . .259

Creating a Virtual Machine Using Script . . . . . . .261Creating a Virtual Hard Disk . . . . . . . . . . . . . .263Putting It All Together . . . . . . . . . . . . . . . . . .264

Creating a Virtual Network Using Script . . . . . . .267Retrieving Guest OS Information Using Script . .268Changing a Virtual Machine State Using Script . .271

The Virtual Machine State Model . . . . . . . . . .272Attaching Scripts to Virtual Server Events . . . . . .275

Attaching Scripts to Virtual Machine Events . .277Scripts in Action . . . . . . . . . . . . . . . . . . . . . . .278

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .283Solutions Fast Track . . . . . . . . . . . . . . . . . . . . . . .283Frequently Asked Questions . . . . . . . . . . . . . . . . .285

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xix

Page 21: Virtualization With Microsoft Virtual Server 2005 (2006)

xx Contents

Chapter 8 Migrating Physical Machines. . . . . 287Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .288Getting the Virtualization Environment Ready for Usage . . . . . . . . . . . . . . .288

Setting Up the Virtualization Tools . . . . . . . . .288Installing VSMT and ADS Agent on the Virtual Server Host . . . . . . . . . .289Creating the Virtual Network . . . . . . . . . . . . .292

Capturing the Physical Machine . . . . . . . . . . . . . .293Hardware Inventory . . . . . . . . . . . . . . . . . . . .297Creating the Scripts . . . . . . . . . . . . . . . . . . . .299

Validating Hardware . . . . . . . . . . . . . . . . . .299Creating Migration Scripts . . . . . . . . . . . . .301

Data Capture . . . . . . . . . . . . . . . . . . . . . . . . .305Creating the Virtual Machine on the Virtual Server Host . . . . . . . . . . .310Deploying the Virtual Machine on the Host OS . .313Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .316Solutions Fast Track . . . . . . . . . . . . . . . . . . . . . . .316Frequently Asked Questions . . . . . . . . . . . . . . . . .318

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xx

Page 22: Virtualization With Microsoft Virtual Server 2005 (2006)

Contents xxi

Chapter 9 Troubleshooting. . . . . . . . . . . . . . . 319Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .320Troubleshooting Virtual Server 2005 R2 . . . . . . .320

Troubleshooting Virtual Server Administration Web Site . . . . . . . . . . . .320

Troubleshooting LsaLogonUser() failed! . . . .320Troubleshooting Internal Server Error 500 . .327Troubleshooting Access Denied Errors . . . . .329Troubleshooting VMRC Server Disabled Errors . . . . . . . . . . . . . . . .329

Troubleshooting Virtual Server Settings . . . . . .331Troubleshooting Disappearing Server Settings . . . . . . . . . . . .331Troubleshooting Virtual Network Changes 332

Troubleshooting Virtual Machine Performance Issues . . . . . . . . . . . . . .336

Disabling TCP Segmentation Offload . . . . .336Don’t Use Network Adapter Auto-Configuration . . . . . . . . . . . .337Use ISOs instead of CDs Whenever Possible . . . . . . . . . . . . . . .337Don’t Overallocate Memory . . . . . . . . . . . .337Use a Separate Disk Controller for Guest Machines . . . . . . . . . .338

Troubleshooting Automated Deployment Services 338Troubleshooting PXE . . . . . . . . . . . . . . . . . . .338

Check the DHCP Configuration . . . . . . . .339DHCP Relay Agent . . . . . . . . . . . . . . . . . .339Check for Other PXE Servers . . . . . . . . . . .341Check Your Network Drivers . . . . . . . . . . .341Check Your Storage Drivers . . . . . . . . . . . .342Check Your BIOS Clock . . . . . . . . . . . . . .342

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xxi

Page 23: Virtualization With Microsoft Virtual Server 2005 (2006)

xxii Contents

Troubleshooting the ADS Services . . . . . . . . . .342Check That the ADS Services Are Running 342Confirm the ADS Controller’s IP Address . .343Check the ADS Certificates . . . . . . . . . . . .343

Troubleshooting the Virtual Server Migration Tool 343Troubleshooting the Virtual Network Setup . .344Troubleshooting Script Creation . . . . . . . . . . .344Troubleshooting ADS Integration . . . . . . . . . .345Troubleshooting Migration from VMware to Virtual Server . . . . . . . . . . . .345

Troubleshooting the Migration Process . . . . . . . . .345Imaging Problems . . . . . . . . . . . . . . . . . . . . . .346IDE Disks Cannot Exceed 127 GB . . . . . . . . .347Converted SCSI Disks Fail to Boot . . . . . . . . .347

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351Solutions Fast Track . . . . . . . . . . . . . . . . . . . . . . .351Frequently Asked Questions . . . . . . . . . . . . . . . . .353

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xxii

Page 24: Virtualization With Microsoft Virtual Server 2005 (2006)

Contents xxiii

Appendix A The Pros and Cons of Running Virtual Server . . . . . . . . . . . . . . . . 355

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .356Why Is Virtual Server Beneficial? . . . . . . . . . .356Performance Issues . . . . . . . . . . . . . . . . . . . . .357Licensing Issues . . . . . . . . . . . . . . . . . . . . . . .358Security Issues . . . . . . . . . . . . . . . . . . . . . . . .359

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . .359About Brien M. Posey . . . . . . . . . . . . . . . . . . . .360Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360

Appendix B Solutions Fast Track. . . . . . . . . . . 361Chapter 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .362Chapter 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .364Chapter 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .366Chapter 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .369Chapter 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .371Chapter 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .372Chapter 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .374Chapter 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .376Chapter 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .378

Appendix C Windows Script Files for Virtual Server 2005 R2 . . . . . . . . . . . 381

Code Listings for Virtual Server 2005 R2 . . . . . . .382

Appendix D Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents . . . . . . . . . . . . . . . . . . . . . . . . . 401

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xxiii

Page 25: Virtualization With Microsoft Virtual Server 2005 (2006)

406_VIRTUAL_TOC.qxd 9/11/06 2:45 PM Page xxiv

Page 26: Virtualization With Microsoft Virtual Server 2005 (2006)

Introduction to Microsoft Virtual Server

Solutions in this chapter:

■ Microsoft Virtual Server 2005 R2 andDynamics System Initiative

■ What Is Virtualization, and When ShouldYou Use It?

■ What Virtualization Tools Are Available?

■ How Does Virtualization Work?

■ Virtual PC versus Virtual Server 2005

■ Virtual Server 2005 versus Virtual Server2005 R2

Chapter 1

1

� Summary

� Solutions Fast Track

� Frequently Asked Questions

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 1

Page 27: Virtualization With Microsoft Virtual Server 2005 (2006)

IntroductionIn recent years the power of servers has grown immensely. In production, theservers perform well but the system is only partially utilized.This makes itfairly impossible to buy a server that is not overpowered.

On the other side, there is the issue with hardware support on that oldWindows server that you cannot migrate.These scenarios and a lot more arewhere virtualization can be a lot of help.There are several virtualization toolsavailable on the market, all of them with specific support and features. We willreview the most important ones, but our focus will be on the Microsoft vir-tualization tool Virtual Server 2005 R2.

Microsoft Virtual Server 2005 R2 and Dynamics System InitiativeThe Microsoft Dynamics System Initiative (DSI) was created as a commit-ment between Microsoft and its partners to create more easily manageablesystems that automate many everyday tasks.This will, in effect, streamline IToperations and potentially reduce costs at the same time. Virtual servers play abig part in this initiative by optimizing the way current data centers are runand making them more efficient. Workloads can be optimized by runningmultiple operating systems and applications on a physical server, whichenables it to reach a much higher average utilization.Also, as workloadschange over time, virtual machines can be redistributed between other virtualservers to continue to optimize and balance workloads.

DSI applies to all aspects of the application lifecycle. It begins with thedesign of the application and ends with using applications like SMS andMicrosoft Operations Manager (MOM) to manage and monitor the systems.The use of virtualization is key in this design, because it effectively decouplesthe application workload from its hardware.This enables you to move theworkload from one physical server to another as the resource needs of theworkload change. Virtualization allows for the rapid deployment of new sys-tems. Without virtualization, as the need develops for new servers, you maynot be able to respond quickly enough because you’ll need to purchase newhardware for each server needed.

2 Chapter 1 • Introduction to Microsoft Virtual Server

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 2

Page 28: Virtualization With Microsoft Virtual Server 2005 (2006)

What Is Virtualization, and When Should You Use It?Virtualization is the concept of taking a single operating system and, insteadof installing in on its own dedicated physical hardware, installing it on virtualhardware that is being presented by Microsoft Virtual Server 2005 R2 run-ning on a physical server (see Figure 1.1).The key with virtualization is theisolation of each virtual machine. Each virtual machine is unaware of theother virtual machines that are running on the virtual server. If one virtualmachine crashes, it will not crash the other virtual servers. With new pro-cessor improvements from Intel and AMD, namely the new dual-core proces-sors, you can consolidate more servers onto a single physical server. Withdual-core technology you are able to have a dual-processor server with a totalof four processor cores.The jump that both AMD and Intel made from 32-bitto 64-bit processors has significantly improved the performance of the phys-ical server running Microsoft Virtual server 2005 R2. Consolidation ratios arenot going to be the same on every server.They depend on the workloads ofthe virtual machines that are running on the physical server.

A virtual server presents a common set of hardware to every virtualmachine. It presents all the key components, such as common NIC, videocard, motherboard, SCSI card, hard drives, CD-ROM, etc.The key is that itpresents the same common hardware regardless what physical server the vir-tual servers are running on.This enables you to easily move workloads fromone physical server running Microsoft Virtual Server 2005 over to anotherVirtual Server.The particular devices that are presented to the virtual machineare detailed later in this chapter.

Advantages of VirtualizationThere are several scenarios where virtualization has tremendous advantages.We will outline a few scenarios that may be applicable to your environment.

Introduction to Microsoft Virtual Server • Chapter 1 3

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 3

Page 29: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 1.1 Virtualization Diagram

Production Data CentersProduction servers can greatly benefit from virtualization technology,although this is most likely the first environment that you will want to targetfor virtualization. With any new technology that you are planning on imple-menting in your environment, it is usually best to implement in atest/pilot/production method to ensure the stability of production systems(see Figure 1.2). One of the key reasons for virtualization of production isthat on average, 90 percent of Windows-based production servers run below10 percent average utilization.This is a prime reason that virtualization is soprevalent today.You are able to save a great deal of money just by reducingthe number of servers purchased. Imagine having a 10-to-1 or greater consol-idation ration.You are able to take a data center with 100 servers and consoli-date it to 10 servers that can fit in a single server rack. Many clients that wespoke to also look to virtualization of their production systems for other rea-sons besides consolidation. Some are looking to save on the utility cost fromthe servers and the cooling for the room. Some have maxed out their powercapabilities and are facing an expensive electrical upgrade to continuegrowing.

4 Chapter 1 • Introduction to Microsoft Virtual Server

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 4

Page 30: Virtualization With Microsoft Virtual Server 2005 (2006)

Another huge advantage is recoverability. Each virtual server’s hard drive isrepresented by a single file.You are able to take a snapshot of this file forbackup. Virtual Server 2005 R1 and later versions support vss for snapshots.Aprime example of leveraging this technology is in the event of data loss orcorruption. For instance, say you are applying the latest service pack to yourvirtual server and after the automatic reboot the machine comes up with ablue screen. If you took a snapshot of the hard disk that your OS was on, youcan within seconds restore that snapshot and go back to before the servicepack was applied.This saves you from needing to potentially rebuild the entirevirtual server.

Figure 1.2 Phases from Test to Production

Test and Development Data CentersOne of the main advantages of using virtualization in the test and develop-ment areas is the ability to rapidly deploy new virtual serves.You can create abasic Windows Server virtual server and then clone that server any time that anew virtual server is needed.This saves a great deal of time compared to thestandard method of loading each OS.You can also create specialty machines,such as specific application servers, Web servers, SQL servers, and so on. By

Introduction to Microsoft Virtual Server • Chapter 1 5

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 5

Page 31: Virtualization With Microsoft Virtual Server 2005 (2006)

utilizing this, you can prevent diverting needed resources from productionservers to spend a great deal of time building test servers.

You can also use the snapshot technology for the test and developmentsystem. Because of the nature of the systems, they are constantly having appli-cations installed and uninstalled and having major application changes. Byusing snapshots you can keep several versions of these systems to help avoid atotal rebuild.

Disaster RecoveryDisaster recovery is becoming a critical issue for most companies today. Oneof the issues with disaster recovery is the potential cost. Without using virtu-alization as part of the disaster recovery solution, you are faced with repli-cating the hardware in your production site to the disaster recovery site. Byusing Microsoft Virtual Server at the disaster recovery location, you are ableto significantly reduce the hardware costs. Recoverability and time may bemore important to your company. By using Virtual Server you can meet allthree objectives above with one solution.There are many ways to implementMicrosoft Virtual Server 2005 for use in a disaster recovery site. Figure 1.3outlines one of the commonly implemented solutions to meet clients’ disasterrecovery needs.This solution enables clients to reduce their disaster recoverycosts considerably. More importantly, they are able to take their serverrecovery times down from days or weeks to hours and even minutes.The keypiece in this solution is the utilization of a Storage Area Network (SAN) atboth locations.All the virtual server disk and configuration files reside on theSAN; it is the job of the SAN to replicate the data from the primary site overto the disaster recovery site. Because all the virtual servers’ data is being repli-cated in the event of a disaster, you simply need to power on the virtualservers and their guest operating systems at the disaster recovery site.

6 Chapter 1 • Introduction to Microsoft Virtual Server

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 6

Page 32: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 1.3 Disaster Recovery Diagram

What Virtualization Tools Are Available?Virtual Server 2005 Migration Toolkit is a free tool available from Microsoftthat enables you to migrate a physical machine to a virtual machine.This iscommonly known as the P2V (physical-to-virtual) process.This may be usedto make a clone of an existing physical machine for test and developmentpurposes.You may use this as a tool to help move servers off their existinglegacy hardware that may be close to failing.This can also be used for creatingimages of physical machines for disaster recovery purposes as well.This is a listof operating systems that the Migration Toolkit supports:

■ Windows Server 2003 (Standard and Enterprise)

■ Windows 2000 (Standard and Advanced) SP4 or later required

■ Windows NT 4.0 Server (Standard and Enterprise) SP6a required

Third-Party Virtualization ToolsVirtualization technology utilization has exploded in the past few years.Aswith any product that is seeing this kind of growth, many companies jump on

Introduction to Microsoft Virtual Server • Chapter 1 7

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 7

Page 33: Virtualization With Microsoft Virtual Server 2005 (2006)

the bandwagon by developing tools to complement or enhance the product.There are still a limited number of third-party tools designed for VirtualServer 2005 R2 today, but as the product grows, many more may becomeavailable. One of the companies that specialize in such tools is PlateSpin.Theyhave two main products that help to make the transition from a physical to avirtual environment much easier.The two products described below arePlateSpin PowerRecon and PlateSpin PowerConvert.

PowerRecon is designed to evaluate your current physical environmentand to assist you with your server consolidation planning. It is designed togive a complete inventory of your hardware and software and also show theutilization of your servers.This is done by installing a data collector in yourenvironment and then choosing which servers you want to evaluate. One keypoint is that it does this without the need to install an agent on the serverthat it is collecting data from.This assessment should be run for a period of atleast 30 days to collect the performance characteristics of your environment.The assessment consists of three phases: assess, design, and implement.Thisassessment is critical to consolidation planning because before you start theconsolidation server you need to know how many host machines you needand how large the host server must be to handle the workload.

PowerConvert is used to convert your physical machines into virtualmachines. Without a tool to convert your servers from physical to virtual, youwould need to build new virtual machines and then transition the applica-tions from the physical server to the virtual server, which would take a greatdeal of effort and time. PowerConvert accomplishes this by taking an imageof the physical server, transferring that image to a virtual machine, and thenmaking the necessary changes so that the machine can boot up as a virtualmachine.The other advantage to this is that is does this by not destroying thedata on the physical server. So if you need to revert from the virtual machineto the physical machine, it is as simple as turning the physical server back on.PlateSpin PowerConvert also supports V2P (virtual-to-physical) conversions,so if your virtual machine outgrows the resources in the virtual environment,you can convert it to run on its own physical server. It also supports taking animage of either a physical or virtual server and storing it in an image reposi-tory for backup or automated deployment purposes.

8 Chapter 1 • Introduction to Microsoft Virtual Server

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 8

Page 34: Virtualization With Microsoft Virtual Server 2005 (2006)

Designing & Planning…

Evaluate Your EnvironmentUsing tools such as PlateSpin PowerRecon significantly reduces theamount of manual labor needed to evaluate your current server environ-ment. Analyzing the environment before consolidating can be critical to asuccessful consolidation by accurately sizing the host servers and numberof hosts needed.

How Does Virtualization Work?The basic idea of virtualization is taking a single physical machine and run-ning multiple virtual machines on top of that hardware.This is sometimesrelated to the concept of partitioning a hard disk into multiple logical drives.Virtualization works by taking the physical components of a machine andpresenting virtual hardware instead. Instead of a machine having its own phys-ical hard drive, its hard drive is simply a file residing on the host machine’s filesystem. It also has a virtual NIC, video card, peripheral ports, CPU, andmemory.These resources are managed by the Microsoft Virtual Server appli-cation that is running on the host machine.The virtualized hardware that ispresented to the guest OS is outlined in this section.

■ Presents single CPU

■ Intel 440BX motherboard

■ AMI BIOS

■ Up to 3.6 GB RAM

■ Up to four virtual IDE devices (CD-ROM or DVD-ROM drives)

■ Up to four SCSI controllers

■ Emulates Adaptec 7870 SCSI controller

Introduction to Microsoft Virtual Server • Chapter 1 9

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 9

Page 35: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Emulates S3 Trio64

■ Support for up to two virtual floppy disk drives.These can bemapped to a physical floppy disk drive or a virtual floppy disk driveusing a floppy image .flp file.

■ Up to two serial ports

■ One parallel port LPT

■ No USB support

■ Standard 101-key keyboard

■ Microsoft Intellimouse with PS2 interface

■ Emulates DEC 21140 Ethernet card

Virtual PC versus Virtual Server 2005Microsoft Virtual PC 2004 and Virtual Server 2005 are both designed toenable a physical machine to host multiple virtual machines. Both productshave a similar architecture and share many of the same features, but they alsodiffer in many ways. Many of the features and the user interface of the VirtualPC were designed with the desktop user in mind. Virtual Server was designedwith the system administrator in mind and is useful for hosting EnterpriseServer products. It has many advanced features that make its user interfacemore complex. In the next few sections,we will take a closer look at some ofthe differences and outline some usage scenarios.

Features That Are Found in Both Virtual PC and Virtual Server 2005 R2Both products have many of the same core features.They both use the samefile architecture; they use .vmc files for their virtual machine configurationfile; and their hard disks are .vhd files.They both provide networking for thevirtual machines, but Virtual Server adds a number of features that we willlook at in the following section. Both products also provide the capability touse advanced disk features such as undoable disk modes.

10 Chapter 1 • Introduction to Microsoft Virtual Server

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 10

Page 36: Virtualization With Microsoft Virtual Server 2005 (2006)

Differences between Virtual PC and Virtual Server 2005 R2Along with the many similarities, there are also many differences.The maindifferences come from the design of the two products. Virtual PC is designedfor hosting desktop operating systems and applications and Virtual Server isdesigned for server operating systems and applications. See Table 1.1 for theOS support matrix.

Table 1.1 OS Support Matrix

Virtual PC Virtual Server 2005 R2

Host OS Support Windows XP Professional Windows XP Professional

Windows 2000 Professional Windows Small BusinessServer Standard andPremium Windows 2003Server Standard, Enterprise,and Datacenter

Guest OS Support MS-DOS 6.22 MS-DOS 6.22

Windows 95 Windows 95

Windows 98 Windows 98

Windows 2000 Windows 2000

Windows NT 4.0 Windows NT 4.0

Windows XP Windows XP

OS/2 OS/2

Supported Features in Virtual PCVirtual PC offers the following features:

■ Sound card support within virtual machines

■ Copy/paste functionality from host-to-guest machine

■ Folder sharing between the host and guest operating systems

■ Shared networking via network address translation

Introduction to Microsoft Virtual Server • Chapter 1 11

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 11

Page 37: Virtualization With Microsoft Virtual Server 2005 (2006)

Supported Features in Virtual Server 2005 R2Virtual Server 2005 R2 supports several host hardware and virtual hardwarefeatures. It also supports other features that will be discussed in this section.

Host Hardware SupportVirtual Server 2005 R2 supports up to 32 physical processors. Virtual ServerR2 is a multithreaded application designed to take advantage of all the phys-ical processors.

Virtual HardwareVirtual Server 2005 R2 supports 3.6GB memory for each virtual machine. Italso supports SCSI disks.

Remote ManagementVirtual Server 2005 R2 provides a Web-management interface for remotemanagement of the Virtual Server product and virtual machines. It also pro-vides the Virtual Machine Remote Console (VMRC), which gives consoleaccess to the virtual machines.

SecurityVirtual Server 2005 R2 provides SSL security for Administrative managementWeb site and the VMRC. It can be configured to specify what user accounton each virtual machine runs under.

Support for ScriptingVirtual Server and the virtual machines running on the Virtual Server can bemanaged by using COM and API scripting.

WMI SupportWMI counters can be used with Virtual Server 2005 R2 to monitor virtualmachines by using Microsoft tools such as Microsoft Operations Manager andby being integrated into third-party management tools.

12 Chapter 1 • Introduction to Microsoft Virtual Server

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 12

Page 38: Virtualization With Microsoft Virtual Server 2005 (2006)

ClusteringVirtual Server 2005 R2 Enables clustering between two virtual machines forhigh-availability application.

Configuring & Implementing…

Running the OS on Host ServersUse the OS on the host server just for running Microsoft Virtual Server2005 R2 and the virtual machines. Using it to run another application willreduce the amount of resources available to the virtual machines.

Scenarios for the Use of Virtual PCBoth products are very useful, but the key is using each product in the rightarea. In this section we will discuss some areas where Virtual PC may be theright product to use.

Help DeskIn today’s corporate environment, many help desk workers are tasked withsupporting a wide variety of operating systems and applications. Withoutusing a Virtual PC, a help desk technician may need to have multiplemachines on their desk with all the different operating systems and applica-tions loaded. Or they may need to load dual boot or load multiple oper-ating systems or their PC.This can be very time consuming because youhave to wait to reboot the machine to switch between operating systems.By using Virtual PC, you can run multiple operating systems at the sametime and switch between them very quickly to assist with troubleshootingissues.

TrainingFor application training purposes, you only need to have a single workstationper student, and then you can run multiple virtual machines on top of that

Introduction to Microsoft Virtual Server • Chapter 1 13

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 13

Page 39: Virtualization With Microsoft Virtual Server 2005 (2006)

workstation.You can create a full Microsoft infrastructure consisting ofdomain controllers, Web servers, application server, or whatever else is neededfor the training, without the need of multiple machines.You can also keepimages of these machines so you can refresh the environment without theneed to reload every machine after each class.This can also be done by settingthe virtual machine to not save changes made during the class.

TestingWhen you need to test a new application, test it in a virtual machine ratherthan risk creating problems with your workstation by loading an applicationthat may cause conflicts.

Legacy ApplicationsIf you need to run an application that will not work or is not supportedunder Windows XP, you can run the application within legacy operating systems.

Virtual Server 2005 versus Virtual Server 2005 R2The core application is much the same between Virtual Server 2005 and R2.R2 is basically a product update to the Virtual Server 2005 release. In thissection we outline the following new additions found in the R2 product:

■ x64 support This adds support for 64-bit versions of Windows tobe used for the host operating system.

■ Host clustering This enables clustering between Virtual Serverhosts, which provides for the failover of guest machines.

■ Linux guest OS support

■ iSCSI support

■ Improved support for hyper-threading

■ PXE booting The PXE booting support has been enhanced byadding it into the virtual machine network adapter.This will allowfor the deployment of virtual machines by using the same methods ofnetwork installation used by physical servers.

14 Chapter 1 • Introduction to Microsoft Virtual Server

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 14

Page 40: Virtualization With Microsoft Virtual Server 2005 (2006)

SummaryMicrosoft Virtual Server 2005 R2 is a very versatile application. It has mul-tiple practical applications in today’s IT environments.As you have read,Virtual Server can meet your needs whether you need to implement a test,production, disaster recovery site, or all of the above.The main reason forimplementing Virtual Server 2005 R2 may be to reduce physical servers andreduce cost.The other advantages, such as OS portability and recoverability,are making it an increasingly popular choice for today’s infrastructure needs.

Solutions Fast Track

Microsoft Virtual Server 2005 R2 and Dynamics System Initiative

� Microsoft Virtual Server 2005 R2 and the Dynamic SystemsInitiative streamline data center operations.

� Virtual Server 2005 R2 increases server efficiency.

� Virtual Server 2005 R2 improves operating system and applicationflexibility.

What Is Virtualization, and When Should You Use It?� Virtualization is used to rapidly deploy test systems.

� Virtualization is used to consolidate underutilized physical servers.

� Virtualization is used to take snapshots to create recovery points.

� Virtualization is used to increase disaster recovery potential.

What Virtualization Tools Are Available?� PowerRecon automates the process of consolidation feasibility and

planning.

� Consolidation planning is a useful tool in showing the value ofvirtualization to management.

Introduction to Microsoft Virtual Server • Chapter 1 15

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 15

Page 41: Virtualization With Microsoft Virtual Server 2005 (2006)

� PowerConvert can convert both Windows and Linux physicalmachines.

� PowerConvert considerably eases the migration process.

How Does Virtualization Work?� Virtualization presents a standard motherboard to the guest machines.

� Virtual servers use up to 3.6 GB of physical RAM on the host.

� Virtual servers support physical and virtual CDs.

� Virtual servers support porting virtual machines from one host toanother.

Virtual PC versus Virtual Server 2005� Virtual Server supports 3.6GB RAM per virtual machine.

� Virtual Server supports 32 processors.

� Virtual PC supports sound.

� Virtual PC was designed for desktop operating systems.

Virtual Server 2005 versus Virtual Server 2005 R2� Virtual Server 2005 R2 offers x64 support.

� Virtual Server 2005 R2 offers iSCSI support.

� Virtual Server 2005 R2 offers host-clustering support.

� Virtual Server 2005 R2 offers enhanced PXE-booting support.

16 Chapter 1 • Introduction to Microsoft Virtual Server

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 16

Page 42: Virtualization With Microsoft Virtual Server 2005 (2006)

Q: Can I migrate Virtual PC machines to Virtual Server 2005?

A: Yes, you can move virtual machines from Virtual PC to Virtual Server.

Q: Does Virtual Server 2005 R2 support 64-bit processors and host operatingsystems?

A: Yes, it enables you to run 64-bit versions of Windows as the host oper-ating system.

Q: Can Virtual Server 2005 R2 run production servers?

A: Virtual Server can run production virtual machines, thereby making it aperfect candidate for consolidating underutilized physical machines.

Q: Can I run Linux virtual machines on Virtual Server 2005 R2?

A: Yes, Linux is supported as a guest OS on Virtual Server 2005 R2.

Q: Can I run 64-bit guest operating systems?

A: No, although the host operating system can run a 64-bit operating system,the guests require 32-bit operating systems.

Q: Does Virtual Server 2005 R2 support multiprocessor (SMP) virtualmachines?

A: No, the virtual machines are uniprocessor.

Introduction to Microsoft Virtual Server • Chapter 1 17

Frequently Asked Questions

The following Frequently Asked Questions, answered by the authors of this book,are designed to both measure your understanding of the concepts presented in this chapter and to assist you with real-life implementation of these concepts. Tohave your questions about this chapter answered by the author, browse towww.syngress.com/solutions and click on the “Ask the Author” form.

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 17

Page 43: Virtualization With Microsoft Virtual Server 2005 (2006)

406_VIRTUAL_01.qxd 9/8/06 7:32 PM Page 18

Page 44: Virtualization With Microsoft Virtual Server 2005 (2006)

Installing andConfiguring aVirtual Server

Solutions in this chapter:

■ Determining the Physical Size of the Server

■ Installing Virtual Server 2005 R2

■ Setting Up a Virtual Server AdministrationWeb Site

■ Virtual Machine Remote Console

■ Setting Default Location and Search Paths

■ Setting Resource Allocation

Chapter 2

19

� Summary

� Solutions Fast Track

� Frequently Asked Questions

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 19

Page 45: Virtualization With Microsoft Virtual Server 2005 (2006)

IntroductionAt this point, we know all about the what, the why, and the when; the nextstep is the how.The install is very straightforward, as with most Microsoftapplications.The installation application is a wizard-based graphical install.The important detail not to overlook is that, before you are able to virtualizeservers, you must determine the hardware needed to run your virtual servers’environment and set up the virtual server software.

Running the setup will result in a working server, but when nothing isconfigured after the installation, only administrators are able to connect to anymachine via the console. Configuring your virtual server correctly will pro-vide secure and reliable access while giving the best performance possible.

Determining the Physical Size of the ServerThis process of determining the size of the physical server that will host thevirtual servers is a critical step that should not be neglected.Adequately plan-ning the size of the physical server will provide a solid foundation fromwhich to run virtual servers. Some of the key things that need to be addressedwhen planning what physical hardware is needed are the number of virtualmachines that will be on the host, and, more importantly, what will be run-ning on these virtual machines. What each virtual machine is running is crit-ical because, for example, a virtual machine that is a basic domain controllermay require far fewer resources than that of a virtual machine running SQLor Microsoft Exchange. Refer to Table 2.1 for Virtual Server 2005 R2 systemrequirements.

Physical Server SizingWhen evaluating the sizing needs of the physical server, the virtual machinesthat will be running on it will fall into two categories.The first is existingphysical servers and the second is new servers that will be in deployed in theenvironment.The four key performance areas to evaluate are CPU utilization,memory usage, disk I/O, and network I/O.You will also need to determinethe disk space requirements of each virtual machine and take this into consid-

20 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 20

Page 46: Virtualization With Microsoft Virtual Server 2005 (2006)

eration whether the physical server will utilize internal storage or externalstorage, such as on a SAN.

Evaluating Existing Physical Servers Some key reasons for virtualizing existing servers running on physical hard-ware can be for server consolidation, making clone for test and development,and disaster recovery. In any case, existing servers can be significantly easier toplan for.The main reason for this is that you have a live server to evaluate itscurrent utilization. By determining a server’s current utilization you will havea good idea of the resources that it will consume after it is virtualized.

Planning for New Virtual ServersNew servers that will be introduced into the environment are slightly morechallenging.There are, however, methods to estimate their resource needs.Most application vendors will publish in the application documentation theparticular resource requirements of their application.You can use thoserequirements in determining what they will require in a virtual server envi-ronment.You may also have a similar server running in your environment thatyou can use to evaluate its resource needs.

Designing & Planning…

Balancing WorkloadsTo use resources affectively, try to place virtual machines with dissimilarworkloads on the virtual server. For example, if some machines are CPUintensive, place them on the same virtual server with machines that arememory or disk I/O intensive.

Table 2.1 lists the system requirements for Virtual Server 2005 R2.

Installing and Configuring a Virtual Server • Chapter 2 21

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 21

Page 47: Virtualization With Microsoft Virtual Server 2005 (2006)

Table 2.1 Virtual Server 2005 R2 System Requirements

Minimum CPU Speed 550 MHz

Number of Processors Total physical processors supported by thehost operating system.

Recommended CPU Speed At least 1 GHz

Processor Information Intel and AMD support

Supported Host Operating Microsoft Windows Server 2003 Standard Systems Edition, Enterprise Edition, or Datacenter

EditionWindows Server 2003 Standard x64Edition, Enterprise x64 Edition, Datacenterx64 Edition or later Windows Small Business Server 2003Standard Edition or Premium EditionWindows XP Professional Service Pack 2 orlater

Minimum RAM 256 MB

Required Available Hard 2 GB plus space needed for each virtual Disk Space machine

Installing Virtual Server 2005 R2The setup of Microsoft Virtual Server 2005 R2 is much like the installationof other Microsoft software.The wizard-based setup can be run from mediadownloaded from the Microsoft Web site, or you can order a media CD fromMicrosoft.The following sections will walk you through the installation ofVirtual Server 2005 R2 step by step.

Preinstallation Tasks

1. Acquire Virtual Server software.The software can be downloadedform the Microsoft Web site at www.microsoft.com/windowsserversystem/virtualserver/software/default.mspx.

2. Install supported host operating system on physical server.

3. Install IIS on host system.

22 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 22

Page 48: Virtualization With Microsoft Virtual Server 2005 (2006)

Installation TasksAs depicted in Figure 2.1, to begin the installation of Microsoft Virtual Server2005 R2, simply run the setup.exe file.The software can be obtained from theMicrosoft Web site.You can either download the media immediately from theMicrosoft Web site or you can also order the Virtual Server software CD fromMicrosoft.

Figure 2.1 Running Setup

The screen in Figure 2.2 is the initial page that is displayed when runningthe setup. Click the icon labeled Install Microsoft Virtual Server 2005 R2.

Figure 2.2 Microsoft Virtual Serve 2005 R2 Setup

Installing and Configuring a Virtual Server • Chapter 2 23

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 23

Page 49: Virtualization With Microsoft Virtual Server 2005 (2006)

The License Agreement screen appears, as shown in Figure 2.3. Select theI accept the terms in the license agreement radio button and then clickNext to continue.

Figure 2.3 License Agreement

The Customer Information screen appears, as shown in Figure 2.4. Enteryour user name and organization information in the appropriate fields. Notethat the product key is automatically provided. Click Next to continue.

Figure 2.4 Customer Information

The Setup Type screen appears, as shown in Figure 2.5. Select Customand then click Next.This will enable you to select specific components andto choose the desired installation location.

24 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 24

Page 50: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 2.5 Setup Type

The Custom Setup screen appears, as shown in Figure 2.6. Notice that allcomponents are selected by default.You may choose to install the VirtualServer Web Application on a separate server.This is desirable when imple-menting more than one Virtual Server 2005 server. From the Virtual ServerWeb Application you can manager the various Virtual Server 2005 servers.When finished, click Next.

Figure 2.6 Custom Setup

Installing and Configuring a Virtual Server • Chapter 2 25

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 25

Page 51: Virtualization With Microsoft Virtual Server 2005 (2006)

The Configure Components screen appears, as shown in Figure 2.7.Youcan choose to change the default Web site port.You can also configurewhether the Administration Web site will run as the authenticated user(default) or as the Local System account. When finished, click Next.

Figure 2.7 Configuring Virtual Server Web Site

A second Configure Components screen appears, as shown in Figure 2.8.You can choose to have the installation automatically enable Virtual Serverexceptions in Windows Firewall. Note:This may not apply if not runningWindows Firewall. When finished, click Next.

Figure 2.8 Enabling Virtual Server exceptions in Windows Firewall

26 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 26

Page 52: Virtualization With Microsoft Virtual Server 2005 (2006)

The Ready to Install screen appears, as shown in Figure 2.9. Verify thatthe installation directory is correct, and then click Install to continue.

Figure 2.9 Ready to Install

Figure 2.10 shows the installation progress.

Figure 2.10 Installing Microsoft Virtual Server 2005 R2

Installing and Configuring a Virtual Server • Chapter 2 27

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 27

Page 53: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 2.11 shows the post-installation summary. Note the link under“Administration Website.”This link will take you to the Administration Website that is the management interface for Virtual Server.

Figure 2.11 Installation Summary

Setting Up a Virtual ServerAdministration Web SiteThe Microsoft Virtual Server Administration Web site is a Web-based applica-tion that is used to manage and configure the virtual server as well as the virtualmachines running on the virtual server.The Virtual Server Administration Website can be installed in two ways.The first way is to install the Virtual ServerAdministration Web site as part of the installation of Virtual Server.The secondway is to install the Virtual Server Administration Web site on its own stand-alone server.You may want to choose the second option if you plan to havemultiple Microsoft virtual servers and want to avoid installing IIS on every host.From a single server running the Virtual Server Administration Web site youcan manage all the Microsoft virtual servers in your environment.

28 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 28

Page 54: Virtualization With Microsoft Virtual Server 2005 (2006)

Virtual Server Administration Web Site InstallationThe installation of the Virtual Server Administration Web site is part of thestandard installation of Microsoft Virtual Server. If you plan to install theVirtual Server Administration Web site on a single server, then you will wantto select custom installation during setup.

Installing in a Multiserver EnvironmentAdditional configuration tasks are required when installing the Virtual ServerAdministration Web site with the intent to manage multiple machines run-ning Microsoft Virtual Server. If installing in a multiserver environment, youwill want to take special note of Figure 2.17, which changes the standardauthentication type to enable authentication across multiple servers.

The install the Virtual Server Administrative Web site, you will run thesame setup that is used to install Virtual Server.

The screen in Figure 2.12 is the same initial page that is displayed whenrunning the setup. Click on the link labeled Install Microsoft VirtualServer 2005 R2.

Figure 2.12 Microsoft Virtual Serve 2005 R2 Setup

Installing and Configuring a Virtual Server • Chapter 2 29

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 29

Page 55: Virtualization With Microsoft Virtual Server 2005 (2006)

The License Agreement screen appears, as shown in Figure 2.13. Selectthe I accept the terms in the license agreement radio button, and thenclick Next to continue.

Figure 2.13 License Agreement

The Customer Information screen appears, as shown in Figure 2.14. Enteryour user name and organization information in the appropriate fields. Notethat the product key is automatically provided. Click Next to continue.

Figure 2.14 Customer Information

30 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 30

Page 56: Virtualization With Microsoft Virtual Server 2005 (2006)

The Setup Type screen appears, as shown in Figure 2.15. Select Customand click Next.This will enable you to select specific components and tochoose the desired installation location.

Figure 2.15 Setup Type

The Custom Setup screen appears, as shown in Figure 2.16. Deselect allthe components except for the Virtual Server Web Application wheninstalling on a standalone server. Click Next.

Figure 2.16 Custom Setup

Installing and Configuring a Virtual Server • Chapter 2 31

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 31

Page 57: Virtualization With Microsoft Virtual Server 2005 (2006)

The Configure Components screen appears, as shown in Figure 2.17.Youcan choose to change the default Web site port.You can also configurewhether the Administration Web site will run as the authenticated user(default), or as the Local System account. For managing multiple servers youwill want to change the default user that the Web site runs as from authenti-cated user to have it run as the local system account. Click Next.

Figure 2.17 Configuring Virtual Server Web Site

A second Configure Components screen appears, as shown in Figure 2.18.You can choose to have the installation automatically enable Virtual Serverexceptions in Windows Firewall. Note:This may not apply if not runningWindows Firewall. Click Next.

Figure 2.18 Enabling Virtual Server Exceptions in Windows Firewall

32 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 32

Page 58: Virtualization With Microsoft Virtual Server 2005 (2006)

The Ready to Install screen appears, as shown in Figure 2.19. Verify thatthe installation directory is correct, and then click Install to continue.

Figure 2.19 Ready to Install

Figure 2.20 shows the post-installation summary. Note the link under“Administration Website.”This link will take you to the Administration Website that is the management interface for Virtual Server.

Figure 2.20 Installation Summary

Installing and Configuring a Virtual Server • Chapter 2 33

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 33

Page 59: Virtualization With Microsoft Virtual Server 2005 (2006)

The Specify Virtual Server screen appears, as shown in Figure 2.21. In theComputer name field, type the name of the Microsoft virtual server thatyou are going to administer and then click Connect to continue.

Figure 2.21 Connecting to the Virtual Server

The homepage from which the virtual servers are managed appears, asshown in Figure 2.22.

Figure 2.22 Virtual Server Homepage

34 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 34

Page 60: Virtualization With Microsoft Virtual Server 2005 (2006)

Virtual Machine Remote ConsoleBecause you are unable to attach a monitor, keyboard, and mouse to a virtualmachine, Microsoft Virtual Server provides the Virtual Machine RemoteConsole (VMRC) client.The remote client works much the same way as aphysical IP-based KVM. When connecting to a virtual machine by using theVMRC client, you are actually on the console of that specific virtualmachine.The VMRC client is used during the initial install of the operatingsystem on the virtual machine, for installing software, and for troubleshootingvirtual machine issues.The best practice is to use OS-based remote manage-ment like Microsoft Terminal Services or VNC to manage the virtualmachines. Using these clients for day-to-day management on the virtualmachine takes less of a toll on the resources of the host than using theVMRC.

Setting Access Permissions for the Virtual Machine Remote ConsoleTo set up the VMRC, you will need to follow these steps:

Open the Administration Web site, as shown in Figure 2.23. Click theServer Properties link found under the Virtual Server section.

Figure 2.23 Virtual Server Home Page

Installing and Configuring a Virtual Server • Chapter 2 35

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 35

Page 61: Virtualization With Microsoft Virtual Server 2005 (2006)

As shown in Figure 2.24, click the link labeled Virtual MachineRemote Control (VMRC) Server to enable and configure the VMRC.

Figure 2.24 Virtual Server Properties

As shown in Figure 2.25, select the Enable check box to enable VMRC.

Figure 2.25 VMRC Configuration

36 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 36

Page 62: Virtualization With Microsoft Virtual Server 2005 (2006)

As shown in Figure 2.26, after selecting Enable, complete the informationon the rest of the page. For additional VMRC security you can also configureit to use SSL to encrypt the connection.

Figure 2.26 Virtual Server Properties

The VMRC is now configured and ready to accept connections.

Setting Default Location and Search PathsThe default location and search path are used to specify where the virtualmachine configuration files are placed on the virtual server by default.Thenext few steps show how to configure the default location and search paths.

1. To configure the default location and search paths, open the VirtualServer home page, as shown in Figure 2.27.

Installing and Configuring a Virtual Server • Chapter 2 37

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 37

Page 63: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 2.27 Virtual Server Home Page

2. From the Virtual Server Properties screen, click Search paths, asshown in Figure 2.28.

Figure 2.28 Virtual Server Properties

You can specify both the default configuration folder and search path (seeFigure 2.29).

38 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 38

Page 64: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 2.29 Virtual Server Properties

Setting Resource AllocationMicrosoft Virtual Server enables you to customize the resource allocation ofthe virtual machines.The main resources that you may want to customize areCPU and the amount of memory allocated.The memory allocation is not adynamic change that can be performed while the virtual machine is running.To change the memory allocation of a virtual machine, you must shut downthat particular virtual machine and then either raise or lower the amount ofmemory allocated.The CPU allocation of the virtual machine is configuredas shown in the following steps.

Configuring & Implementing…

Resource AllocationYou can configure the maximum percentage of a CPU that a virtualmachine can use to prevent it from negatively affecting other virtualmachines. This can be very handy in case of a legacy server that tends tograb all available CPU resources.

Installing and Configuring a Virtual Server • Chapter 2 39

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 39

Page 65: Virtualization With Microsoft Virtual Server 2005 (2006)

To set the resource allocation, connect to the Virtual Server home page, asshown in Figure 2.30.

Figure 2.30 Virtual Server Home Page

From the Virtual Server Properties screen, click Resource Allocation(see Figure 2.31).

Figure 2.31 Virtual Server Properties

40 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 40

Page 66: Virtualization With Microsoft Virtual Server 2005 (2006)

As shown in Figure 2.31, there are three different settings that can be usedto set the resource allocation of each virtual machine.

The first field is labeled Relative Weight.This is used to set the priority ofthis virtual machine compared to the other virtual machines on the host.Thisis critical if resources are limited on the host and virtual machines start con-tending with each other for resources. For example, by setting one virtualmachine to a relative weight to 200 and leaving the other virtual machines atthe default of 100, you can ensure that it gets priority over the other virtualmachines for resources.A common configuration is to set production systemsto 200 and leave test and development virtual machines at 100.

The second field is labeled Reserved Capacity. By default, all virtualmachines are to the 0%. If you want to guarantee that a particular virtualmachine always has at least 50 percent of a processor, you can specify that inthis field.

The third field is labeled Maximum Capacity.This is where you canspecify the maximum percentage of CPU resources that a virtual machine canuse.This can be very nice for isolating virtual machines that have processesthat tend to run away and use 100% of its CPU. By specifying that it can onlyuse up to a certain amount of CPU resources, you can ensure that it doesn’taffect the other virtual machines.

Installing and Configuring a Virtual Server • Chapter 2 41

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 41

Page 67: Virtualization With Microsoft Virtual Server 2005 (2006)

SummaryAs you may have noticed, a good deal of planning should go into design andconfiguration of the virtual server host machines, as well as the virtualmachines that will run the host. By adequately planning the size on the hostserver, you can ensure that there are enough resources the run the desired vir-tual machines. By planning ahead, you will also be able to identify themethod by which you want to implement the Virtual Server AdministrationWeb site. While the default resource allocation settings for relative weight andCPU work great if all the virtual machines are of equal priority, if you havesome virtual machines that are more important than others, this can be a crit-ical setting.

Solutions Fast Track

Determining the Physical Size of the Server

� Verify the hardware requirements for Microsoft Virtual Server.

� Evaluate what will be running in the environment.

� Plan adequately for growth of the environment.

Installing Virtual Server 2005 R2

� Download the latest media or order media from Microsoft.

� Install IIS if you plan to run the Virtual Server Administrative Website from the host.

� Determine if you are going to have a single or multiple virtual serverenvironment.

Setting Up a Virtual Server Administration Web Site

� Install IIS before installing the Virtual Server Web site.

42 Chapter 2 • Installing and Configuring a Virtual Server

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 42

Page 68: Virtualization With Microsoft Virtual Server 2005 (2006)

Installing and Configuring a Virtual Server • Chapter 2 43

� Determine whether or not the site will be used to manage multiplevirtual servers.

� Having a single Virtual Server Administrative Web site can bedesirable for security-conscious companies that want to reduce thenumber of IIS servers in their environment.

Virtual Machine Remote Console

� Set the connection timeout to disconnect idle connections.

� If using the VMRC through a firewall, ensure that the appropriateports are open.

� Determine whether or not you want to utilize SSL to secure theconnection.

Setting Default Location and Search Paths

� For consistency, keep the default virtual machine configuration folderthe same on each virtual server.

� If using a resource on a remote location, ensure that constraineddelegating is configured.

� Always use fully qualified paths.

Setting Resource Allocation

� Utilize relative weight when running virtual machines with differentpriorities.

� Use the reserved capacity setting to guarantee a certain percentage ofCPU resources to a virtual machine.

� Use maximum capacity setting to prevent a virtual machine fromusing more than the desired percentage of CPU resources.

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 43

Page 69: Virtualization With Microsoft Virtual Server 2005 (2006)

Q: Should I leave hyper-threading enabled or should it be disabled?

A: Because of the workload on Microsoft Virtual Server, the best practice isto disable hyper-threading.

Q: How many virtual machines can I run on each Microsoft virtual server?

A: This will vary depending on the workload of the virtual machines run-ning on Microsoft virtual server.

Q: What happens if a virtual machine crashes? Does it affect the other virtualmachines?

A: Each virtual machine is isolated form the other virtual machines on thehost; if one virtual machine crashes it will not affect the other virtualmachines.

Q: Can I allocate more memory to a virtual machine on the fly?

A: Although you can’t allocate more memory on the fly, you can quicklyadjust the amount of memory a virtual machine has by shutting it downand editing its configuration.

Q: How should I connect to the desktop of a virtual machine?

A: You can connect to the desktop by using the VMRC, but the best prac-tice is to use Terminal Services to connect to the desktop when available.

Q: How can I ensure that one machine gets all the resources that it needs?

A: By setting its relative weight higher than the other virtual machines, it willdynamically allocate additional resources as needed from other virtualmachines.

44 Chapter 2 • Installing and Configuring a Virtual Server

Frequently Asked Questions

The following Frequently Asked Questions, answered by the authors of this book,are designed to both measure your understanding of the concepts presented in this chapter and to assist you with real-life implementation of these concepts. Tohave your questions about this chapter answered by the author, browse towww.syngress.com/solutions and click on the “Ask the Author” form.

PV27

406_VIRTUAL_02.qxd 9/8/06 7:18 PM Page 44

Page 70: Virtualization With Microsoft Virtual Server 2005 (2006)

Virtual Machines

Solutions in this chapter:

■ Creating the Virtual Server

■ Adding Hardware to the Server

■ Installing a Windows OS

■ Installing Virtual Machine Additions

■ Installing a Non-Windows OS

Chapter 3

45

� Summary

� Solutions Fast Track

� Frequently Asked Questions

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 45

Page 71: Virtualization With Microsoft Virtual Server 2005 (2006)

IntroductionA virtual server isn’t of any use without any servers deployed on it.Deployment of servers can be done by using the Virtual Server MigrationToolkit, but also by creating a virtual server (virtual hardware) and installingan operating system on it.

Before installing the guest operating system onto the virtual hardware,you need to make the correct decisions about the (virtual) hardware setup.This contains selecting the correct network, choosing the correct disk andcontroller type. Setting this correctly will give you a fast and flexible (vir-tual) server.

You need to configure at least one virtual hard disk for the virtualmachine to install an operating system.You can have more than one virtualhard disk on a virtual machine if it is needed for separation of data or loadinga database or for some other reason.You can configure a virtual machine toboot from a floppy disk or a CD-ROM, but a virtual hard disk is normallyrequired to maintain the operating system and applications of the virtualmachine.The four types of virtual hard disk all are saved as .vhd files in theMy Virtual Machines folder by default.The four types are:

■ Dynamically expanding The actual size of the virtual hard diskexpands as it is written.The initial size starts small at less than 100the size expands until it reaches the specified maximum size estab-lished when the disk was created. (This is the default type.)

■ Fixed-size The actual size of the virtual hard disk is fixed to themaximum size specified when the disk was created.The virtual diskwill not grow. If you create a 40GB fixed-size virtual hard disk, it willimmediately use 40 GB of space.

■ Differencing A differencing virtual hard disk is a virtual hard diskconfigured in a parent-child relationship.The differencing disk is thechild and the associated virtual disk is the parent.The differencingdisk stores a record of all changes made to the parent disk and saveschanges without altering the parent disk. It is possible to write-pro-tect the parent virtual hard disk and have several differencing virtualdisks share the same parent virtual disk. Changes to the parent virtual

46 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 46

Page 72: Virtualization With Microsoft Virtual Server 2005 (2006)

disk can be tried with the virtual machines using a differencing vir-tual disk for testing before committing the changes to the parent vir-tual disk.A differencing disk can also use a sysprep parent to rapidlydeploy multiple virtual machines based on a “golden” image of theoperating system.

■ Linked A linked virtual disk is a connection to a physical hard diskon the physical computer.This virtual hard disk can have multiplevolumes.The virtual hard disk is created with the actual boot parti-tion and partition map from the physical drive on the physical com-puter.All read and write requests are performed directly on thelinked physical hard disk.A linked disk provides a way to convert aphysical hard disk to a virtual hard disk.This disk can have multiplevolumes. Linked disks are always fixed-size disks that use the entiredisk.You must have adequate space on the physical server’s disk drivesto accommodate this new fixed virtual disk.You cannot use undo anddifferencing disks with a linked disk.

Creating the Virtual ServerA virtual server can run almost any Intel-based operating system and each canhave different amounts of memory, numbers of virtual hard disks, and Comand LPT ports.You must consider some planning steps when making virtualservers.The main thing to remember is that all virtual machines are depen-dant on the physical resources of the Virtual Server 2005 server.The hostserver must have enough physical resources for memory, disk, CPU, and net-work bandwidth to handle the number of virtual machines and the allocatedresources of each.

Some things to consider are:

■ Virtual Machine filenames Each virtual machine must have aunique filename.This filename must be fewer than 150 characterslong without any special characters.A descriptive filename is the bestpractice to avoid confusion later on.An example of a good filenamemay be EXCH01_Win2003SP1_Exch2003SP2_C.vhd for the C:

Virtual Machines • Chapter 3 47

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 47

Page 73: Virtualization With Microsoft Virtual Server 2005 (2006)

drive of a server named EXCH01 that is running Windows 2003Server SP1 with Exchange Server 2003 SP2.

■ Memory All running virtual machines require at least enoughmemory for the host operating system and each guest operatingsystem running on the Virtual Server.The minimum amount ofmemory for both the host operating system, typically Windows 2003Server, and the guest operating system for all running virtualmachines must be physically present in the host server.The maximumamount of memory in a physical server is dictated by the host oper-ating system. For example if the host server is running Windows2003 Server R2 Standard, 256 MB is the minimum memoryrequired, and the guest operating system is Windows Small BusinessServer 2003 Premium, 512 MB minimum memory required, the hostserver would need at least 768 MB of memory.A maximum of sevenof these virtual servers could be run on this host because the max-imum memory limit is 4 GB of memory. Of course this limitationcan be overcome by using 64-bit servers and using Virtual Server2005 R2 x64.

■ Hard Disk Each virtual machine must have its own virtual harddisk.Any of the four types of virtual hard disk file can be used forthe virtual machine.The physical hard disk of the host server alsoneeds to be large enough to accommodate the host operating systemand the Virtual Server 2005 R2 software.The virtual server harddisks can use UNC paths and externally connected disk drives butperformance can be degraded based on the connection method.Connecting the host server to a Storage Area Network (SAN) is thebest method to store virtual hard disks.

■ CD/DVD Drive A physical CD/DVD drive may be shared bymore than one virtual machine. When a disk is inserted into thedrive, the active virtual machine will automatically capture the opticaldrive.You can manually set other virtual machines to capture theoptical drive by using the CD icon on the virtual machine status bar.It is best to configure the virtual servers to start up with the optical

48 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 48

Page 74: Virtualization With Microsoft Virtual Server 2005 (2006)

drive disconnected.An ISO image of a CD/DVD can also bemounted to the virtual CD/DVD instead of a physical CD/DVD.

■ Floppy Disk The physical floppy disk can be used by the virtualmachines or a virtual floppy disk can be configured as a .vfd file.Toshare a virtual floppy disk (.vfd file) between virtual machines, the.vfd file has to be set to read-only.The physical floppy disk will beconnected to the first virtual machine that can use it. It is best toconfigure the virtual servers to start up with the floppy disk drivedisconnected or to create a virtual floppy disk for each virtualmachine.

■ Com1 or Com2 All devices attached to a COM port may be usedby a virtual machine. Only one virtual machine at a time can accessthe physical COM ports of the host computer. When connected, thedevice is not available for use by other virtual machines.After the vir-tual machine releases the port or is shut down the COM port willbecome available to other virtual machines. It is best to configure thevirtual servers to start up with the COM ports disconnected.

■ LPT1 Any device connected to the host computer LPT port can beused by a virtual machine. When the physical LPT port is connectedto a virtual machine the device is not available to any other virtualmachine or to the host computer until the virtual machine releasesthe LPT port or is shut down. Physical LPT ports are restricted toI/O address range from 0x378 through 0x37F. It is best to configurethe virtual servers to start up with the LPT port disconnected.

Using the Administration Web PageThe administration Web page is the simplest method to use to create yourvirtual machine. If it is necessary to create several similar virtual machines onmultiple host servers, it may be advantageous to use the programmatic func-tions in the Virtual Server SDK. For most instances you will likely use theadministration Web page. Start by opening up your Internet browser andpointing it to http://servername/VirtualServer/VSWebApp.exe?view=1 wherethe servername is replaced with the name of the server hosting the administra-tion Web page.

Virtual Machines • Chapter 3 49

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 49

Page 75: Virtualization With Microsoft Virtual Server 2005 (2006)

On the left-hand side of the page, select Create in the VirtualMachines section as shown in Figure 3.1.

Figure 3.1 Selecting the Virtual Machine Section

The Create Virtual Machine page appears.This page has all the initialconfiguration information for the new virtual server.You have several selec-tion options on this page, as shown in Figure 3.2.The main ones are thename of the new virtual server, the virtual hard disk options, and the virtualnetwork adapter.

As you can see in Figure 3.2, the Create Virtual Machine page has fivesettings: Virtual machine name, Memory, Virtual hard disk, Virtual networkadapter, and Virtual machine additions.The first thing to do is name the vir-tual machine. Each virtual machine must have a unique name. Just as you dowhen naming physical servers, it is best to use some sort of naming conven-tion that makes sense to you.

50 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 50

Page 76: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.2 Create Virtual Machine Settings

Next, you need to set the amount of memory that this virtual machinewill be allocated.This number is in megabytes (MB).You can be a little stingyon the memory settings if you want.A Windows 2003 Server will run fine on256 MB of memory and very well on 388 MB. Remember that this memoryis taken out of the useful pool of memory for the host server so you don’twant to starve it either.You can always go back later and add more to this vir-tual machine if it really needs it.

The next stage is where you can create a new virtual hard disk or use onethat you have already created.You can also elect not to attach a virtual harddisk at this time but a virtual machine must have a virtual hard disk to load anoperating system.You have three options under the Virtual hard disk setting:

■ Create a new virtual hard disk Asks you to specify a size for thenew virtual hard disk.This will create a dynamic virtual hard diskwith the same name as the virtual machine name.You can select the

Virtual Machines • Chapter 3 51

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 51

Page 77: Virtualization With Microsoft Virtual Server 2005 (2006)

size units for the disk drive: your choices are MB or GB.The nextoption is the bus type.The choices are SCSI or IDE. If SCSI isselected, the virtual hard disk size can be as big as 2040 GB. If IDE isselected, the virtual hard disk is limited to a maximum size of 127 GB.

■ Use an existing virtual hard disk Enables you to select a virtualhard disk that was previously created.You can either select one listedin the Location pull-down menu or enter the full path in theFilename box.You also need to select a bus type.The same choicesand parameters apply.

■ Attach a virtual hard disk later (None) This option will createthe virtual machine without a virtual hard disk.This may be useful ifyou are creating virtual machines with different memory and net-work setting but want to connect to a differential virtual hard diskthat has not yet been created.You may also use this option to createthe virtual machine before the conversion of a linked virtual harddisk is completed.

The area called Virtual network adapter connects the new virtual machineto one of three network options (virtual networks are covered in more detailin the next chapter):

■ Not Connected Means there is no network connected.This willmake the virtual machine an island and it will to be able to trade fileswith any other server.

■ Internal Network Each host Virtual Server 2005 server supports aninternal network.This will allow virtual machines hosted on thisserver to communicate with each other but not to any server outsideof this host server.This is a good choice for isolation environmentswhere an application must be protected or contained.

■ External Network This portion allows the virtual machine tobridge across the host’s network interface card (NIC) to accessresources on the external network like any other physical server.

52 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 52

Page 78: Virtualization With Microsoft Virtual Server 2005 (2006)

After all your choices are entered, click the Create button at the bottomof the page.This will create your new virtual machine. Figure 3.3 shows thestatus page.

Figure 3.3 Virtual Machine Status Page

The virtual machine status page lists all the different pieces of virtualhardware and the status of the virtual machine.You will notice that the servericon in the upper area of the screen is grayed out.This means the virtualserver is turned off.You will also notice that each of the pieces of virtualhardware is also a link to a property page for that piece of virtual hardware.

Virtual Machine ConfigurationAll the details of the virtual hardware are listed on the status page, as seen inFigure 3.3. Each configurable area is accessible from this page. In this section

Virtual Machines • Chapter 3 53

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 53

Page 79: Virtualization With Microsoft Virtual Server 2005 (2006)

we will look at the different options that are available to us for the virtualmachine.

General PropertiesThe name of the virtual machine and a description of its behavior on VirtualServer 2005 startup or shutdown are contained in this section. Click theGeneral properties link.The Properties page will come up for the virtualmachine, as shown in Figure 3.4.

Figure 3.4 General Properties

You can change the name of the virtual machine by entering it into theVirtual machine name box.This will not change the node name set in theoperating system.This only changes the filename of the virtual machine con-figuration file.The configuration file is a .vmc file.The folder containing thevirtual machine’s configuration file is the same name. If you change the nameof the virtual server, the configuration filename will change but not the foldercontaining it.

54 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 54

Page 80: Virtualization With Microsoft Virtual Server 2005 (2006)

When the Run virtual machine under the following user accountcheckbox is checked, it enables the virtual machine to run under a specificuser account.A user account must be specified in order for the virtualmachine to start up automatically or run scripts based on Virtual Serverevents.After this box is checked and a user account with sufficient privilegesis specified, the pull-down box Action when Virtual Server starts will becomeactive.The options in the pull-down box enable you to:

■ Automatically turn on virtual machine if it was runningwhen Virtual Server stopped Will restart the virtual machine if itwas running when the Virtual Server was stopped or shut down. Ifthe virtual machine was turned off when the Virtual Server was shutdown, it will not be restarted when the Virtual Server starts up again.

■ Always automatically turn on virtual machine Will start upthe virtual machine when the Virtual Server is restarted.This can bea very handy setting if there are several virtual machines on a VirtualServer computer.

■ Never automatically turn on virtual machine Will prevent thevirtual machines from starting regardless of their previous state whenthe Virtual Server was stopped.

The Seconds to delay automatically turning on a virtual machine box willdelay the virtual machine startup by the specified number of seconds. If thereare several virtual machines on a Virtual Server, this setting will enable you tostagger their startup order.An example of this use would be to start thedomain controllers before the file servers.The amount of time to specifydepends on your hardware.A common setting is 30 to 60 seconds.The max-imum amount of time you can specify is 86,400 seconds, or 24 hours.

The Action when Virtual Server stops drop-down box controls how thevirtual machines react when the Virtual Server is shut down.This box pre-sents you with three options:

■ Save state Will store the current state of the virtual machine.Thevirtual machine’s memory and running processes are all maintainedwith this selection. When the Virtual Server is restarted, the virtual

Virtual Machines • Chapter 3 55

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 55

Page 81: Virtualization With Microsoft Virtual Server 2005 (2006)

machine will return to the same state it was in when the VirtualServer was shut down.

■ Turn off virtual machine This option is the same as pushing thepower button on a physical server. When the Virtual Server is shutdown, the virtual machine is powered off.This is different from shut-ting down the virtual machines. Powering off a virtual machine couldcorrupt any open files and lose any unsaved data.

■ Shut down guest OS This option forces a controlled shutdown ofthe virtual machine.This option will close all open files and save datato the virtual hard disk.

The Notes section is a good place for any additional documentation forthe virtual machine.This section is a good spot for listing the operatingsystem service packs, network configuration, contact information, or just agood description of the function of this virtual machine.

The final section on this page is the Files Associated with section.Thissection includes the location information for the configuration file, the virtualhard disk, and the attached virtual network.

The Virtual Machine Configuration FileEach virtual machine has a configuration file associated with it.This file con-tains all the different setting and a list of the associated virtual hard disks andvirtual networks.This file can be read with Notepad and is written in htmlformat.This file can be directly edited with either a script or any text editor.Figure 3.5 shows some of what is contained in this file.

Looking at the memory section on line numbers 24 through 27 in Figure3.5, you can see the configured RAM size is currently 256 MB. By editingthis number, you can add or reduce the amount of configured RAM this vir-tual machine will allocate when it is started.You can also look to see whichvirtual networks are connected by looking at line numbers 34 – 39.The vir-tual network ID is the hex number (line 36) associated to the virtual networkname (lines 37 and 38). Do not edit these values unless you have the correctinformation for the new virtual network.

56 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 56

Page 82: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.5 Virtual Machine Configuration File

The most common reason to edit this file besides reallocating memory isto set the location of the virtual hard disk. Line numbers 50 – 54 give theabsolute and relative path for the virtual hard disk. If this virtual machine ismoved from the original location where it was created, these lines may needto be edited. Notice the bolded text in these lines because they give the abso-lute path and filenames associated with the virtual machine.This path must beable to be found on the new Virtual Server when the virtual machine startsup or it will fail to start.This is also why it is recommended to use descriptivenames when creating virtual hard disks and virtual machines.

Virtual Machines • Chapter 3 57

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 57

Page 83: Virtualization With Microsoft Virtual Server 2005 (2006)

Virtual Machine AdditionsVirtual Machine Additions provides additional features for Windows-basedguest operating systems (see Figure 3.6).These enhancements include timesynchronization between guest and host operating systems, mouse integrationwhen using the ActiveX control in Virtual Machine Remote Control(VMRC), and a heartbeat for the guest operating system to monitor the vir-tual machine. It also does some kernel-level patching to let the virtual servercomponent run on Ring 0.

Figure 3.6 Virtual Machine Additions Property Page

To install Virtual Machine Additions, the target virtual machine must berunning with a Windows operating system.The supported Windows serveroperating systems are:

■ Microsoft Windows Server 2003 (all 32-bit versions only)

■ Microsoft Windows 2000 Server

■ Microsoft Windows NT Server 4.0 with Service Pack 6a (SP6a)

58 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 58

Page 84: Virtualization With Microsoft Virtual Server 2005 (2006)

Although desktop operating systems are supported on Virtual Server2005 R2, they are not intended as a replacement for Terminal Services.Configuring a virtual machine with a desktop operating system is primarilyintended for testing and configuration development.There are VirtualMachine Additions provided for the following Windows desktop operatingsystems:

■ Microsoft Windows XP (all 32-bit versions only)

■ Microsoft Windows 2000 Professional

■ Microsoft Windows Millennium Edition

■ Microsoft Windows 98

■ Microsoft Windows 95

If the aforementioned operating systems are configured to autorun whena CD is inserted, just start the virtual machine and check the Install VirtualMachine Additions checkbox.This will automatically mount and run theVirtual Machine Additions .iso file. If it is necessary to manually install thetools, configure the virtual CD/DVD to use an ISO image file.The VirtualMachine Additions .iso file is located in C:\Program Files\Microsoft VirtualServer\Virtual Machine Additions\VMadditions.iso.After the ISO image ismounted, click Start | Run and type d:\Windows\VirtualMachineAdditions.msi -s –v “/qn Reboot=ReallySuppress” into the dialog boxand press Enter.You will need to restart the virtual machine when the instal-lation is finished.You can dismount the VMadditions.iso file from the virtualCD /DVD before restarting the virtual machine.

Checking the Host time synchronization box will synchronize the clockof the virtual machine operating system with the clock of the host computeroperating system.You can disable the clock synchronization, by leaving thisbox unchecked or powering off the virtual machine and unchecking this box.If the guest operating system is configured as a domain controller, the hosttime synchronization should be disabled. If the guest and the host are in dif-ferent domains or different time zones, then time synchronization should alsobe turned off.

Virtual Machines • Chapter 3 59

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 59

Page 85: Virtualization With Microsoft Virtual Server 2005 (2006)

Memory PropertiesIt is easy to adjust the amount of memory assigned to a virtual machine.From the virtual machine Status page, select the Memory link.TheMemory Properties page appears, as shown in Figure 3.7.

Figure 3.7 Memory Properties Page

To adjust the amount of memory assigned to a virtual machine, it must beturned off just like a physical machine.Then enter the amount of memory toassign in the Virtual machine memory (in MB) box. Each virtualmachine must have at least 4 MB of memory assigned but can have up to 3.6GB.The limitation is tied to amount of memory installed in the host serverand the amount of memory the host operating system can support. Click OKwhen you have assigned the memory.

It is important to remember that all virtual machines running on theVirtual Server must share the available memory resources.You cannot assignmore memory than what is available for all running virtual machines and thehost operating system.You will not be able to start a virtual machine that doesnot have enough physical memory to allocate to the virtual machine.

60 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 60

Page 86: Virtualization With Microsoft Virtual Server 2005 (2006)

Hard DisksClicking the Hard Disks link form the virtual machine Status page will list allthe attached virtual hard disks associated with this virtual machine. From thispage you can add, modify, or remove hard disks associated with this virtualmachine. Figure 3.8 shows all the various options.

Figure 3.8 Virtual Hard Disk Properties

Each virtual machine needs to have a virtual hard disk associated with it.There can be one or more virtual hard disks associated with each virtualmachine. Each virtual machine can support either IDE- or SCSI-connectedvirtual hard disks.To attach a virtual hard disk, the virtual machine must bepowered off. Just like a physical server, you cannot connect virtual disk drivesto a running virtual machine.

Looking at Figure 3.8 you will notice the available options:

■ Enable undo disk This checkbox enables you to create an undodisk.There is more on this feature later, but in short it enables you toload programs and data without writing the changes to the originaldisk.To enable the undo feature, just check the box for the selected

Virtual Machines • Chapter 3 61

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 61

Page 87: Virtualization With Microsoft Virtual Server 2005 (2006)

virtual hard disk.To use the undo feature you should make sure thereis sufficient storage on the host hard drives to store all the changes.

■ Remove This checkbox is fairly self explanatory. It will remove theselected virtual hard disk for the virtual machine. Simply check theRemove box for the desired virtual hard disk and then click OK.The virtual hard disk will be removed from the virtual machine.Thevirtual hard disk is not deleted, just removed from this virtualmachine.

■ Attachment This pull-down box tells where the virtual hard diskwill be connected to the virtual machine.There are two IDE inter-faces with two connections, primary and slave, each.There is oneSCSI bus with six available device IDs.The virtual SCSI bus nor-mally uses ID 7 for itself.The maximum virtual hard disk size thatcan be used depends on whether it is attached to the virtual IDE orSCSI adapter.The IDE adapter supports virtual hard disks of up to127 GB, and the SCSI adapter supports virtual hard disks of up to 2terabytes (TB). Simply select the desired attachment point and clickOK.

■ Known virtual hard disks You can select one of the previouslyregistered virtual hard disks form the pull-down box and click OK toconnect it to the virtual machine.

■ Fully qualified path to file If your desired virtual hard disk is not“known,” just type the full path to the .vhd file in this box.This canbe a UNC file path, but the resource must be online and availablewhen the virtual machine starts up. Click OK when finished.

■ Add Disk This button enables you to attach another virtual harddisk to the virtual machine.You will be asked for attachment and vir-tual hard disk location information.You can attach several virtual harddisks to a virtual machine.

After all your virtual hard disks are connected and configured, click OKto write the configuration information into the virtual machine configurationfile, .vmc.

62 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 62

Page 88: Virtualization With Microsoft Virtual Server 2005 (2006)

CD/DVDYou can use the virtual CD or DVD drive to access physical media orInternational Organization for Standardization (ISO) 9660 images.This is avery important feature that will enable you to maintain a collection of .ISOfiles for the various operating system and program files in a central file shareand mount these as needed without physically loading a CD or DVD in aphysical drive. It also allows for several virtual machines to be loading softwarefrom different files at the same time without having to constantly change aCD or DVD.You change the Capture setting as appropriate to specify eitherthe CD or DVD drive of the physical computer or an ISO image (see Figure3.9). ISO images can be a maximum file size of 2.2 GB.

Figure 3.9 CD/DVD Drive Properties

There are several options for the virtual CD/DVD.Checking the Remove box will remove the virtual CD/DVD from the

virtual machine configuration.All the virtual CD/DVD drives are IDE devices. If you click the down

arrow in the Attachment pull-down box, you will see only IDE devices.

Virtual Machines • Chapter 3 63

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 63

Page 89: Virtualization With Microsoft Virtual Server 2005 (2006)

Available choices will be listed. Because of this restriction you can have onlyfour CD/DVD devices on a virtual machine.

The Capture section tells the virtual machine where the virtual CD/DVDwill look for its data files.You can modify the capture properties of the virtualCD/DVD drive while the virtual machine is running.After making yourselections, click OK.Your choices are:

■ No media This is the best selection if the virtual machine is notusing the CD/DVD drive. If No media is selected, the virtualmachine does not try to read the drive, so it will increase perfor-mance by not continually checking an empty drive.This setting willalso prevent starting an installation if the autorun feature is enabledon the virtual machine and a disk is inserted into the physicalCD/DVD.

■ Physical CD/DVD drive This selection enables the virtualmachine to read the physical CD/DVD drive.The drive letter pull-down box will list the drive letters of the physical CD/DVD driveson the host server.

■ Known image files This is the selection to use if you want tomount an ISO image file. Click the down arrow on the Knownimage files pull-down box and select the desired image file. If thedesired file is not listed, you can enter the fully qualified path intothe textbox.This can be a UNC name but the resource must beavailable to the virtual server.

The Add CD/DVD Drive button enables you to add another virtualCD/DVD drive to the virtual machine.You will have the same options forthe additional devices as you have with the initial device. Remember thatbecause you can only use the virtual IDE adapter you are limited to fourdevices.

SCSI AdaptersSCSI adapters are added to virtual machines to provide additional storage orto cluster virtual machines.As many as four SCSI adapters can be configuredon a virtual machine. Each virtual SCSI adapter will support up to seven vir-tual hard disks. Each virtual hard disk can be of up to 2 TB in size.

64 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 64

Page 90: Virtualization With Microsoft Virtual Server 2005 (2006)

Enabling a SCSI adapter will also enable the clustering of two virtualmachines.You can use server clusters to either test failover between two vir-tual machines or for training purposes.You cannot, however, use server clusterswith Virtual Server to fail over between physical computers. Clustering is typ-ically used with Virtual Server in a test or training environment and is notintended as a high-availability solution in a production environment.

If you require high availability and want to use Virtual Server, you shouldconsider storing your virtual machines on a SAN and connect additionalVirtual Server computers to the SAN.This will enable the rapid recovery ofthe virtual machine on a different physical computer.

Figure 3.10 shows the SCSI Adapter Properties page.

Figure 3.10 SCSI Adapter Properties

There are only a few options to configure. Clicking OK will apply thesetting and update the configuration file for the virtual machine.The optionsinclude:

Virtual Machines • Chapter 3 65

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 65

Page 91: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Remove Checking this box and clicking OK will remove theadapter for the virtual machine.

■ Share SCSI bus for clustering Checking this box will enableclustering between virtual machines on the same Virtual Server com-puter. Remember that clustering of virtual machines is only for highavailability of the virtual machines.These virtual machines are stilldependent on the Virtual Server computer and its resources. Useclustered virtual machines only for training or testing of applicationsin a clustered environment.

■ SCSI adapter ID This pull-down box enables you to set the SCSIdevice ID for the virtual adapter.This is defaulted to ID 7 but somedevices will try to reserve a specific SCSI ID.This setting enables youto change the adapter address as needed.This may also be desirablewhen setting up a virtual server for clustering. By setting the SCSIadapter ID to something other than ID 7, it will be easy to identifythis adapter as the clustered adapter.

■ Add SCSI adapter Clicking this button adds another virtual SCSIadapter to the virtual machine.You can have up to four virtual SCSIadapters per virtual machine. Each adapter can support up to sevendevices with a maximum size of 2 TB.That is 56 TB per virtualmachine!

Network AdaptersFrom the Network Adapters property page you can add or remove a virtualnetwork adapter or modify the properties of an existing one. Each virtualmachine can be configured with up to four virtual network adapters. Figure3.11 shows the Network Adapter Property page.

This page has a few options. Clicking OK will apply the changes andupdate the virtual machine configuration file.These options are Remove,Connected to, and Ethernet MAC address.

66 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 66

Page 92: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.11 Network Adapter Properties

Checking the Remove box will remove the selected virtual networkadapter from the virtual machine.

The Connected to pull-down box offers different options for connectingthe virtual machine. When a virtual machine is created, it has one virtual net-work adapter connected to the internal network.You can configure each net-work adapter to one of the following connections:

■ Internal Connects the virtual machine to a virtual network that isavailable only to other virtual machines on the same Virtual Servercomputer.This type of network is isolated from the external networkof the physical computer.

■ External Connects the virtual machine to the external networkthrough the network adapter of the physical computer.The virtualmachine is visible to all other networked computers in your environment.

Virtual Machines • Chapter 3 67

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 67

Page 93: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Microsoft Loopback Adapter Connects the virtual machine to avirtual network that provides networking between the guest oper-ating system and host operating system.This enables a method ofconnecting files and transferring data between the Virtual Servercomputer’s disks and the virtual machine.

■ Ethernet MAC address This setting is the virtual networkadapter’s Media Access Control (MAC) address.This is the hardwareaddress of the adapter and must be unique for every device on thenetwork.There are two settings for this property: Dynamic and Static.In the Dynamic setting the MAC address will be assigned dynami-cally by the Virtual Server when the virtual machine is created.Thisis the default and for almost all configurations there is no reason tochange it. With the Static setting you must supply the MAC address.This setting may be required to gain access to network resources thatutilize MAC filtering. If you migrated a physical server to a virtualenvironment it may be necessary to set this MAC address. Just makesure the physical network adapter from the old computer is notreused on your network or a conflict will exist.

Use the Add Network Adapter button to add a virtual network adapter toyour virtual machine.You will be presented with the same options for con-nection and configuration as before.You can have up to four virtual networkadapters per virtual machine.

ScriptsIf you have the virtual machine configured to start up under a specific user-name, scripts can be assigned.You can specify a script or a command-lineaction to run when a particular event occurs.You can also remove a scriptthat was specified previously. Virtual Server executes command-line parame-ters or scripts that you specify for a virtual machine event. Figure 3.12 showsthe Scripts Properties page.

68 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 68

Page 94: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.12 Scripts Properties Page

To run a script, the following syntax is used: script_engine script_name.Youcan run a script named Exchange_Start.vbs by using Cscript as follows:cscript Exchange_Start.vbs

If Virtual Server cannot execute a command, it is recorded in the VirtualServer event log. If the script is executed but results in an error, the error isnot recorded in the Virtual Server event log because it only validates that thecommand line was executed.

Before you can run a script on a virtual machine, you must enablescripting for virtual machines and you must configure a user account for thevirtual machine to run under.This user account must have adequate privilegesto execute the assigned scripts.There are several types of events that can beused to trigger virtual machine scripts (see Table 3.1).

Virtual Machines • Chapter 3 69

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 69

Page 95: Virtualization With Microsoft Virtual Server 2005 (2006)

Table 3.1 Events That Trigger Virtual Machine Scripts

Event Description

This virtual machine is turned on. This virtual machine is turned on.

This virtual machine is restored. This virtual machine is restored from asaved state.

This virtual machine is saved State is saved for this virtual machine. and turned off.

This virtual machine is turned off. This virtual machine is turned offwithout its state being saved.

This virtual machine is turned This virtual machine is turned off off within the guest environment. because a user shut down the guest

operating system.

This virtual machine is reset This virtual machine is reset.

No heartbeat is detected for A heartbeat for a virtual machine has this virtual machine. not been received for three minutes, as

follows: One heartbeat per minute isexpected. When no heartbeat isdetected for more than a minute,Virtual Server prompts the guest oper-ating system for a heartbeat every 10seconds for two minutes. If no heart-beat is detected at the end of two min-utes, this event is generated.

This virtual machine experiences Virtual Server receives an error from a guest processor error. this virtual machine’s processor.

This virtual machine receives a Virtual Server has received a warning warning due to low disk space about low physical disk space for the on the physical computer. virtual hard disk attached to this virtual

machine. This warning is generatedwhen available disk space is at or below100 MB.

This virtual machine receives an Virtual Server has received an error error due to low disk space on about low physical disk space for the the physical computer. virtual hard disk attached to this virtual

machine. This error means that there isno longer any available disk space. Thevirtual machine pauses until more diskspace is available.

70 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 70

Page 96: Virtualization With Microsoft Virtual Server 2005 (2006)

Floppy Disk DriveEvery virtual machine has a single floppy disk drive.This drive cannot beremoved and you cannot add floppy disk drives to the virtual machine.Youcan, like with the virtual CD/DVD, use either the host computer’s physicalfloppy disk drive or an image file for the virtual floppy disk drive. Figure 3.13shows the properties of the virtual floppy disk drive.

Figure 3.13 Floppy Drive Properties

There are only three choices for the Capture property (After making yourselection you must click OK to apply):

■ No media This choice effectively turns off the virtual floppy diskdrive.This can be used to improve performance of the virtualmachine by telling it to not check the virtual floppy disk to see ifthere is media in the drive.This is also the best setting for normaloperation of the virtual machine.

Virtual Machines • Chapter 3 71

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 71

Page 97: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Physical floppy disk drive This selection captures the host com-puter’s floppy disk drive.The pull-down box lists the drive letters ofthe floppy disk drives on the host computer.This setting should beused when transferring data or starting a program that is on a floppydisk.You should not leave this setting active after you are finishedwith the floppy disk operation.All virtual machines that capture thehost floppy disk drive will see the inserted floppy disk and can access it.

■ Known floppy disk The pull-down box will list the known virtualfloppy disk files.These are the .vfd files that are created whenbuilding virtual floppy disk files.You can select one of these or enterthe fully qualified path to another virtual floppy disk file into thefully qualified path to file box.You can use UNC file paths for this,but the resource must be accessible to the virtual machine.

You may notice there is no button to add floppy disk drives. Each virtualmachine can have only one virtual floppy disk drive.

COM PortsThe COM Port Properties page for the virtual machine configures the COMport properties.A virtual machine can use COM ports for communicationsbetween the virtual machine and a device or file. Each virtual machine canconfigure one or two COM ports. Figure 3.14 shows the Com PortProperties page.

Both COM ports have the same set of properties.The Attachment options are:

■ None The virtual COM port is not connected.This is the defaultsetting and should be the normal configuration unless the virtualmachine is actually using the COM port.

■ Physical computer serial port Will connect the virtual COMport to the host computer serial ports.The pull-down box will listthe configured serial ports on the host computer.There is an addi-tional checkbox to force the COM port to “Wait for a modem com-mand to open port.”The virtual machine can only reference COMports 1 through 4 on the host computer.

72 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 72

Page 98: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.14 COM Port Properties

■ Text file Will write the COM port output to a text file.The textfile location is specified by the fully qualified path in the dialog box.When you are typing paths to folders or files, local file paths refer-ence the computer running the Virtual Server service.You must use aUNC path if the file or folder referenced is on a computer otherthan the one running the Virtual Server service.

■ Named Pipe To use this option you must type the local namedpipe to use in the textbox.

LPT PortsThe LPT Port Properties page of the virtual machine enables or disables theparallel port (LPT port). If a parallel device is connected to the physical com-puter, and you want to make the device accessible to the virtual machine, usethis page to specify the port on the physical computer to which the device isattached. Figure 3.15 shows the LPT Port Properties page.

Virtual Machines • Chapter 3 73

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 73

Page 99: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.15 LPT Port Properties

There are only two options on this page to be configured. Clicking OKapplies the selection to the virtual machine configuration file.

■ None Turns off the virtual LPT port.This is the default for the vir-tual machines.

■ LPT1 (378h-37Fh) This is the physical LPT port on the host com-puter. If there is more than one LPT port on the physical computer,then there will be multiple choices for an LPT port. It may be neces-sary for the virtual machine to read the LPT port of the host com-puter. Direct access to a scanner or a software dongle may benecessary for a virtual machine. Printing is more easily accomplishedby using the virtual network and printing to a shared printer.

74 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 74

Page 100: Virtualization With Microsoft Virtual Server 2005 (2006)

Adding Hardware to the ServerAdding hardware to your virtual machines is accomplished by modifying theproperties of the virtual server. From the Virtual Server Status page as seen inFigure 3.3, you can modify the amount of memory, virtual hard disk, virtualCD/DVD, virtual SCSI adapters, and virtual network adapters. Using thesevirtual hardware devices it is possible to build very large and advanced virtualmachines, but the host computer must have access to the physical resources tosupport these virtual devices.

Adding hardware resources to the physical computer running the VirtualServer service normally requires shutting down the host computer, therebymaking the all the virtual machines also shut down.This is best performedduring a scheduled down time for a production host computer.The physicalcomputer must have available expansion slots and be capable of supporting allthe physical resources required by the virtual machines. If the host computercannot access and manage a physical device, then the virtual machines cannotaccess the device either.

Building the Host ServerWe have already covered how to add hardware to our virtual machines, butnot how we can maximize the hardware resources of the host computer.Thisis an important section because the virtual machines cannot take advantage ofany resource that the host computer cannot utilize.There are also some limi-tations of the virtual machines not being able to take advantage of all the pos-sible resources a physical computer could utilize.

ProcessorsAll virtual machines are single-processor computers.That does not mean thehost computer is restrained to a single processor. If the host computer oper-ating system can utilize multiple processors, then an overall performanceincrease can be gained in the virtual machines because there are more phys-ical processors to be shared among the virtual machines.This also means alarger number of physical processors can support more virtual machines thana single processor host computer.

Virtual Machines • Chapter 3 75

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 75

Page 101: Virtualization With Microsoft Virtual Server 2005 (2006)

MemoryAlthough having a large amount of memory in a host computer makes sup-porting multiple virtual machines possible, there is a limitation on the hostcomputer’s supported memory amount. If you are planning to use more than4 GB of RAM in the host computer, you should consider running theEnterprise or Data Center edition of Windows Server. Even if you are plan-ning to allocate the bulk of the system memory to the virtual machines, thehost operating system must be able to manage all the memory on the hostcomputer. If your host computer hardware can support the x64 version of thehost operating system, you can support more memory by using the x64 ver-sion of the host operating system.

Storage SystemsThe virtual machines are actually large files on the host computer.That meansthe disk subsystem has to be able to accommodate these files and be able toread and write to them at high speed.The type of disk storage subsystem istransparent to virtual machines.There is no need to support Redundant Arrayof Inexpensive Disks (RAID) controllers or SAN host bus adapters (HBA) ina virtual machine.They will use the available storage of the assigned virtualdisk drives. Where these virtual disk drives physically reside is important onlyif the host computer cannot access them.

This means that a SAN HBA placed into a host computer can be sharedby all the virtual machines to access the SAN storage available to the hostcomputer.This also means the virtual machines (remember these are just largefiles) can be physically located on the SAN storage.This gives you the capa-bility to run these virtual machines from any of the connected host com-puters running Virtual Server 2005 R2.This is a very powerfuldisaster-recovery benefit. It also enables the complete change out or failure ofa host computer.

A larger RAID array or SAN storage can be utilized to maintain ISOimages of software and operating systems and different virtual floppy diskdrive images (.vfd) so they can be mounted to the virtual machine withoutthe need to actually load a CDROM or floppy disk.This capability enablesa lights out environment and gives the administrator the ability to manage

76 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 76

Page 102: Virtualization With Microsoft Virtual Server 2005 (2006)

the virtual machines from anywhere they can access the Virtual MachineWeb page.

Network CardsThe host computer can support multiple network interface cards (NIC) toconnect it to one or more local area networks (LAN). Each virtual machinecan be assigned a virtual network connection running on a specific physicalNIC in the host server.

This capability enables better control of the network load distribution to asingle LAN or enables connection of the virtual machines to separate LANsegments while running on the same physical host. If all the virtual machinesare going to connect to the same LAN, the additional NIC cards can beteamed to provide additional bandwidth to the physical host computer andadditional network performance for the virtual machines.Additional informa-tion on virtual networks is contained in later chapters.

COM an LPT PortsAlthough each virtual machine can access these, they are not commonly used.The virtual machines are limited in the number of attached devices for thesehost computer resources. In practice, most servers do not have anythingattached to these ports and in many cases servers do not even have these portsanymore.

Some software packages require a COM or LPT port for reading adongle.This dongle is attached to a COM or LPT port on a computer. Inthese instances it is necessary to configure the virtual machine’s virtual COMor LPT port to read the host computer’s COM or LPT port.

USB PortsAlthough the virtual machines do not have Universal Serial Bus (USB) ports,the host computer can take advantage of these.Attaching disk drives ormemory sticks to a host computer’s USB ports will enable the host to sharethe connected disk resources with the virtual machines.This is the only way avirtual machine can access a USB device.The virtual machines must be pow-ered off or restarted when the USB device is connected to the host in orderto be seen and utilized by the virtual machine. But the machine has to be

Virtual Machines • Chapter 3 77

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 77

Page 103: Virtualization With Microsoft Virtual Server 2005 (2006)

turned down when the USB device is inserted. Failure to do so will leave amessage that the server cannot find the disk.

Installing a Windows OSNow that you have your virtual machine built and configured, you must loadan operating system before you can use it.The Virtual Server R2 supports allbut the Data Center version of Windows Server 2003 (32-bit versions only),Windows 2000 Server Standard and Advanced, Windows NT 4.0 SP6a, andWindows XP SP2 (32-bit versions only).

All these operating systems can be loaded in separate virtual machinesrunning on the same host computer.This capability does not mean thatMicrosoft will support an operating system or other software that has reachedits end of life. If you are going to run one of these older operating systems,you should understand the support limitations.

Each virtual machine emulates a specific set of virtual hardware that issupported directly by the supported Microsoft operating systems so thereshould be no difficulty with drivers or other virtual hardware.Table 3.2includes a specific list of virtual hardware.

Table 3.2 Virtual Hardware

Component Emulated Hardware

Basic input/output American Megatrends (AMI) BIOS using system (BIOS) the Intel 440BX chip set with PIIX4.

Floppy disk drive Supports a single 1.44MB floppy disk drive.

Serial (COM) port Emulates up to two serial ports.

Printer (LPT) port Emulates a single printer port that maps tothe physical parallel port.

Mouse Emulates a standard PS/2 MicrosoftIntelliMouse® pointing device.

Keyboard Emulates a standard PS/2 101-key Microsoftkeyboard.

Network Adapter Emulates the multi-port DEC / Intel 21140 (multifunction) 10/100TX 100MB Ethernet network adapter

with one to four network connections.

78 Chapter 3 • Virtual Machines

Continued

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 78

Page 104: Virtualization With Microsoft Virtual Server 2005 (2006)

Table 3.2 continued Virtual Hardware

Component Emulated Hardware

Processor Virtual machines use the CPU of the physicalcomputer. Guest operating systems see onlya single CPU.

Memory Supports 3.6 GB of RAM per virtual machine.

Video card Emulates the S3 Trio64 graphics adapter with4 MB of VRAM.

IDE/ATAPI storage Emulates up to four IDE devices up to 127MB per IDE channel.

SCSI storage Emulates the Adaptec 7870 SCSI adapterchip set. Up to four SCSI adapters on a vir-tual machine with support for up to sevenvirtual hard disks of up to 2 TB each.

Loading the Operating SystemTo load a supported Windows operating system from the Virtual Server R2Administration Web page, select the virtual machine you want to load. Clickthe right arrow next to the server name and select Edit Configuration(see Figure 3.16).

Figure 3.16 Virtual Server Administration Web Page

Virtual Machines • Chapter 3 79

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 79

Page 105: Virtualization With Microsoft Virtual Server 2005 (2006)

Select the CD/DVD section of the virtual machine Status page (seeFigure 3.17).

Figure 3.17 Selecting the CD/DVD Section of the Virtual Machine StatusPage

On the CD/DVD Properties page, select the source for the operatingsystem files (see Figure 3.18).

By default, the virtual machine is set to boot from the CD/DVD drive.

■ If you are using the host computer’s CD/DVD drive, select thePhysical CD/DVD drive option and the drive letter for theselected CD/DVD drive on the host computer. Insert the CD mediainto the drive.

■ If you are using an image file, select the Known image file optionand select the path from the pull-down box or enter the fully quali-fied path for the image file in the dialog box.You can use a UNCpath for the image file but it must be accessible to the virtualmachine.

80 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 80

Page 106: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.18 Selecting the Source for the OS

Click OK when finished.

Booting from the Virtual Floppy Disk DriveMost operating systems today use a bootable CD to start the build process,but Virtual Server 2005 R2 does support booting from the virtual floppy diskdrive. If you are trying to load an operating system that uses a boot floppydisk, you will need to configure the virtual floppy disk drive.

From the virtual machine Status page, select the floppy disk drive link asseen in Figure 3.19.

Select Physical floppy drive from the Capture section, as shown inFigure 3.20, or select a virtual floppy disk file in the Known floppy diskpull-down list.You can also enter the fully qualified path in the textbox forthe .vfd file.

Virtual Machines • Chapter 3 81

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 81

Page 107: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.19 Selecting the Floppy Disk Drive Link

Figure 3.20 Floppy Drive Properties

Click OK when finished.

82 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 82

Page 108: Virtualization With Microsoft Virtual Server 2005 (2006)

Starting the Virtual MachineNow that you have your boot media all set up, you are ready to start the vir-tual machine. Simply go to the Virtual Server Administration Web page, asseen in Figure 3.21.

Figure 3.21 Starting the Virtual Machine

Select the virtual machine you want to start, click the right arrow, andthen select Turn On.

You will notice the picture for your virtual machine will change as itpowers up. Click this thumbnail image to start the remote manager (seeFigure 3.22).

After the remote manager starts, you will see a screen similar to a normalvideo monitor showing the text portion of the Windows operating systemload, as shown in Figure 3.23.

Virtual Machines • Chapter 3 83

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 83

Page 109: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.22 Virtual Machine Status Page

Figure 3.23 Remote Control Screen

84 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 84

Page 110: Virtualization With Microsoft Virtual Server 2005 (2006)

You will notice in the lower-left corner of this screen that there are sev-eral controls and instructions to work with the remote console.They arehighlighted in a red box to help you identify them.This section is dividedinto two sections: Navigation and Control Virtual Machine.

You will notice that to pass mouse and keyboard control to the virtualmachine, you need to click the remote console screen.To regain control ofthe keyboard and mouse, you need to press the Right Alt key on the key-board.

Configuring & Implementing…

Using SCSI in a Microsoft Windows OSThis is the right time to tell the operating system about the SCSI devicethat can exist in the machine.

Directly after the start, the following text appears: “Press F6 to con-figure add.…” During this message press F6. This will enable you to loadthe Virtual Server SCSI Shunt driver. If you do not load this driver and yourhard disks are based on SCSI, the installation can take anywhere betweenone to eight hours.

So remember: whenever possible use SCSI as hard disk controller andwhen you use SCSI, load the Virtual Machine SCSI driver to speed up theinstallation and performance of the VM.

Using a SCSI Adapter and disk for the virtual machine is the preferredchoice for a virtual machine. It enables a larger drive size and can supportmore virtual hard drives. Although it is possible to load some of the laterWindows Server operating systems without loading the SCSI Shunt driver,the setup and formatting of these drives can take a significant amount oftime. It is best to use the virtual SCSI Shunt driver found in the VirtualMachine Additions as a virtual floppy disk (.vfd) file. There are drivers forWindows Server 2003, Windows 2000, and Windows XP only.

To use this virtual SCSI Shunt diver:

1. Start your operating system build as normal.

2. When you get to the text portion asking you if you want toadd additional hardware (“Press F6 to add…”), press F6.

Virtual Machines • Chapter 3 85

Continued

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 85

Page 111: Virtualization With Microsoft Virtual Server 2005 (2006)

3. In the Virtual Machine Configuration Web page, select theFloppy Drive.

4. Select Known floppy disks in the Capture section. Enter thepath to the SCSI Shunt Driver.vfd file and click OK. This is bydefault C:\Program Files\Microsoft Virtual Server\VirtualMachine Additions\SCSI Shunt Driver.vfd.

5. On the virtual machine console page, type S and press Enter.

6. Select the driver for the guest operating system you areloading and press Enter.

7. Continue the rest of the operating system load as normal.

Using this virtual SCSI adapter will greatly speed up the performanceof the operating system load and the overall performance of the virtualmachine.

If you want to load a virtual machine with Windows NT 4.0, you willneed to switch the virtual hard disk to an IDE drive in the virtual machineconfiguration page. After the operating system is loaded you can load theVirtual Machine Additions and switch the virtual hard disk back to theSCSI adapter.

NavigationThere are two options under the Navigation section. Clicking these naviga-tion options will not stop the virtual machine.

■ Master Status Takes you back to the main Virtual ServerAdministration page.

■ Configure “Virtual Machine Name” Takes you to the selectedvirtual machine configuration page.

Control the Virtual MachineThese options are control functions for the virtual machine. Clicking onethese will affect the operation of the virtual server.

■ Pause Will temporarily halt a running virtual machine without dis-carding memory.

■ Resume will restart the paused virtual machine.

86 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 86

Page 112: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Save State Saves the current state of the virtual machine and stopsthe virtual machine from running.A temporary file is created in thesame location as the virtual machine configuration files with a .vsvextension. When the virtual machine is restored from a saved state, itreturns to the condition it was in when its state was saved.

■ Turn Off Turns off the virtual machine without saving any stateinformation.This has the same effect as pressing the power button ona physical computer.

■ Reset Resets the virtual machine.This is the same as pressing thereset button on a physical computer.

Installing the Operating SystemContinue to install the operating system as you would on a physical com-puter.You may notice that this is faster than most physical computers becausewe are taking advantage of the virtual disk systems.

As the text portion of the install is performed, you may notice thatWindows is using hardware that may not be installed in the host computer.Figure 3.24 shows this.

Figure 3.24 Formatting a Virtual Disk

Virtual Machines • Chapter 3 87

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 87

Page 113: Virtualization With Microsoft Virtual Server 2005 (2006)

Notice the aic78xx that is circled in Figure 3.24.This is the virtual SCSIbus controller. Continue installing the operating system as normal. When theend of the graphic portion finishes and the last reboot has been performed,your virtual machine is ready.

This might be the time you want to consider using a differential disk foradditional virtual machines running the same operating system.These enableyou to have a standard operating system build and apply any changes to it forthe individual virtual machines.You can also use sysprep or other cloningtools to create multiple copies of this virtual machine to be used as the basefor other virtual machines.

Figure 3.25 shows the finished Windows Server 2003 running in a virtualmachine.

Figure 3.25 Finished Windows Server 2003 Virtual Machine

To log on to the virtual machine, press the Host Key + Delete.TheHost key is the right ALT key on the keyboard.

88 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 88

Page 114: Virtualization With Microsoft Virtual Server 2005 (2006)

Installing Virtual Machine AdditionsThe Virtual Machine Additions are a set of features that improve integrationof the host computer and virtual machine operating systems, and the perfor-mance of the guest operating system. While these are not required for opera-tion of the virtual machines, it is recommended they be loaded.

To load the Virtual Machine Additions, start at the Status page for yourvirtual machine. Under Configuration, click Virtual Machine Additions,as shown in Figure 3.26.

Figure 3.26 Configuring Virtual Machine Additions

Select Install Virtual Machine Additions, as shown in Figure 3.27, andthen click OK.

Log on to the virtual machine with an administrative account.You can useeither the Administration Web site Remote Control or the Virtual MachineRemote Control client.

Virtual Machines • Chapter 3 89

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 89

Page 115: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.27 Install Virtual Machine Additions

When logged on, the Virtual Machine Additions installation wizard willstart. Click Next (see Figure 3.28).

Figure 3.28 Installing Virtual Machine Additions

90 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 90

Page 116: Virtualization With Microsoft Virtual Server 2005 (2006)

Click Finish (see Figure 3.29).

Figure 3.29 Completing the Setup of Virtual Machine Additions

After the wizard is complete, you will be prompted to restart the virtualmachine to complete the installation (see Figure 3.30).

Figure 3.30 Reboot Prompt

After reboot, you will notice that the keyboard and mouse control ispassed by simply locating the mouse over the virtual machine consolewindow.

Removing Virtual Machine AdditionsIt may be necessary to remove the Virtual Machine Additions. Removingthem is just like removing any other piece of software: Select Settings |Control Panel | Add or Remove Programs.

Virtual Machines • Chapter 3 91

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 91

Page 117: Virtualization With Microsoft Virtual Server 2005 (2006)

Select Virtual Machine Additions, and then click Remove. Click Yesif prompted to confirm removing the Virtual Machine Additions (see Figure 3.31).

Figure 3.31 Removing Virtual Machine Additions

You will need to restart the virtual machine after the Virtual MachineAdditions have been removed. Click Yes when prompted to restart the virtualmachine or click No to restart later.

Installing a Non-Windows OSVirtual Server 2005 R2 does support non-Microsoft operating systems.Although almost all Intel-based operating systems are supported, there aresome limitations.The most important is that the operating system must be nomore than 32 bit. While Virtual Server 2005 R2 can run on a 64-bitWindows platform, it will only support 32-bit guest operating systems.Themost common alternate operating system to Windows is a version of Linux.We will be demonstrating the compatibility with SuSE Linux 10, but almostall of the popular versions will work.Table 3.3 lists the supported versions asof the time of this book.You should check the Microsoft Support site for anyadditional supported versions.

92 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 92

Page 118: Virtualization With Microsoft Virtual Server 2005 (2006)

Table 3.3 Non-Microsoft Operating Systems Supported by Virtual Server2005 R2

Enterprise Distributions Standard Distributions

Red Hat Enterprise Linux 2.1 (update 6) Red Hat Linux 7.3

Red Hat Enterprise Linux 3 (update 6) Red Hat Linux 9.0

Red Hat Enterprise Linux 4 SuSE Linux 9.2

SuSE Linux Enterprise Server 9 SuSE Linux 9.3SuSE Linux 10.0

Remember that just because your version of Linux is not on this tabledoes not mean that it will not work.You will need to try it and see.

Creating the Virtual MachineYou still create the virtual machine just like with a Windows operatingsystem.The big difference is you may not need as much memory or addi-tional resources.

On the Virtual Server Administration Web page, in the VirtualMachines section, click Create. Figure 3.32 shows the virtual machine con-figuration page.

Figure 3.32 Create Virtual Machine Page

Virtual Machines • Chapter 3 93

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 93

Page 119: Virtualization With Microsoft Virtual Server 2005 (2006)

Give the new virtual machine a name and set the other properties asdescribed previously in this chapter. Notice that all the pertinent virtualdevices can be configured from this page. When you are finished entering thesize and location information, click Create to create the new virtual machine(see Figure 3.33).

Figure 3.33 New Virtual Machine Status Page

Verify the connection of the virtual CD/DVD or the virtual floppy diskdrive by clicking the link and selecting the connection state (see Figure 3.34).Click OK.

Insert the CD/DVD or boot media and power on the virtual machine.Asthe virtual machine starts it will begin the setup process. Figure 3.35 showsthe startup screen.

94 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 94

Page 120: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.34 CD/DVD Properties

Figure 3.35 SuSE Linux Install Screen

Virtual Machines • Chapter 3 95

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 95

Page 121: Virtualization With Microsoft Virtual Server 2005 (2006)

Just follow the prompts and answer the setup questions like you would ona normal installation on a physical computer.As the setup continues, theoperating system will find the virtual hardware and configure it for use.

After the installation is complete, you can log on and run the virtual machinejust like a physical computer installation. Figure 3.36 shows SuSE Linux 10 run-ning as a virtual machine on a Windows Virtual Server 2005 computer.

Figure 3.36 SuSE Linux 10 Desktop

Virtual Machine Additions for LinuxMicrosoft has released Virtual Machine Additions for Linux.You may have toregister, but they are free additions to your Virtual Server 2005 R2.You canget them at www.connect.microsoft.com/content/content.aspx?ContentID=1475&SiteID=154.

After you have downloaded them, you have to install them on the hostcomputer. Just double-click to install the file (see Figure 3.37).

Figure 3.37 VMAdditions for Linux

96 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 96

Page 122: Virtualization With Microsoft Virtual Server 2005 (2006)

Click Next (see Figure 3.38).Accept the license agreement and click Next (see Figure 3.39).

Figure 3.38 Installation Startup

Figure 3.39 License Agreement

Select the Destination Folder for the software installation and clickNext (see Figure 3.40).

Virtual Machines • Chapter 3 97

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 97

Page 123: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.40 Destination Folder

Click Next to start the installation (see Figure 3.41).

Figure 3.41 Ready to Install

Click Finish (see Figure 3.42).

98 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 98

Page 124: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.42 Finishing the Installation

From the Virtual Server Administration Web page, select the Linux virtualmachine (see Figure 3.43).

Figure 3.43 Linux Status Page

Virtual Machines • Chapter 3 99

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 99

Page 125: Virtualization With Microsoft Virtual Server 2005 (2006)

Select CD/DVD (see Figure 3.44).

Figure 3.44 CD/DVD Properties

Enter the fully qualified path to the VMAdditionsForLinux.iso file.Make sure the virtual machine is running so the .ISO file can be mounted tothe virtual machine. Click OK.

Click Open (see Figure 3.45).Double-click the VMAdditionsForLinux file (see Figure 3.46).Double-click the vmadd-full-0.0.1-1.rpm icon to start the installation

of all modules (see Figure 3.47).

NOTE

Some versions of Linux will not support all the Virtual Machine Additionsfor Linux. If you experience problems with loading or starting the ser-vice, you may want to load the virtual machine additions one at a time.The individual files are shown in Figure 3.47.

100 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 100

Page 126: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.45 Mounting the CD

Figure 3.46 Starting the Install

Virtual Machines • Chapter 3 101

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 101

Page 127: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.47 vmadd-full-0.0.1-1.rpm

Click Install Package with YaST (see Figure 3.48).

Figure 3.48 Installing the RPM Package

102 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 102

Page 128: Virtualization With Microsoft Virtual Server 2005 (2006)

YaST will install the RPM package (see Figure 3.49).After the install isfinished, you still must start the services or restart the virtual machine.

Figure 3.49 Installing with YaST

You can now move the control of the keyboard and mouse seamlesslybetween the virtual machine and the host computer desktop.

Designing & Planning…

Infrastructure in a BoxWith Virtual Server’s capability to host multiple networks and differentoperating systems, you have the opportunity to build a complete datacenter in a single physical server. With just two physical NIC cards you cancreate a complete virtual infrastructure (see Figure 3.50).

Virtual Machines • Chapter 3 103

Continued

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 103

Page 129: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 3.50 Virtual Infrastructure

A Linux server running a firewall software package connects to theoutside Internet connection. Data is passed back to one of the internalnetwork switches of the Virtual Server. In this DMZ area, the Web serverand/or the mail server is running. Another firewall server blocks theinternal network from the DMZ. On the internal network, the domain con-troller and file server connect the local users to their internal resources.

A dual processor server running Windows Server 2003 Standard with2 to 4 GB of memory and two NIC cards should be sufficient to supportthe design in Figure 3.66. These specifications are just a guideline and theactual performance and needed resources will vary on your application ofthe software and demand for the virtual machines.

This type of solution could be used to deploy a branch office or smalloffice/home office (SOHO). A single host server in a small rack-mountedformat can be sent out preconfigured to these locations along withinstructions on connecting the computer. Network cables come in mul-tiple colors, so it is easy to designate which cables go into which ports.The fact that the virtual machines can be preconfigured means that theycan be set up and tested before sending out to the remote sites.

After they are connected to the network, the virtual server and thevirtual machines can be managed remotely. This means the home officedoesn’t have to send an IT resource to set up the computers at the remotelocation. There are additional tools on the Virtual Server 2005 Web pagefrom Microsoft to assist in managing multiple virtual servers.

104 Chapter 3 • Virtual Machines

Firewall ServerRunning Linux

WindowsDomain Controller

File Server

Web Server

Firewall ServerRunning Linux

InternalSwitch

DMZ ExternalNetwork

InternalNetwork

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 104

Page 130: Virtualization With Microsoft Virtual Server 2005 (2006)

SummaryIn this chapter we looked at the different components of the virtual machineand how to create them. Each of the chapter sections showed all the differentoptions and how to add or alter their properties.The creation of virtualmachines and the loading of both Microsoft and alternate operating systemswere covered along with the use of the Virtual Machine Additions.

There are four different kinds of virtual disks. Each has its own functionand by combining the different types is possible to create a basic operatingsystem disk and then apply a differential disk to customize each virtualmachine.A fixed disk can be used to reserve all the needed hard drive spacefor a virtual hard disk. Linked disks can attach a physical partition to a virtualmachine to migrate from a physical drive to a virtual drive.

Creating the virtual server along with editing the properties of the virtualcomponents were covered in this chapter.Adjusting the memory, disk,CD/DVD, floppy disk drive, and network adapters all combine to create thevirtual server. We discussed adding virtual hardware and connecting a virtualCD/DVD and floppy disk drive to either an ISO image or the physical diskof the host computer. We also looked at the other ports for COM and LPT.We looked at the limitations of a virtual machine and how to stop, pause, andstart them. By connecting the virtual hard disks to virtual SCSI adapters andconfiguring the maximum size virtual hard disk, very large virtual machinescan be created very easily and quickly.

Adding hardware to the server can add additional capacity and perfor-mance to the host computer.Adding faster processors or additional processors,memory, and NIC cards, and disk subsystems are the primary resources thatwill increase the capacity of the Virtual Server host computer.All the virtualmachines are single-processor machines but a multiprocessor host computercan run many more virtual machines than a single-processor host. Using ahost operating system that can support larger memory capacities and multipleprocessors are good choices for production host computers.

Installing a Windows OS to a virtual machine is very similar to installingon a physical computer. With a common set of virtual hardware, a goldenimage of the installation can be developed.Then using a differential virtualhard drive, applications, service packs, and configurations can be tested before

Virtual Machines • Chapter 3 105

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 105

Page 131: Virtualization With Microsoft Virtual Server 2005 (2006)

committing to these changes.These images can also be cloned to rapidlydeploy new virtual machines without doing a complete install of the oper-ating system.

Installing virtual machine tools enables a better experience with the vir-tual machines. Versions for both Windows and Linux are available and wehave installed both on our virtual machines.These network, SCSI, keyboard,and mouse drivers improve performance and enable a smooth passing of con-trol between the virtual machines and the host computer.

Installing a non-Windows OS was shown.The installation was very similarto a normal installation on a physical computer. Virtual Server 2005 supportsthe major Linux distributions and provides Virtual Machine Additions forLinux to help improve their performance and operation on the host com-puter. It is very possible and reasonable to run a mix of operating systems onthe same Virtual Server host computer.

Solutions Fast Track

Creating a Virtual Disk■ Dynamic virtual hard disks are the default and start small but grow as

necessary to the configured size.These are good choices for virtualmachines that are newly created and do not require all the disk spaceat once.As a dynamic disk file grows larger then the physical diskdrive can handle, it can be moved to a large physical disk drive orpartition.

■ Fixed virtual hard disks allocate all the configured space at once.Thisis the method used when a physical disk is migrated to a virtual harddisk.This is best used if a virtual machine requires all the allocateddrive space at once.

■ Linked virtual hard disks are connected to physical partitions andused mainly for migration of physical machines to virtual machines.They are seen as fixed-size disks.

106 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 106

Page 132: Virtualization With Microsoft Virtual Server 2005 (2006)

Creating the Virtual Server■ Allocate only the amount of memory actually needed. Memory can

be increased if necessary but must be available on the host computerbefore it can be allocated.

■ Virtual hard disk controllers can be IDE or SCSI. IDE can onlysupport virtual hard disk up to 128GB in size.The virtual SCSIsupports virtual hard disks up to 2 TB in size.You can also supportmore devices on a virtual SCSI than a virtual IDE interface.

■ The virtual floppy disk and the virtual CD/DVD should beconfigured to “not connected” state unless you are actually usingthese devices on the virtual machine. Using image files enables youto manage and configure several different virtual machines withouthaving to load a physical floppy disk or CD/DVD in the hostcomputer.

Adding Hardware to the Server■ The hardware in a Virtual Server host computer must be recognized

and supported by the Windows version loaded on it.

■ Processors, memory, and storage subsystems are the most valuableupgrades to the host computer.These are the primary resources usedby the virtual machines.Additional network cards can also be used bythe virtual machines.

■ Virtual machines can share host computer resources.This featuremakes adding HBA cards, RAID cards, and SAN connections morepractical on a Virtual Server host computer.The cost of these devicescan be share across all the virtual machines making the return oninvestment (ROI) easier to justify. Hey, cost is always an object.

Installing a Windows OS■ Create the virtual machine from the Virtual Server Administration

Web page.

■ Configure a new virtual hard disk.

Virtual Machines • Chapter 3 107

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 107

Page 133: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Connect to an existing virtual hard disk.

■ Define the memory for the virtual machine.

■ Connect the virtual CD/DVD or virtual floppy disk drive to thehost computer’s CD or floppy disk drive or use an image file.

■ Start the virtual server and load the operating system like a physicalcomputer.

■ Use the SCSI Shunt driver to speed up the performance of WindowsServer 2003, Windows 2000, and Windows XP virtual machines.

Installing Virtual Machine Tools■ Virtual Machine Additions improve the video, mouse, keyboard, and

network performance of the virtual machines.They should be loadedon all virtual machines if possible.

■ Use the checkbox in Virtual Machine Additions Properties page ofthe virtual machine status to load it.This is an .iso image file that ismounted to the virtual machine when you check the checkbox andclick OK.

■ Remove the Virtual Machine Additions from the virtual machine byselecting Start | Settings | Control Panel | Add or RemoveSoftware.This is just like any other software loaded on a physicalcomputer.

Installing a Non-Windows OS■ Create the virtual machine from the Virtual Server Administration

Web page.

■ Configure a new virtual hard disk.

■ Connect to an existing virtual hard disk.

■ Define the memory for the virtual machine.

■ Connect the virtual CD/DVD or virtual floppy disk drive to thehost computer’s CD or floppy disk drive or use an image file.

108 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 108

Page 134: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Start the Virtual Server and load the operating system like a physicalcomputer.

■ Load the Virtual Machine Additions for the Linux operating system ifapplicable.These have to be downloaded from Microsoft’s Web site.They are installed by connecting the virtual CD/DVD to the .ISOimage and running the script or .rpm file.

■ You must reboot or start the services for the Virtual MachineAdditions to work in the Linux-based virtual machines.

Q: What operating systems can run Virtual Server 2005 R2?

A: Microsoft Windows Server 2003 Standard, Enterprise, or DatacenterEdition either 32 or 64 versions; Windows XP Pro SP2; and WindowsSmall Business Server 2003 Standard or Premium Edition can be used asthe host operating system. Windows XP Pro SP2 is supported only as adevelopment platform and not as a production environment.

Q: What guest operating systems are supported?

A: Virtually any 32-bit operating system for the Intel platform can be run inVirtual Server 2005 R2.There is a list of supported operating systems onthe Microsoft Virtual Server Web site. Basically any version of WindowsServer except Datacenter from NT 4 SP6a through Server 2003 R2 canbe a guest on the Virtual Server. Windows XP SP2 can also be run as avirtual machine.Almost all the current popular versions on Linux can alsobe run as a guest operating system.

Virtual Machines • Chapter 3 109

Frequently Asked Questions

The following Frequently Asked Questions, answered by the authors of this book,are designed to both measure your understanding of the concepts presented in this chapter and to assist you with real-life implementation of these concepts. Tohave your questions about this chapter answered by the author, browse towww.syngress.com/solutions and click on the “Ask the Author” form.

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 109

Page 135: Virtualization With Microsoft Virtual Server 2005 (2006)

Q: How many virtual machines can be run on a host server?

A: This depends a lot on the resources of the Virtual Server host.The hostmust be able to support the needed memory of the guest virtual machine.Processor and disk requirements must also be met by the Virtual Serverhost computer.Adding processors and storage space along with memorycan greatly improve the number and performance of the guest virtualmachines.The supported limit is 64 and has a very clear reason:The MACAddress of a virtual machine is based on a manufacturer ID of three bytes(in this case Microsoft), a unique ID one byte and the last two bytes of thehost adapter.The unique ID can be anything between 0 and 255. Everyvirtual machine can have a maximum of four NICs and 256 divided by 4equals 64. However, besides the hardware specifications, there is no limiton virtual machines, only the number of NICs.

Q: Can Virtual Server 2005 R2 run on a 64-bit operating system?

A: Yes, but all the guest virtual machines must be running a 32-bit operatingsystem.A 64-bit host operating system will enable increased memory sup-port and higher performance of the host computer so additional virtualmachines can be supported on the same host computer hardware than ona 32-bit operating system running on the same computer. Regardless ofthe version of host operating system (32- or 64-bit versions) the sup-ported limit of 64 virtual machines is still in force.

Q: Can I have a 64-bit guest operating system?

A: No, at this time only 32-bit operating systems are supported by VirtualServer 2005 R2. Each guest virtual machine is also limited to a single pro-cessor configuration.

Q: How many virtual hard disks can I have on a virtual machine?

A: Each virtual machine can support up to 31 virtual hard disks. Each virtualmachine can have up to four SCSI adapters with seven devices on eachadapter. Each virtual machine has two IDE channels with two connec-tions on each channel.The CD/DVD drive takes up one so there arethree remaining.That is 31 devices. With each SCSI device allowed to beup to 2 TB in size, you can make a very big virtual machine!

110 Chapter 3 • Virtual Machines

406_VIRTUAL_03.qxd 9/8/06 7:23 PM Page 110

Page 136: Virtualization With Microsoft Virtual Server 2005 (2006)

Virtual Networks

Solutions in this chapter:

■ Introduction to Virtual Networks

■ Using the “Internal Network”

■ Creating a Virtual Network

■ Binding a Physical Network Adapter to aVirtual Network

■ Using the Virtual Server Network Services

Chapter 4

111

� Summary

� Solutions Fast Track

� Frequently Asked Questions

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 111

Page 137: Virtualization With Microsoft Virtual Server 2005 (2006)

IntroductionBuilding a virtual server park on one machine is one step; creating an entirenetwork infrastructure and logical dividing servers through virtual networks isanother.

Using virtual networks opens the possibility to use Virtual Server in yourtest environment to include test/production scenarios with a demilitarizedzone (DMZ). It is even possible to configure Virtual Server in such a way thatnetwork users aren’t able to connect to the physical server over the network,enabling you to reduce the attack surface even further.

Introduction to Virtual NetworksEach virtual machine can have up to four network adapters, each of whichcan be configured differently.A virtual network can be configured to support:

■ External resources A network that connects the virtual server andthe virtual machines to outside resources such as the Internet orother resources on the local area network (LAN).This type of net-work uses the physical network adapter in the host computer for thevirtual network.

■ Internal networks An internal network connecting virtualmachines only to other virtual machines on the host computer or aconnection between the virtual machine and the virtual server hostcomputer.This type of network uses the Microsoft Loopback adapterand does not require any external support or physical networkadapter.

Using the different types of virtual networks will enable you to build verysophisticated infrastructures without a large investment in physical servers ornetwork devices.You can also use the features of the virtual network to pro-totype a network design before investing in physical hardware.

Remote offices can be supported with their own virtual server running allthe necessary servers and services to support a secure and robust data centerin a box.These can be preloaded and configured at a central location andshipped to the remote office for connection by local non-technical personnel.

112 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 112

Page 138: Virtualization With Microsoft Virtual Server 2005 (2006)

This saves a business time and money by not tying up their technicalresources on installing a remote office and minimizes the cost of deployingserver resources to small offices.

Virtual NetworksThe virtual networks are managed from the Virtual Server AdministrationWeb page. Figure 4.1 shows the three options available.

Figure 4.1 Virtual Networks Section

■ The Create option enables you to create a new virtual network.

■ The Add option enables you to add a virtual network using anexisting configuration file.

■ The Configure option opens the properties of a virtual network.Avirtual network is created for each network adapter on the physicalcomputer.An internal network is created for virtual machines onlyand is not attached to a network adapter.

Virtual Networks • Chapter 4 113

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 113

Page 139: Virtualization With Microsoft Virtual Server 2005 (2006)

If you are using the Remote Control view, the Virtual Network sectiondoesn’t show up.

Viewing the Virtual NetworksBecause a virtual network is created for each active network interface card(NIC) in the host computer, you can look at these as soon as you load theVirtual Server 2005 R2 software.To view these virtual networks, clickConfigure in the Virtual Networks menu of the Virtual ServerAdministration Web page (see Figure 4.2).

Figure 4.2 Configuring Virtual Networks

A submenu appears with the option to View All virtual networks, to viewthe External Network bound to the host computer’s NIC card, or to view theInternal Network. Click View All (see Figure 4.3).

114 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 114

Page 140: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.3 View All Virtual Networks

You will see a list of all the different virtual networks configured on thevirtual server.You can have an unlimited number of virtual networks withan unlimited number of virtual machines connecting to them.There aresome limitations.The virtual machines themselves will support only up tofour virtual network adapters.The virtual machines can use only Ethernetadapters. Figure 4.4 shows all the virtual networks.

Each External Network is connected to a physical NIC card in the hostcomputer.You are limited only by the number of expansion slots in the hostcomputer. All virtual machines connected to this virtual network can con-nect to all external servers and computers that can see this network. Othervirtual machines sharing this network along with the host computer cancommunicate with all virtual machines connected to this virtual network.

Virtual Networks • Chapter 4 115

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 115

Page 141: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.4 All Virtual Networks

The Internal Network is a network that is isolated inside the virtual servercomputer. Only virtual machines contained within the virtual server cancommunicate with each other.This is a much more interesting feature than itappears at first glance. We will be exploring the Internal Network in greaterdepth later in this chapter.

Virtual Network PropertiesWe can view the properties of each virtual network by clicking on the virtualnetwork name and selecting Edit Configuration as shown in Figure 4.5.

The current properties are displayed for the selected virtual network.Figure 4.6 shows the configuration properties of the External Network insidethe red circle.

116 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 116

Page 142: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.5 Edit Configuration

Figure 4.6 External Network Properties

These properties show the physical network adapter associated with thisvirtual network, any notes associated with this virtual network, and the phys-ical location of the virtual network configuration (.vnc) file.

Virtual Networks • Chapter 4 117

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 117

Page 143: Virtualization With Microsoft Virtual Server 2005 (2006)

Each virtual network has two main properties, Network Settings andDHCP server. Figure 4.7 highlights these with a red circle.

Figure 4.7 Virtual Network Properties

Click the Network Settings link (see Figure 4.8).

Figure 4.8 Network Settings

118 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 118

Page 144: Virtualization With Microsoft Virtual Server 2005 (2006)

This properties page shows the virtual network name.This name can beanything but is the name of the physical NIC by default. We will look at thismore later.A pull-down box lists all the physical NICs in the host computerand a Guests Only choice. Select the physical NIC to connect this virtualnetwork or select Guest Only to create an internal network.

In the Connected virtual adapters you can see which virtual machines areusing this virtual network.The Connected check box shows if this virtualnetwork is currently connected to the virtual machine.You can disconnect avirtual machine from this virtual network by clearing this box. When you do,the virtual machine will show up in the disconnected virtual networkadapters section, as shown in Figure 4.9.

Figure 4.9 Disconnected Virtual Network Adapters

Virtual network notes is a text box for any notes the administrator may wantto put on this virtual network. If you are creating several virtual networks, thissection can be very helpful for remembering the purpose of this virtual net-work.Additional notes may be the address range or any other pertinent infor-mation. Remember, there is no limit to the number of virtual networks youcan create. Click OK to apply your changes.

Virtual Networks • Chapter 4 119

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 119

Page 145: Virtualization With Microsoft Virtual Server 2005 (2006)

Each virtual network can have a Dynamic Host Configuration Protocol(DHCP) server associated with it.The DHCP server is limited to providingTCP/IP addressing along with default gateway and Domain Name System(DNS) server and Windows Internet Name Service (WINS) server informa-tion. Figure 4.10 shows the DHCP Properties page.

Figure 4.10 DHCP Server Properties

The included virtual DHCP server can be used instead of configuring avirtual machine as a DHCP server.This feature is useful only for internal net-works because the virtual DHCP server will provide IP addresses only to vir-tual machines and not to physical computers.This feature is disabled by defaultwhen creating a virtual network.

120 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 120

Page 146: Virtualization With Microsoft Virtual Server 2005 (2006)

Designing & Planning…

Internal or ExternalWhen planning your virtual networks you should decide which virtualmachines need access to LAN resources, which will need access to widearea network (WAN) resources. A physical network interface card (NIC)can have multiple virtual networks associated to it. This means you havea wide variety of addressing possibilities for each physical NIC card.

The physical switch that the physical NIC is plugged into must sup-port all the virtual LANs (VLANs) created by the virtual networks or theexternal resources cannot connect to the virtual machines. An example ofthis may be a Web server running on a virtual machine with a virtual net-work on TCP/IP address 10.100.100.124. This is the address segment forthe local office desktop computers. A second virtual network is config-ured to use the same physical NIC but is for a messaging server in theDMZ between the firewall and the local network. This DMZ networkaddress is 172.17.1.26. The physical switch this physical NIC is connectedto must be configured for both the 10.100.100.0 and the 172.17.1.0VLAN. The network traffic between the virtual machines would have to berouted between the virtual networks for the two virtual machines toexchange data just like two physical servers connected to their respectivenetworks.

Certain network cards such as Intel can utilize advanced featuressuch as VLAN trunking. This advanced option is not supported on VirtualServer 2005 because virtual network services operate on Level 2 of the OSImodel only. All VLAN configurations must take place on the networkswitch device.

You could have two NICs in your virtual server host computer. Onecould be configured to a classroom network that is not allowed to connectto the Internet or any other resource outside of the classroom. The othercould be configured to the normal office network. By managing the con-nection of the virtual machine’s virtual networks you could prepare theserver from your desk by connecting the office virtual network. When classwas in session you would disconnect the office virtual network and con-nect the classroom virtual network. These changes do not have any effecton the other virtual machines running on the virtual server host computer.

Virtual Networks • Chapter 4 121

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 121

Page 147: Virtualization With Microsoft Virtual Server 2005 (2006)

Using the “Internal Network”If no physical network adapter is selected, any virtual machine attached to theselected virtual network becomes part of the internal virtual machine net-work.An internal virtual machine network consists of all virtual machinesthat are attached to a specific virtual network configured to use no physicalnetwork adapter. Each internal virtual network is completely isolated from allother internal virtual networks.This means that all network traffic betweenvirtual machines on an internal network does not interfere or conflict withany other internal virtual network or any external virtual network.

This is a very interesting and significant feature of the virtual server.Groups of virtual machines can be isolated for testing of network applicationsor operating system configurations or integration without impacting the pro-duction network or interfering with any other internal virtual network.Figure 4.11 illustrates this point.

Figure 4.11 Using the Internal Virtual Network

122 Chapter 4 • Virtual Networks

External Network

`

Virtual Network A

`

WindowsXP

`

WindowsXP

DomainController

SMS2003

FileServer

Virtual Network B

Virtual Network C

ISAServer

DomainController

SharePoint2003

`Windows

XP

`Windows

XP

Virtual Network D

DomainController

Web Server

PrintServer

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 122

Page 148: Virtualization With Microsoft Virtual Server 2005 (2006)

Virtual network A has a complete network including clients.All the nec-essary elements for testing a System Management Server 2003 deployment arepresent. Normally, this type of test environment can be difficult to constructbecause you want the testing environment completely isolated. Using theinternal virtual network we accomplish the same goal on our Virtual Server2005 host computer.

Virtual network B and virtual network C show a simulated Internet appli-cation. Client devices on virtual network C are isolated from the servers andthe domain on virtual network B by a Microsoft ISA server connected toboth virtual networks.This project is also isolated from the one on virtualnetwork A and is not visible to it.

A set of production servers is also connected to virtual network D.Thisvirtual network is associated to the host computer’s NIC card and can accessand be accessed by the resources on the production network.The productionnetwork will not see the servers connected to the internal networks.

Although this example would require a virtual server with significantresources to support all these virtual machines running at the same time, it isnot impossible to create it on a host computer with more modest resources.The virtual machines do not require any resources while in a suspended orpowered-off state. In this scenario, the two virtual test environments could besuspended and powered off when not being used.The production serverswould remain powered on and active all the time.

Remember the basic guidelines for virtual networks:

■ A virtual server can support an unlimited number of virtual net-works.

■ A virtual network can have an unlimited number of connectionsfrom virtual machines.

■ A virtual machine can support up to four virtual network adapters.

■ Multiple virtual networks can be connected to a physical NIC.

Virtual Networks • Chapter 4 123

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 123

Page 149: Virtualization With Microsoft Virtual Server 2005 (2006)

Using the Loopback AdapterThe Loopback adapter is a special internal network that can be used to con-nect virtual machines to the host computer without using a physical NIC.The Loopback adapter can be configured to:

■ Use Internet Connection Firewall (ICF) to protect internal virtualnetworks. Because the ICF checks all communications traffic thatgoes across the connection between the virtual network and theInternet and it is selective about which responses from the Internet itallows, a virtual DMZ is created.

■ Provide host-to-guest networking and file sharing without having touse an external network.This configuration removes unnecessary datafrom passing across a shared NIC and provides an easy method ofaccessing host and guest files.

■ Use Internet Connection Sharing (ICS) to provide Network AddressTranslation (NAT) and share a single connection to the Internetbetween the host operating system and one or more virtualmachines.This method enables a guest operating system to access theInternet without needing to configure any external resources throughan external connection.

■ Enable the host computer to remove all bindings (client for MicrosoftNetworks,TCP/IP etc.) except the virtual machine network bindingto the physical network adapter.The host computer then becomesinvisible to the rest of the network while the hosted virtual machinescontinue to function normally.The Layer 2 functionality of the vir-tual networks services enables this type of configuration.

Installing the Loopback AdapterTo install the Microsoft Loopback adapter:

1. In the host operating system, click Start | Settings | ControlPanel.

124 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 124

Page 150: Virtualization With Microsoft Virtual Server 2005 (2006)

2. Click Add Hardware as shown in Figure 4.12 to launch the AddHardware wizard.

Figure 4.12 Control Panel

3. In the Welcome to the Add Hardware Wizard screen, click Next(see Figure 4.13.)

Figure 4.13 Add Hardware Wizard

Virtual Networks • Chapter 4 125

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 125

Page 151: Virtualization With Microsoft Virtual Server 2005 (2006)

4. When the Is the hardware connected? screen appears, select Yes, Ihave already connected the hardware, and then click Next (seeFigure 4.14).

Figure 4.14 Hardware Connected?

5. In the Installed hardware list, scroll to the bottom of the list andselect Add a new hardware device, and then click Next (seeFigure 4.15).

Figure 4.15 Add a New Hardware Device

126 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 126

Page 152: Virtualization With Microsoft Virtual Server 2005 (2006)

6. In The wizard can help you install other hardware screen (seeFigure 4.16), select Install the hardware that I manually selectfrom a list (Advanced), and then click Next.

Figure 4.16 What Do You Want the Wizard to Do?

7. In the Common hardware types list, select Network adapters,and then click Next (see Figure 4.17).

Figure 4.17 Common Hardware Types

8. In the Manufacturer list, click Microsoft (see Figure 4.18).

Virtual Networks • Chapter 4 127

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 127

Page 153: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.18 Select Network Adapter

9. In the Network Adapter list (see Figure 4.18), click MicrosoftLoopback Adapter, and then click Next.

10. Verify your selection as shown in Figure 4.19, and then click Next.

Figure 4.19 Hardware to Install

11. If a message about driver signing appears, click Continue Anyway.

12. In the Completing the Add Hardware Wizard dialog box, clickFinish (see Figure 4.20).

Configuring Host-to-Guest Networking and File SharingBecause the host computer and the guest computers do not have to be on thesame network or even in the same domain or workgroup, the challenge of

128 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 128

Page 154: Virtualization With Microsoft Virtual Server 2005 (2006)

moving files between the host and the guest can be a problem.This is whatthe Loopback adapter is used for. Since the Loopback adapter looks, acts, andis configured just like a physical NIC, it can be used for a virtual network thatonly the virtual machines and the host computer can use.

Figure 4.20 Completing the Add Hardware Wizard

To configure the Loopback adapter:

1 On the host operating system, Click Start | Settings | ControlPanel. In the Control Panel screen, double-click the NetworkConnections icon (see Figure 4.21).

Figure 4.21 Control Panel | Network Connections

2. Right-click the local area connection for Microsoft LoopbackAdapter, and then select Properties (see Figure 4.22).

Virtual Networks • Chapter 4 129

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 129

Page 155: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.22 Network Connections on the Host Computer

3. In the Microsoft Loopback Adapter Properties dialog box, verifythat the Virtual Machine Network Services check box is selected(see Figure 4.23).

Figure 4.23 Virtual Machine Network Services

130 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 130

Page 156: Virtualization With Microsoft Virtual Server 2005 (2006)

4. Click Internet Protocol (TCP/IP), and then click Properties(see Figure 4.24).

Figure 4.24 TCP/IP

5. On the General tab, click Use the following IP address, and thentype the IP address and subnet mask (such as 10.10.10.2 and255.255.255.0) as shown in Figure 4.25. Do not enter anything for adefault gateway.

Although you can use any Transmission Control Protocol/Internet Protocol (TCP/IP) address, here it is best to choose onefrom a reserved range of non-routable TCP/IP addresses that are notin use on your production network. In our example we are using anetwork address of 10.10.10.X and a host ID of 2.The virtualmachines that are guests on this host computer could use the samenetwork address with a different host ID to communicate with thehost and each other.

Virtual Networks • Chapter 4 131

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 131

Page 157: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.25 TCP/IP Addressing

6. Click OK then close.

Configuring & Implementing…

Isolating the Connection between the Host and the GuestYou may have several guest virtual machines all running on different net-works to isolate them from each other. To maintain this isolation and stillenable communication between the host computer and the guest virtualmachine, you can assign several different TCP/IP addresses to the hostLoopback adapter.

Giving each virtual machine and the host computer a unique net-work ID and host ID for each virtual network they share will enable you touse your subnetting skills. A subnet mask of 255.255.255.0 will enable254 hosts to connect to the assigned network ID. If we want only the hostand the guest virtual machine to share this virtual network we can assigna subnet mask of 255.255.255.252.

132 Chapter 4 • Virtual Networks

Continued

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 132

Page 158: Virtualization With Microsoft Virtual Server 2005 (2006)

You will need to watch your network addresses to make sure you areassigning the correct numbers. If you can do the math, great, but forthose of us that want a little help there is a free subnet calculator onlineat www.subnet-calculator.com. You might want to write down theassigned virtual networks so you don’t forget later. You will want to usea subnet mask that will accommodate the host computer and all the vir-tual machines that are on the same virtual network.

Using the ICSWhat if you are building a new virtual machine and you want it to haveaccess to the Internet but don’t really want to configure a virtual networkthat will connect to the external LAN? You can use the ICS feature ofWindows.This will enable your virtual machine to connect to the Internetusing the host computer’s network connection.

NOTE

This could potentially create a security incident. If you are performingthis action on a production network you should check with the securityadministrator before performing this procedure.

To configure ICS for use with your virtual machines:

1. Install the Microsoft Loopback Adapter as described in this chapter.

2. Start the Network Setup Wizard by clicking Start | Settings |Control Panel, and then double-click Network Setup Wizard asshown in Figure 4.26.

3. On the Welcome to the Network Setup Wizard screen, clickNext (see Figure 4.27).

Virtual Networks • Chapter 4 133

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 133

Page 159: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.26 Select the Network Setup Wizard

Figure 4.27 Welcome to the Network Setup Wizard

4. On the Before you continue screen, click Next (see Figure 4.28).

134 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 134

Page 160: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.28 Before You Continue…

5. Select This computer connects directly to the Internet, asshown in Figure 4.29, and then click Next.

Figure 4.29 Select a Connection Method

6. Select the host computer’s physical NIC that connects to theInternet, as shown in Figure 4.30, and then click Next.The wizardwill make a selection, so verify that it is the correct network interface card.

Virtual Networks • Chapter 4 135

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 135

Page 161: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.30 Select Your Internet Connection

7. Check the box next to the Local Area Connection for theMicrosoft Loopback adapter, as shown in Figure 4.31, and then clickNext.

Figure 4.31 Select Your Private Connection

8. Enter a description and name for the computer as shown in Figure4.32.These will default to the configuration for your host computer.There is no need to change them unless it is required by yourInternet service provider or the security officer of your business.Click Next when you are finished (see Figure 4.32).

136 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 136

Page 162: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.32 Computer Description and Name

9. Enter a workgroup name as shown in Figure 4.33.You might want tomake this a more descriptive name if you have more than one virtualnetwork sharing this connection. Click Next.

Figure 4.33 Name Your Network

10. Select Turn on file and printer sharing if you want to enableyour virtual machines to access file shares and printers on the outsidenetwork (see Figure 4.34). If you do not want to enable the virtual

Virtual Networks • Chapter 4 137

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 137

Page 163: Virtualization With Microsoft Virtual Server 2005 (2006)

machines to access file share and printers, then select Turn off fileand printer sharing. Click Next when ready to proceed.

Figure 4.34 File and Printer Sharing

11. Review the setting as shown in Figure 4.35, and then click Next.

Figure 4.35 Ready to Apply Network Settings

12. Click Finish when the configuration is complete.You may beprompted to restart the host computer.

138 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 138

Page 164: Virtualization With Microsoft Virtual Server 2005 (2006)

Creating a Virtual NetworkA virtual network is a collection of one or more virtual machines connectedto exchange information or provide a service to other virtual machines orcomputers. Virtual Server 2005 R2 can support an unlimited number of vir-tual networks.A virtual network can be associated to a physical networkadapter or the Loopback adapter or no adapter. More than one virtual net-work can be associated to either of these choices.

By utilizing one or more physical network adapters along with theinternal network and the Loopback adapter, very complex network designscan be incorporated with Virtual Server.A virtual network is created for eachphysical network adapter in the virtual server host computer by default.Additional virtual networks can be created to fit the needs of the virtualmachines.

To create a virtual network:

1. Start by opening the Virtual Server Administration Web page andselecting Create from the Virtual Networks menu, as shown inFigure 4.36.

Figure 4.36 Virtual Server Administration Web Page

Virtual Networks • Chapter 4 139

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 139

Page 165: Virtualization With Microsoft Virtual Server 2005 (2006)

2. Enter the name of the virtual network in the Virtual networkname box, as shown in Figure 4.37.This name has to be unique tothe virtual server and can be almost anything.You should try to makeit a descriptive name that will tell you something about the virtualnetwork later.

Figure 4.37 Virtual Network Properties

3. Select the network adapter from the Network adapter on physicalcomputer pull-down menu.You can select one of the NIC cards inthe host computer or the Loopback adapter if you installed it.Selecting None makes this virtual network an internal virtual net-work.

4. If there are any disconnected virtual network adapters that you wantto connect to this virtual network, you can select them by checkingthe Connected box next to the virtual machine name.If you want to connect a virtual server that does not appear in space,you will need to create a new virtual adapter and connect it to thisvirtual network.

140 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 140

Page 166: Virtualization With Microsoft Virtual Server 2005 (2006)

5. In the Virtual network notes section you can enter any informationyou want.You might want to put pertinent connection informationor other descriptive text about the use and purpose of this virtualnetwork.This box is here to help the administrator remember whythe virtual network was created and will make your job much easierafter you have several virtual networks.

6. Click OK when finished. Figure 4.38 shows the Virtual NetworkProperties page for the new virtual network.

Figure 4.38 Virtual Network Properties

Binding a Physical Network Adapter to a Virtual NetworkEven though virtual machines may be portable, virtual networks are not. If avirtual network adapter is connected to a virtual network on one virtualserver computer, when the virtual machine is moved to a different virtualserver computer the virtual network adapters will all need to be connected tovirtual networks on the new virtual server computer.This is one reason why

Virtual Networks • Chapter 4 141

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 141

Page 167: Virtualization With Microsoft Virtual Server 2005 (2006)

it is recommended that descriptive names and notes be utilized for the virtualnetworks.

You may want to add another physical network adapter to your virtualserver host computer and connect an existing virtual network across this newresource.There may have been a failure or an upgrade and the current NICcard has been replaced with a different one.All these scenarios will requirebinding a physical network adapter to a virtual network.

Changing the Binding of a Virtual NetworkThere are many reasons why you would need to change the binding of a vir-tual network from one physical network adapter to another or change thevirtual network from an external virtual network to an internal virtual net-work.All of these changes are accomplished in the same way.

1. Open the Virtual Server Administration Web page. Select Configurefrom the Virtual Networks menu, as shown in Figure 4.39. Selectthe desired virtual network. We will use Production Network VLAN 16that we created in the previous section.

Figure 4.39 Configuring the Virtual Network

2. Select Network Settings, as shown in Figure 4.40.

142 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 142

Page 168: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.40 Network Settings

3. Click the pull-down arrow in the Network adapter on physicalcomputer drop-down menu and select the new physical adapter forthis virtual network, as shown in Figure 4.41.

Figure 4.41 Selecting a Physical Network Adapter

Virtual Networks • Chapter 4 143

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 143

Page 169: Virtualization With Microsoft Virtual Server 2005 (2006)

4. Click OK when finished.

All virtual machines connected to this virtual network will now use thenew network adapter for their network traffic.You do not need to recon-figure the virtual machines.This can be a very efficient method of managingthe network traffic in and out of a virtual server.

Figure 4.42 shows how having multiple network adapters can be usedwith virtual networks to manage the network traffic.

Figure 4.42 Using Multiple Network Adapters

144 Chapter 4 • Virtual Networks

Virtu

al Se

rver

Netw

ork

Virtu

al Ne

twor

k 1

Virtu

al Ne

twor

k 2

Virtu

al Ne

twor

k 3

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 144

Page 170: Virtualization With Microsoft Virtual Server 2005 (2006)

In the example shown, there is a separate network adapter for the virtualserver computers.This network manages the network traffic for the hostcomputers. It also enables a direct method of accessing these host systemswithout using any of the guest computer or virtual network bandwidth. Eachof the three virtual networks is connected to a separate physical networkadapter in each of the virtual servers. Each virtual server would require thisvirtual network to be configured and addressed appropriately for the virtualmachines to communicate with each other. While it is not required that eachvirtual network have a dedicated physical network adapter, it is shown thisway for clarity. If you do have multiple virtual networks using the same phys-ical adapter, the physical adapter must have access to the external networksbeing used by the virtual networks.

Using these methods will also enable an administrator to quickly discon-nect all virtual servers using a virtual network by simply changing the virtualnetwork configuration and selecting the Loopback or None network adapter.The None selection makes the virtual network an internal network and iso-lated from all external network traffic.The Loopback adapter, if it is config-ured, enables network traffic between the host and the virtual machinesconnected to the virtual network. If you also configure the ICS, the virtualmachines will still be able to access the external network by bridging acrossthe host computer’s network connection.

Changing the Virtual Network for a Virtual MachineNow that you have seen how to change the configuration of a virtual net-work, you may need to change the network connection of your virtual net-work adapter to use one of these virtual networks. Each virtual machine cansupport up to four virtual network adapters but it is not necessary to create anew virtual adapter every time you want to connect to a different virtual net-work.To change the virtual network connection of a virtual machine:

1. From the Virtual Server Administration Web page, select the virtualmachine on which you want to edit the configuration, as shown inFigure 4.43.

Virtual Networks • Chapter 4 145

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 145

Page 171: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.43 Edit Virtual Machine Configuration

2. Select Network adapters from the Virtual Machine Propertiespage, as shown in Figure 4.44.

Figure 4.44 Virtual Machine Properties

146 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 146

Page 172: Virtualization With Microsoft Virtual Server 2005 (2006)

3. Click the pull-down arrow next to the Connected to box.The listof available virtual networks is displayed, as shown in Figure 4.45.Select the desired virtual network.

Figure 4.45 Connected to List of Virtual Networks

4. Click OK to complete the process.The virtual machine’s networkadapter is now connected to the selected virtual network.

Using the Virtual Server Network ServicesEach virtual network also has a virtual DHCP server as part of the configura-tion.As mentioned earlier, this Dynamic Host Configuration Protocol(DHCP) server is only for the virtual machines on the same virtual serverhost computer.This DHCP server cannot be used for any other purpose orfor any other type of client computer.

Although there are restrictions on its use, it does not mean that this addedfeature is without merit.You should consider it when setting up internal

Virtual Networks • Chapter 4 147

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 147

Page 173: Virtualization With Microsoft Virtual Server 2005 (2006)

virtual networks or host–to-guest virtual networks. It can also supply TCP/IPaddresses to virtual machines connected to external virtual networks.Theassigned address pool must be excluded from the external DHCP addresspool or a conflict could occur.

The virtual network DHCP server is disabled by default.To enable andconfigure it for use:

1. From the Virtual Server Administration Web page selectConfigure from the Virtual Networks menu. Select the virtualnetwork to configure, as shown in Figure 4.46.

Figure 4.46 Selecting a Virtual Network

2. Select DHCP server from the Virtual Network Properties page,as shown in Figure 4.47.

3. Check the Enable check box to start the configuration.You willneed to enter values in the properties boxes for the virtual DHCPserver as shown in Figure 4.48.

148 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 148

Page 174: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 4.47 Selecting DHCP Server

Figure 4.48 Virtual DHCP Server Properties

4. Enter the network address for the virtual network in the Networkaddress text box.This is the network portion of the TCP/IP address.

Virtual Networks • Chapter 4 149

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 149

Page 175: Virtualization With Microsoft Virtual Server 2005 (2006)

5. Enter the subnet mask for this virtual network in the Networkmask text box.This is the address mask that determines the networkportion of the TCP/IP address from the host ID portion.

6. Enter the starting address for the virtual DHCP server address poolin the Starting IP address box.This is the first address that theserver will assign to a virtual machine on this virtual network.

7. Enter the last address for the virtual DHCP server address pool in theEnding IP address box.This will be the last address that can beassigned to virtual machines on this virtual network. If moreaddresses are requested, they will be denied and the virtual machinewill not be able to connect to the virtual network.

8. Enter the address for the virtual DHCP server in the VirtualDHCP server address box. Even though this is a virtual service itstill requires a TCP/IP address on the virtual network.This should beoutside the address pool and not in conflict with any other resourceon the virtual network either internal or external to the virtualserver.

9. Enter the default gateway address in the Default gateway addressbox.

10. Enter the addresses of any DNS servers the virtual machines can usein the DNS servers box. Separate the addresses with a comma. Ifthis is an internal virtual network there may not be any DNS serverson this virtual network. Just leave this box blank if there are no DNSservers for this virtual network.

11. Enter the addresses of any WINS servers the virtual machines can usein the WINS servers box. Separate the addresses with a comma. Ifthis is an internal virtual network there may not be any WINSservers on this virtual network. Just leave this box blank if there areno WINS servers for this virtual network

12. Enter the duration of the address lease in the IP address lease timebox. Normally just accept the default value for this box.

150 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 150

Page 176: Virtualization With Microsoft Virtual Server 2005 (2006)

13. Enter the duration of the lease renewal time in the Lease renewaltime box. Normally just accept the default value for this box.Thisvalue is normally half the IP address lease time value.

14. Enter the duration of the lease rebinding time in the Leaserebinding time box. Normally just accept the default value for thisbox.This value is normally half-way between the IP address leasetime and the lease renewal time.

15. Click OK when finished.

When the virtual machine is connected to this virtual network the virtualDHCP server will assign all the configured information to the virtual net-work adapter when the virtual machine is started or the virtual networkadapter is connected. Just like a DHCP server running on a physical com-puter, it will not overwrite settings in the virtual machines that have beenentered into the address properties of the virtual network adapter.

If you want your virtual machines to act as a DHCP server to computeron the external network, you have to configure DHCP services for the guestoperating system running on the virtual machine.Your virtual machines canalso use a DHCP server on the physical network to obtain a network address.

Virtual Networks • Chapter 4 151

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 151

Page 177: Virtualization With Microsoft Virtual Server 2005 (2006)

SummaryIn this chapter we looked at all the various ways to use the virtual networkingfeatures of Virtual Server 2005 R2.The two basic types of virtual networktypes enable the virtual server administrator to control how the virtualmachines can access resources.The external type enables the virtual machinesto connect to Internet or other resources directly.This could be useful inbuilding a virtual firewall or Internet Web or message server where outsideaccess is required. Other external networks enable the virtual machines toconnect to resources on the LAN.This is a very common design and givesvirtual machines access to the LAN to interact like any other physical com-puter on the LAN.The internal virtual network type isolates the virtualmachines on a virtual network that only the virtual machines can access.Thisis good for building a DMZ or isolating test infrastructures from productionvirtual machines and networks.Another internal network provides host accessfor exchanging files between the host computer and the guest virtualmachine.

We explored the internal network. We saw how to create internal net-works that enabled multiple networking environments to reside on the virtualserver without interacting with each other. We also loaded the MicrosoftLoopback adapter to enable host-to-guest networking.This type of virtualnetwork enabled the guest to share files and other resources between theguest and the host operating systems.The ICS was also installed to provide forbridging the host network connection to the internal virtual network and theconnected virtual machines.

We showed the creation of a virtual network and identified the differentproperties that can make it an external or an internal virtual network. Weshowed the connection method of connecting an unconnected virtual net-work adapter to the new virtual network at the time of creation. We alsoshowed how to change a virtual network adapter from one virtual network toanother in the virtual machine properties Web page. We recommended thatthe virtual network name be descriptive and the notes section be utilized tokeep pertinent information on each of the virtual networks.

Multiple virtual networks can be connected to a single physical networkadapter and all the virtual networks can be independent of each other as long

152 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 152

Page 178: Virtualization With Microsoft Virtual Server 2005 (2006)

as the physical network adapter has access to all the configured networks.Avirtual server can support an unlimited number of internal virtual networkswith an unlimited number of connections on each internal virtual network.All this combined allows for Virtual Server to be very flexible in your infras-tructure design.As the need arises or bandwidth load increases, additionalphysical network adapters can be added to the virtual server host computer.The virtual networks can be reassigned or associated to the physical adapterfrom the Virtual Network Configuration properties of the Virtual ServerAdministration Web page.This feature makes it very easy to upgrade to sepa-rate the network traffic across different network adapters.This is also impor-tant because virtual networks are not portable.They are only valid on thevirtual server host computer where they were created. Virtual machines cre-ated on one virtual server must have their virtual network adapter recon-nected to a virtual network before it can use any network resources.

The last thing we looked at was the virtual DHCP server associated witheach virtual network.This service can be used only to provide TCP/IPaddressing to the virtual machines on a single virtual server host.This serviceis disabled by default because the virtual machines can use any availableDHCP server on the network.This service is particularly useful for internalvirtual networks where there are no outside resources accessible.This featurewill avoid the need to configure a DHCP server on one of the virtualmachines for the internal virtual network.

Solutions Fast Track

Introduction to Virtual Networks

� There are two types of virtual networks: external and internal.

� Virtual networks can be combined to form a complete networkinfrastructure on a single computer.

� Virtual networks are not portable. Virtual machines must have theirvirtual network adapter connected to a virtual network configuredon the virtual server hosting the virtual machine.

Virtual Networks • Chapter 4 153

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 153

Page 179: Virtualization With Microsoft Virtual Server 2005 (2006)

Using the “Internal Network”

� There can be an unlimited number of internal virtual networks eachwith an unlimited number of connections.

� The internal network can be used to isolate a set of virtual machinesto form a DMZ or a completely isolated network for testing.

� Loading the Microsoft Loopback adapter enables host-to-guestcommunications.This enables guest virtual machines to share fileswith the host computer.

Creating a Virtual Network

� Virtual networks are created from the Virtual Server AdministrationWeb page.

� Use descriptive names for the virtual networks and use the notessection to maintain the pertinent information about the virtualnetwork.

� A virtual network is automatically created for each physical adapterin the host computer.

Binding a Physical Network Adapter to a Virtual Network

� Multiple virtual networks can be bound to a single physical networkadapter.The physical adapter must have access to the VLAN resourcesthe virtual networks are using.

� The virtual network can be reassigned to a different physical networkadapter from the Virtual Server Administration Web page by clickingConfigure in the Virtual Network section and selecting the virtualnetwork to edit.

� The Microsoft Loopback adapter is seen as a physical adapter and isused to bridge a virtual machine to the host’s network connection.

154 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 154

Page 180: Virtualization With Microsoft Virtual Server 2005 (2006)

Using the Virtual Server Network Services

� DHCP server is available for every virtual network but is disabled bydefault.

� This service can only be used by the virtual machines on a virtualserver and cannot service any outside requests.

� It avoids the necessity of loading a DHCP server on a virtualmachine using an internal network.

Q: Why would I want to use an internal virtual network?

A: The internal virtual network is a good choice for isolating one or morevirtual machines for the external network connections.This may be doneas part of a DMZ or to isolate a set of virtual servers for testing.Theinternal network is also very useful for connecting the host and guest vir-tual machines for sharing files and other resources connected to the hostcomputer.

Q: Can I provide additional network information when using the DHCPservice on the virtual network?

A: No. The DHCP server available to the virtual network is a simple service.It can only provide basic addressing information, default gateway, DNS,and WINS server addresses. If you require the capability to provide addi-tional information using DHCP, you should set up a DHCP server on avirtual machine or use an external DHCP server.

Virtual Networks • Chapter 4 155

Frequently Asked Questions

The following Frequently Asked Questions, answered by the authors of this book,are designed to both measure your understanding of the concepts presented in this chapter and to assist you with real-life implementation of these concepts. Tohave your questions about this chapter answered by the author, browse towww.syngress.com/solutions and click on the “Ask the Author” form.

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 155

Page 181: Virtualization With Microsoft Virtual Server 2005 (2006)

Q: What is a practical limit to the number of virtual networks available on avirtual server?

A: Although technically there is no limit, the practical limit is 256 virtualnetworks on a virtual server.This is calculated as 64 virtual machines, thepractical limit of virtual machines for a virtual server times four, thenumber of virtual network adapters a virtual machine can support.Youcan have more virtual networks than this but they will not have any con-nections so they will use any resources.

Q: Do I have to create a new virtual network adapter to connect to a dif-ferent virtual network?

A: No.A virtual network adapter can be connected to any virtual network byediting the properties of the virtual network adapter and selecting thedesired virtual network.You may need to reconfigure the TCP/IPaddressing of the virtual adapter when you switch virtual networks.A vir-tual network adapter can only be connected to a single virtual network ata time.

Q: Can I use a network team adapter set?

A: A teamed set of physical network adapters can be used for a virtual net-work.The network team must be in place before creating the virtual net-work.You cannot team virtual network adapters.

Q: What happens if I remove a virtual network without disconnecting thevirtual servers connected to it?

A: All the virtual network adapters connected to the removed virtual net-work will simply become disconnected.You will need to connect the vir-tual network adapters to another virtual network or you can connect thento a new virtual network when you create it.All connections to the net-work resources being accessed by the removed virtual network will alsobe lost. It is best to make sure all virtual machines are removed from thevirtual network before removing it to avoid any data loss from the suddendisruption of service.

156 Chapter 4 • Virtual Networks

406_VIRTUAL_04.qxd 9/8/06 6:43 PM Page 156

Page 182: Virtualization With Microsoft Virtual Server 2005 (2006)

Virtual Disks

Solutions in this chapter:

■ Removable Virtual Disks

■ Virtual Hard Disks

Chapter 5

157

� Summary

� Solutions Fast Track

� Frequently Asked Questions

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 157

Page 183: Virtualization With Microsoft Virtual Server 2005 (2006)

IntroductionVirtual machines have many properties that are similar to physical machines.When configuring a virtual machine, the most important properties arememory and disks, because they have the most impact on the host.As withphysical machines, virtual machines contain an operating system, applications,and data. Depending on its role, the virtual machine may have one or manyvirtual hard disks.

Most applications these days are disk I/O intensive.These applicationsperform many read and write operations from and to the hard disk, so perfor-mance is basically determined by the underlying disk I/O subsystem. Whenthey perform heavy disk I/O they are called disk bound.

Disk I/O in a physical machine is basically the slowest I/O compared toprocessor and memory I/O; therefore, a good performing storage subsystembenefits performance of those applications and, as such, overall performanceof the virtual machine.

Removable Virtual DisksVirtual Server provides its virtual machines with several types of disks.Thesedisks are not physical disks; this would not scale well with many virtualmachines and many disks in each virtual machine.

Virtual Server emulates disks, which are called virtual disks.To a guestoperating system inside a virtual machine, these virtual disks are the same asthose in a physical machine.They behave the same and have the same limita-tions, determined by their emulated characteristics.

Virtual Server emulates different kinds of disks that are common in today’sphysical machines.Those can be categorized as either removable disks or harddisks.

Removable disks can be CD/DVD disks or floppy disks.These disks canbe used through their emulated disk drive.

158 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 158

Page 184: Virtualization With Microsoft Virtual Server 2005 (2006)

CD/DVD DriveVirtual Server supports the use of removable media such as CD or DVDoptical disks. Because a DVD drive also supports CDs, Virtual Server emulatesa DVD drive.

The DVD drive in a virtual machine can be captured to the host CD orDVD drive.

Configuring & Implementing…

Virtual Server TerminologyVirtual Server uses the term attach to denote a link or connectionbetween a virtual machine and a device. When a CD/DVD drive isattached, this means that the virtual machine contains a CD/DVD drive.The attachment points to the channel and ID the CD/DVD drive exists on.For example, the CD/DVD drive can be attached to the Primary IDEchannel with device ID 1.

Virtual Server uses the term capture to denote a link between the vir-tual machine’s CD/DVD drive device and the host. When the CD/DVD driveuses the host’s DVD drive, it is said to be captured to the host’s drive. Ifnothing has been captured, the virtual machine still has a CD/DVD drive,but there is nothing in it.

When the CD drive of the host has been captured to the CD/DVD drivein the virtual machine, then the CD/DVD drive is limited to the host drivecharacteristics. In this case, the host drive can only read CDs and the virtualmachine accepts any format the host supports. So despite the fact that VirtualServer emulates a DVD drive, you can capture the host’s CD drive.

When the host drive is a DVD drive, the captured CD/DVD drive in thevirtual machine accepts any disc format up to any DVD standard. Forexample, when you put a 4.7GB DVD+RW disc in the host drive, the virtualmachine is able to access the contents. However, you cannot write to themedia from within the virtual machine; Virtual Server emulates a read-onlyDVD drive.

Virtual Disks • Chapter 5 159

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 159

Page 185: Virtualization With Microsoft Virtual Server 2005 (2006)

A virtual machine can have up to four CD/DVD drives in a virtualmachine.These can all be attached to the host given the condition that thehost has four drives of type CD/DVD.You cannot capture the same hostdrive to more than one CD/DVD drive.

The storage architecture type of a CD/DVD drive is IDE (IntegratedDrive Electronics).A virtual machine has two IDE channels: primary and sec-ondary. Each channel supports two drives.This is where the limit of fourCD/DVD drives per virtual machine comes from.

NOTE

When using IDE virtual hard disks, the number of CD/DVD drive attach-ments is limited to what remains of the four IDE device IDs. When usingtwo virtual hard disks attached to IDE, there remain two device IDs forCD/DVD drives.

You are not limited to capturing a host CD or DVD drive.You can cap-ture a so-called image file to a DVD drive.This image file must be in the ISO9660 format and contain the extension ISO. For Virtual Server 2005, the sizelimit of the ISO file is 2.2 GB. For Virtual Server 2005 R2, there is no sizelimit on the ISO image you can attach. Notice that this enables you to uselarger ISO images than your host drive supports.

Using ISO images with CD/DVD drives enables you to use CD or DVD“media” in a virtual machine without the need for a physical drive. Because itis a read-only device, you can attach a single ISO to multiple virtualmachines.And contrary to capturing multiple DVD drives to the same hostdrive, you can capture the same ISO image to multiple CD/DVD drives.

To modify the properties of a virtual machine’s CD/DVD drive, open thevirtual machine’s Properties page and click CD/DVD.The CD/DVD DriveProperties window opens, similar to Figure 5.1.

160 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 160

Page 186: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 5.1 CD/DVD Drive Properties

From this window you can modify the virtual CD/DVD drive attach-ment, its capture status, or you can add another CD/DVD drive.

Floppy Disk DriveAnother type of removable media Virtual Server supports is the virtualfloppy disk. Virtual Server emulates a 1.44MB 3.5-in. read/write floppydisk drive.This drive supports virtual floppies with sizes of 720 KB, 1.44MB and 1.68 MB.

Each virtual machine contains one virtual floppy disk drive.This floppydisk drive can be captured to the host floppy disk drive or it can beattached to a virtual floppy image file which has the extension VFD.

To modify the properties of a virtual machine’s floppy disk drive, openthe virtual machine’s Properties page and click Floppy drive.The FloppyDrive Properties window opens, similar to Figure 5.2.

Virtual Disks • Chapter 5 161

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 161

Page 187: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 5.2 Floppy Drive Properties

Notice from the figure that there is no attachment property. Every virtualmachine contains one floppy disk drive, no more, no less.Also notice that theoption to capture a physical floppy disk drive is grayed out; this host does notcontain a physical floppy disk drive.

Virtual floppy disks can be created from the Virtual Server interface as fol-lows. From Virtual Disks, select Create, and then click Virtual FloppyDisk.You will be presented with the interface similar to that shown in Figure 5.3.

Select the desired location or type the full path and the name of the vir-tual floppy disk to create.You do not have to type the extension; just thename of the floppy disk suffices.

162 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 162

Page 188: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 5.3 Creating a Virtual Floppy Disk

NOTE

You can also create virtual floppy disks with a shareware product calledWinImage. The advantage of WinImage is that you can modify thefloppy image’s contents from the host. Using Virtual Server you can onlymodify floppy disk drive contents from within the virtual machine. Youcan download WinImage from www.winimage.com.

As mentioned earlier, there is always one virtual floppy disk drive in a vir-tual machine. But when you examine the virtual machine’s BIOS configura-tion, you may have noticed that you can configure two floppy disk drives. SeeFigure 5.4 for the BIOS Setup screen.

By default, only dive A has been enabled. When you enable drive B aswell, the guest operating system detects the drive.

Virtual Disks • Chapter 5 163

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 163

Page 189: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 5.4 Floppy Configuration in the Virtual Machine BIOS

However, you cannot use drive B. Virtual Server supports only one floppydisk drive, which is implicitly attached as the first floppy disk drive.Thesecond floppy disk drive is attached as well, but you cannot capture anythingto it.

You should also not modify the drive characteristics; for example,changing the drive option from 3.5 inches to 5.25 inches.The guest oper-ating system detects drive A to be a 5.25-in. drive. However, you can only usethe sizes mentioned earlier and only on drive A. Figure 5.5 shows all floppydisk drive options.

NOTE

When you disable drive A and enable drive B, the power-on self test willfail and report an error. The virtual machine will not boot until you pressF1.

164 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 164

Page 190: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 5.5 Floppy Disk Drive Size Options in the Virtual Machine BIOS

A host floppy disk drive can be captured to the virtual floppy disk drive.However, the required format and sizes still apply.This means that a 5.25-in.host drive or 3.5-in. with 2.88MB floppy disks are not supported.

From the previous discussion it should be clear that you should notmodify the floppy configuration in the BIOS.There is no need for modifica-tion there. If you do not want a virtual floppy disk, simply don’t attach any inthe virtual machine configuration. If you do not want a floppy disk drive inthe virtual machine, you have to disable drive A.

Virtual Server creates virtual floppy disks read/write by default.Remember that a virtual floppy disk is just a file and that it is created as awritable file by Virtual Server. When you want multiple virtual machines to beable to read the same floppy disk, this fails when the floppy disk has not beenmade read-only.The floppy disk gets locked by the running virtual machinewhere it is captured.

Recall from the time we all used floppy disks that making a floppy diskread-only meant moving the write-protection tab in the write-protect posi-tion. When you did, the tab was moved so the floppy disk had two holes in it(for a 1.44MB floppy disk). Figure 5.6 symbolically displays the default1.44MB floppy disk status after creating a virtual floppy disk calledFloppy.vfd.

Virtual Disks • Chapter 5 165

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 165

Page 191: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 5.6 Writable Virtual Floppy Disk

So how do you move the write protection tab on a virtual floppy disk?By making the file read-only. Simply setting the read-only attribute on thefile makes it read-only.Then you can have multiple virtual machines capturethe same virtual floppy disk. Figure 5.7 symbolically shows the floppy diskstatus when setting the read-only attribute on the virtual floppy disk calledFloppy.vfd.

Figure 5.7 Read-Only Virtual Floppy Disk

Virtual Hard DisksThe previous paragraphs discussed removable media. Virtual Server supportswriting to virtual floppy disks and reading from virtual CD or DVD media.But these media are generally used only for installation tasks or transfer ofsmall files. Installation of an operating system requires a hard disk.And so doapplications for retrieving and storing data.

Virtual Server provides virtual machines with hard disks.These disks arenot physical disks; therefore, Virtual Server emulates them.To a guest oper-ating system in a virtual machine, however, this is completely transparent.Theguest operating system is only aware of the size of the disk and type ofstorage architecture.

166 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 166

Page 192: Virtualization With Microsoft Virtual Server 2005 (2006)

Configuring & Implementing…

Storage ArchitectureA virtual hard disk can be attached to two types of storage architecture:IDE (ATA) or SCSI.

Virtual IDE (Integrated Drive Electronics) supports two channelscalled the primary and secondary. Each channel supports two devicescalled the master and the slave. In a virtual machine the master is device0, the slave device 1. The size limit of a virtual hard disk attached to IDEis 127 GB.

Virtual SCSI (Small Computer Systems Interface) supports four busesand 28 devices. Each virtual machine can have up to four SCSI controllers.Each controller can be set to either SCSI ID 6 or 7. The IDs of multiple SCSIcontrollers may be the same because each controller exists on its own bus.The size limit of a virtual hard disk attached to SCSI is 2 TB. SCSI supportsmultiple simultaneous disk transactions.

The choice of architecture is determined by several factors.

■ Performance For best performance you should attach the vir-tual hard disks to SCSI.

■ Maximum number of IDE drives Recall that the CD/DVDdrive can only be attached to IDE. This leaves three virtual harddisks to be attached to IDE. With SCSI you can have seven vir-tual hard disks per controller. This gives you much more flexi-bility in storage and leaves enough options for CD/DVD drivesattached to IDE.

■ Maximum size of IDE virtual disks When the maximum disksize of IDE is a limitation, you must use SCSI.

■ SCSI clustering Use SCSI clustering when you need to createan MSCS cluster between two virtual machines.

Besides the storage architectures mentioned above, Virtual Serversupports using SAN and iSCSI. But these storage technologies are notavailable as attachments for virtual hard disks. These can be used fromthe operating system point of view. However, there is no support for SANin a virtual machine; you cannot add hardware (HBA) to a virtual machine.

Virtual Disks • Chapter 5 167

Continued

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 167

Page 193: Virtualization With Microsoft Virtual Server 2005 (2006)

Virtual Server emulates storage; it does not virtualize the host’s storage.But you can store the virtual disks on a LUN assigned to the Virtual Serverhost.

You can also use iSCSI with Virtual Server for storing the virtual harddisks. You can use iSCSI within the virtual machines because iSCSI requiresonly a network adapter. iSCSI must be used in production scenarios forvirtual machine clustering and clustering of applications using MSCS.

A virtual hard disk is a file on the host disk.This makes the virtual harddisk storage-architecture-agnostic. In the physical world there is a differencebetween an IDE and a SCSI hard disk. For Virtual Server these disks are thesame, only their attachment makes the difference.You can change the attach-ment of disks between IDE and SCSI. Notice, however, that Virtual Serverwill not attach a virtual hard disk larger than 127 GB to IDE.

One property that you cannot change after you have created a virtual harddisk is the size.The size is an internal property of the virtual disk that is set attime of creation.This size is also called the logical size because it has no directrelation with the virtual disk file size.

As with planning a physical machine’s storage configuration, you shouldactually plan even more with virtual machine storage.You should realize thata virtual disk is a file that is stored on the host disk.All reads and writes aredone from and to this single file. Rapid access to this file should be as optimalas possible.

Virtual Server contains three types of virtual hard disk.To a guest operatingsystem in a virtual machine, those are all the same. But to you, as an adminis-trator of Virtual Server, the difference is significant and good understanding ofeach type enables you to create numerous virtual machine scenarios.

The next paragraphs cover the various virtual hard disk types and theirusage.

Dynamically Expanding Virtual Hard DiskWhen you create a new virtual machine using the Create Virtual Machinepage, the Virtual Server Administration Web site defaults to a virtual hard diskof 16 GB in size, attached as the first disk to the Primary IDE channel.Thishard disk is of type dynamically expanding.

168 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 168

Page 194: Virtualization With Microsoft Virtual Server 2005 (2006)

A dynamically expanding virtual hard disk is a virtual disk that grows asspace is needed.To be a bit more precise, it is a file on the host that getsexpanded by Virtual Server upon write requests when more storage space isneeded on the virtual hard disk and the logical size has not been reached.When necessary, Virtual Server keeps expanding the disk, but only up to itslogical size or when the host disk is full.

The advantage of this type should be obvious. It enables you to create anysize of virtual disk without allocating the same amount of space on the host.No matter what logical size you choose, a dynamically expanding disk startsas a file of approximately 35 KB in size.

The fact that you can create practically any size of virtual disk without theneed of the same amount of available disk space on the host requires planningbecause the disk may grow beyond the available disk space, thereby creating a“disk full” situation.

Probably the less obvious disadvantage of this type is fragmentation of thefile. Because this virtual disk starts as a very small file and grows over time, itis likely to get fragmented. Fragmentation may get worse with multiple vir-tual hard disks of this type on the same volume. Realize that this file is a harddisk of a virtual machine. Many servers these days contain tens of gigabytes ofallocated disk space, which would result in a file on the host of tens of giga-bytes in size.

Virtual Server expands the dynamically expanding disk when necessary.This means that there is some overhead involved with expanding the disk.The overhead may not be noticeable; performance degradation is more likelyto occur due to fragmentation. However, even when the virtual disk file iscontiguous, there is some overhead.

In what scenario would you use a dynamically expanding disk? For thosevirtual machines that you don’t know how much space their disks will finallytake up. In that scenario, you assign a logical disk size large enough to hold itscontents.

The final virtual disk size (file disk allocation) on the host is approxi-mately what is actually needed by the guest. If necessary, you can convert thedisk to a different type.This is discussed later under “Converting.”

Virtual Disks • Chapter 5 169

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 169

Page 195: Virtualization With Microsoft Virtual Server 2005 (2006)

You can create the dynamically expanding disk through Virtual Disks.Select Create and click Dynamically Expanding Virtual Hard Disk. SeeFigure 5.8 for a reference.

Figure 5.8 Creating a Dynamically Expanding Virtual Hard Disk

The default size in the Virtual Server Administration Web site is 16 GB.Notice from the figure that you do not have to specify the virtual hard diskextension (vhd) in the filename. Consider the virtual hard disk’s storage archi-tecture you plan to use when specifying its size.Anything larger than 127 GBrequires SCSI.

CompactingAfter you have your virtual machine up and running, you may notice that thecurrent size of the virtual disk file on the host does not correspond to what isallocated in the guest. For example, you may notice a disk file of 8 GB,whereas the guest operating system reports that only 4 GB has been allocated.

In such a situation, files that had obviously been deleted are stored on thevirtual disk.These files still exist and allocate space in the virtual hard diskfile.The guest operating system can reuse this space for other files. However,Virtual Server had previously expanded the file because there was insufficient

170 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:50 PM Page 170

Page 196: Virtualization With Microsoft Virtual Server 2005 (2006)

disk space but cannot shrink the file because it does not know which fileshave been deleted.

When a file is deleted, it still exists on the file system.This is a file systemaspect and not related to either virtual or physical machines. Files that havebeen deleted are only marked as deleted, thereby indicating that the spacethey occupy is available for use. But those files still exist if they have not beenoverwritten.

Since all files in the guest are actually written in a single file on the host,there needs to be a mechanism for Virtual Server to reclaim space of thosedeleted files to reduce the virtual hard disk file.

This mechanism is called compaction and is made up of two distinctphases.The first is the so-called pre-compaction phase, which prepares thevirtual hard disk for compaction later by Virtual Server. Pre-compaction isrun from within the guest operating system.The second phase is the com-paction phase, which is run from Virtual Server when the virtual machine isturned off.

So what exactly is pre-compacting? Recall those deleted files on the filesystem.They are still there but only marked as deleted.You need to enableVirtual Server to reclaim the space (reduce the hard disk file) by zeroing outthe sectors they occupy.This is what pre-compaction does; it writes zeroes bywriting large files with zeros on the available space. By filling the availablespace with those large files, it overwrites all files which are marked as deleted.This continues until there is no space left to write.At that point, everythinghas been zeroed out.

NOTE

Virtual Server 2005 did not come with a pre-compaction tool. This wasincluded with Virtual PC 2004. This has been added to Virtual Server2005 R2. It is called the Microsoft Virtual Disk Pre-Compactor. If youwant, you can use it with Virtual Server 2005 as well. There is no depen-dence on Virtual Server release, it just was not included.

You run the Microsoft Virtual Disk Pre-Compactor by attaching thePrecompact.iso to the CD/DVD Drive.This is an example of a situation

Virtual Disks • Chapter 5 171

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 171

Page 197: Virtualization With Microsoft Virtual Server 2005 (2006)

where you must have a CD/DVD drive in a virtual machine.To start pre-compaction, perform the following steps. Under Virtual Machines, clickConfigure <virtualmachine>, click CD/DVD, click Known imagefiles, and then select Precompact.iso. See Figure 5.9.

Figure 5.9 Attaching Virtual Disk Pre-Compactor ISO to a CD/DVD Drive

When the virtual machine is running a guest operating system ofWindows 2000 or later, the Microsoft Virtual Disk Pre-Compactor will auto-matically start and show the dialog box shown in Figure 5.10. Notice that itwill automatically start only when autorun has not been disabled.

Figure 5.10 Microsoft Virtual Disk Pre-Compactor

When you click yes, the Virtual Disk Pre-Compactor will perform itswrite activities on all logical drives.As explained earlier, the Pre-Compactor

172 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 172

Page 198: Virtualization With Microsoft Virtual Server 2005 (2006)

will write large files to the disk(s).You can see its progress by opening a com-mand prompt in the root of the logical drive. See Figure 5.11, which lists thezeroing files written in the root.

Figure 5.11 Listing the Pre-Compactor Zeroing Files

The Microsoft Virtual Disk Pre-Compactor starts writing its first filestarting with ZERO0000.tmp.As long as the disk is not full, it keeps writinguntil the disk is full or the file has reached 1 GB in size. If not full, it con-tinues with the next file, using the last four digits to increase the number.

Configuring and Implementing…

Preparations before Pre-compactingIt is very important to delete any file that can be deleted at this stage. Forexample, if there are temporary files left by applications, you shoulddelete these, empty the Recycle Bin, delete obsolete files from previousprocesses, etc. You should basically delete anything that can be deletedbefore running the Pre-Compactor.

Virtual Disks • Chapter 5 173

Continued

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 173

Page 199: Virtualization With Microsoft Virtual Server 2005 (2006)

After deleting files, you should run a defragmentation tool to opti-mize sector occupation of the files that remain. Fragmented files aredefragmented, which benefits both performance and compaction. OnWindows, you can defragment using Microsoft defrag, or you can usecommercial products.

Only after these steps have been performed should you run the Pre-Compactor.

When the Virtual Disk Pre-Compactor has finished, you will see a dialogbox like the one shown in Figure 5.12.At that point you should shut downthe operating system to prevent any unnecessary file modifications on thedisk. Notice that the text mentions a Virtual Disk Wizard.This does not existin Virtual Server; this applies to Virtual PC 2004.

Figure 5.12 Microsoft Virtual Disk Pre-Compactor Completion

The Pre-Compactor can also be invoked manually.There are severalswitches you can provide.You can list all available switches by providing pre-compact.exe with /? switch. See Figure 5.13.

Figure 5.13 Virtual Disk Pre-Compactor Command-Line Switches

174 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 174

Page 200: Virtualization With Microsoft Virtual Server 2005 (2006)

The most important switch is the setdisks switch. When you have virtualmachines with multiple disks, you may not want pre-compaction to run onall of them but only on a specific one. Or you may be using virtual disksother than the dynamically expanding type on which pre-compaction is use-less (see later discussions).The silent switch enables unattended operation sothat you can automate pre-compaction using script.

After pre-compaction has completed, you should shut down the virtualmachine.The next phase is the compaction phase.To compact a virtual disk,perform the following steps. From Virtual Disks, click Inspect, select thevirtual disk to inspect or type the location of the virtual disk, click theInspect button, click Compact virtual hard disk, and then clickCompact.

Figures 5.14, 5.15, and 5.16 show the Virtual Server interfaces along thesesteps.

Figure 5.14 Inspect Virtual Hard Disk

Virtual Disks • Chapter 5 175

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 175

Page 201: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 5.15 Virtual Hard Disk Properties after Inspection

Figure 5.16 Compact Virtual Hard Disk

When Virtual Server compacts the virtual disk file, it rewrites the file,ignoring everything that has been zeroed out.After compaction, the size ofthe virtual disk file should be approximately equal to the amount of allocatedspace in the virtual machine.

176 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 176

Page 202: Virtualization With Microsoft Virtual Server 2005 (2006)

NOTE

The compaction process of Virtual Server has no understanding of a pre-compacted disk. You can run compaction as often as you like withoutpre-compacting a virtual disk. However, you will find that you do notreclaim much space without the pre-compaction phase.

ConvertingThe dynamically expanding virtual disk can be converted to a fixed-sizevirtual disk.That type is covered in the next paragraph. When converting toa fixed-size virtual hard disk, the physical size of the virtual disk image filewill be the same as the logical size.

NOTE

Converting the dynamically expanding disk leaves the original disk intact.Technically, you are not converting the disk but migrating to anothertype.

You can convert a virtual hard disk only when the virtual machine isturned off.The steps are the same as described earlier for compaction. SeeFigure 5.15; instead of Compact virtual hard disk, you have to clickConvert virtual hard disk.This leads to the screen shown in Figure 5.17.

Virtual Disks • Chapter 5 177

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 177

Page 203: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 5.17 Convert Virtual Hard Disk

Fixed-Size Virtual Hard DiskThe fixed-size virtual hard disk is exactly the opposite of the dynamicallyexpanding virtual hard disk. Whereas the latter is expanded by Virtual Serveras space in the disk is needed, the physical size of the fixed-size disk is at thelogical size after creation.

The fixed-size disk is what it is called; fixed in size.This size, however, isthe physical size of the disk file and is the same as the logical size. But thelogical size is still fixed.The purpose of the fixed-size disk is to allocate thespace on the host disk so Virtual Server does not have to “interfere” in anexpansion process.This means that there is no overhead when writing to thisvirtual hard disk type.

The disadvantage should also be obvious; the logical size you choose forthis disk will also be the physical size on the host.This requires more planningand capacity management on the host.

When Virtual Server creates this disk, it writes a sparse file filled withzeroes.This way it makes sure the amount of space is pre-allocated on thehost disk. From a fragmentation perspective, this type of virtual disk is notlikely to get fragmented, assuming that the host disk was defragmented prior

178 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 178

Page 204: Virtualization With Microsoft Virtual Server 2005 (2006)

to creating the virtual disk and that there was enough space to create a con-tiguous file.

To create a fixed-size disk through Virtual Disks, select Create and clickFixed Size Virtual Hard Disk. See Figure 5.18 for a screen reference.

Figure 5.18 Creating a Fixed-Size Virtual Hard Disk

In this window, a fixed-size virtual disk is being configured with nameDisk1-F and logical size of 500 GB. Recall from the previous discussion thatyou should consider the type of storage architecture the disk will be attachedto.The virtual disk of Figure 5.18 demands SCSI.

ConvertingThe fixed-size disk can be converted to dynamically expanding.You maywant to do this when the disk does not require the amount of space you ini-tially configured. For example, when you have created a 50GB fixed-size diskbut only use 8 GB in the virtual machine, a conversion will result in an 8GBdisk. Notice that its logical size is still 50 GB; that will never change.

Virtual Disks • Chapter 5 179

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 179

Page 205: Virtualization With Microsoft Virtual Server 2005 (2006)

NOTE

Converting the fixed-size disk leaves the original disk intact. Technically,you are not converting the disk but migrating to another type.

The steps required for converting to a dynamically expanding disk are thesame as for converting a dynamically expanding disk to fixed size. See the dis-cussion on converting under the section “Dynamically Expanding VirtualHard Disk.”

Differencing Virtual Hard DiskA rather interesting type of virtual hard disk is the differencing virtual harddisk. Compared to the other virtual disk types, this one is quite different.The dynamically expanding and fixed-size types are basically each other’sopposite.This gives you a lot of flexibility when configuring disks for vir-tual machines. But the differencing disk enables scenarios the other types donot offer.

The differencing disk is a virtual hard disk that contains the differencescompared to a reference, called the parent virtual disk.The differencing diskis a “recording” of changes to the parent. Assume the situation as shown inFigure 5.19. A virtual machine is configured with a single virtual disk,Disk1.The virtual disk is a differencing disk with one parent.

Logically, the differencing disk is one virtual disk consisting of a singledisk file. A guest operating system in the virtual machine reads from andwrites to its “physical” disk because it has no notion of running inside a vir-tual machine. But physically on the host, Virtual Server divides these opera-tions between two virtual disk files: the write operations to the differencingdisk and the read operations from both.

180 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 180

Page 206: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 5.19 Differencing Disk View Points

To create a differencing disk, go to Virtual Disks, select Create, andthen click Create Differencing Virtual Hard Disk. See Figure 5.20 for areference.

Figure 5.20 Creating a Differencing Virtual Hard Disk

Virtual Disks • Chapter 5 181

Differencing

Virtual Server

Virtual Machine

Disk1

Fixed Size /Dynamically Expanding

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 181

Page 207: Virtualization With Microsoft Virtual Server 2005 (2006)

In this figure, a virtual disk Machine2 is created with virtual diskMachine1 as its parent.

When would you use differencing disks? Assume that you have a virtualmachine, Machine1, with a disk of type dynamically expanding.You installWindows Server 2003 on this machine (so on the disk).After installation youshut down Windows Server 2003 and create a new virtual machine,Machine2.Then you create a differencing disk for Machine2. See Figure 5.20.You call that disk Machine2.vhd. Finally, you configure Machine2 to use thenewly created disk as its first disk. When you turn on Machine2, you noticeWindows Server 2003 booting…

The magic behind all this lies in the nature of differencing disks. VirtualServer treats the two disks, the parent and the differencing disk, as one logicaldisk.The virtual machine has only one disk. But under the hood, VirtualServer manages all reads from both disks and writes to the differencing disk.

Because the parent is treated as read-only, you can create multiple differ-encing disks using the same parent. Multiple virtual disks can then be usedwith multiple virtual machines. For example, you could create one parentwith 10 children.And these 10 children could be used with 10 different vir-tual machines.And this scenario requires only a single installation of WindowsServer 2003.

NOTE

In the scenario described above, each virtual machine uses differencingdisks with the operating system on a parent disk. When these virtualmachines are to be used in a network or in a domain, remember tomake each operating system unique. Otherwise, you may run into TCP/IPaddress conflicts, NetBIOS name conflicts, or SID conflicts when used inthe same domain.

To create unique Windows virtual machines or unique children, runsysprep in the guest operating system of the parent as the last step. Thisway, each guest operating system in a child will run mini-setup and offeruniqueness in name and SID.

182 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 182

Page 208: Virtualization With Microsoft Virtual Server 2005 (2006)

As with the previous virtual disk types, the differencing disk type hassome aspects to consider.The differencing disk contains all modifications toits parent. Consecutive modifications are also recorded into this disk. Basically,the differencing disk contains only updates to its parent and can be viewed asa transaction log.

Due to this nature, the differencing disk can only grow.This means thatfile modifications of file modifications are appended to the virtual disk file.Recall that with the other types, modifications are written to the files them-selves and that deleted files’ space can be reused.This is not true for the dif-ferencing disk, because any modification is recorded, which is yet anotherappend to the file.

When you use the differencing disk in the Windows Server 2003 scenarioas depicted above, you will notice that the virtual disk file grows quitequickly. Simply booting the virtual machine can cause a differencing disk of acouple of hundreds of megabytes.This is caused by the fact that once theoperating system boots, writes occur to many different files, such as log filesand registry files.

However, the differencing disk can be compressed very well. Using NTFScompression, you can dramatically reduce the size of the file on the host.Thecompression ratio can be enormous, depending on what gets written to thedifferencing disk. When only updates are recorded, the compression ratio willbe much larger than when you have copied compressed files to it.

Configuring and Implementing…

Using NTFS CompressionYou might wonder about the performance impact of file system com-pression on the host CPU. The overhead is a couple of percentages so thisshould be negligible from CPU perspective.

You should not consider the impact on CPU load but rather the ben-efit the extra CPU load gives from a disk I/O perspective.

When files have a good compression ratio, file I/O is much less thanwithout compression. This results in much faster I/O than would be

Virtual Disks • Chapter 5 183

Continued

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 183

Page 209: Virtualization With Microsoft Virtual Server 2005 (2006)

achieved without compression. This is caused by disk I/O that is extremelyslow compared to the processing power of the CPU. By leveraging CPUpower, you prevent a lot of slow disk I/O.

You should always use NTFS compression on files that really com-press well. This increases throughput. Of course, it makes no sense tocompress already compressed files; this only increases overhead.

Figure 5.21 shows the result when using NTFS compression on a differ-encing disk.

Figure 5.21 Using NTFS Compression on a Differencing Virtual Hard Disk

The figure displays the Size on disk of the virtual hard disk Disk1-D fromvirtual machine Machine3. Without compression, this file would take up 662MB. With compression, it takes approximately 33 MB.

So here is a tip when using differencing disks: always compress them usingNTFS compression.

184 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 184

Page 210: Virtualization With Microsoft Virtual Server 2005 (2006)

Since the differencing disk can only grow, it becomes large very quickly.Without NTFS compression the file on the host is likely to get fragmented. Itmay still get fragmented with compression enabled, but this is usually muchless. In both cases, you have to consider fragmentation and schedule defrag-mentation jobs.

You should also be aware of the fact that the parent may not change oncethe differencing disk is created. Recall that the differencing disk contains thedifferences relative to the parent.Those differences could become obsoletewhen the parent’s contents were changed. Compare this with a database andits transaction logs; if you change the database before committing the log, thisinvalidates the changes in the log.

When a differencing disk is created, Virtual Server stores informationabout the parent in the differencing disk file. Both the header and footer ofvirtual disks contain information. So does the differencing disk file when it iscreated.The last modified time as well as the GUID of the parent disk arestored in the differencing disk file. Based on the time stamp, Virtual Server isable to warn you, but not block you, when it detects that the parent’s timestamp has been changed.As a best practice, make the parent virtual disk read-only.

The parent’s GUID is necessary to create a strong relationship.This rela-tionship can never be changed. But when Virtual Server cannot find theparent virtual disk, you can update the differencing disk through the VirtualDisks interface by inspecting the differencing disk and pointing to the newlocation of the parent.

NOTE

The relation of a differencing disk with its parent is stored in the differ-encing disk. Every virtual hard disk contains a GUID, which is used touniquely identify the parent.

The differencing disk also stores both the relative path and the fullyqualified path to its parent. When Virtual Server cannot find the parentusing the relative path, it will try the absolute path. Virtual Server willnot update the location information when it uses the absolute path.Only when it cannot find the parent will Virtual Server notify in theEventLog. The relation needs to be updated using Inspect and pointing

Virtual Disks • Chapter 5 185

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 185

Page 211: Virtualization With Microsoft Virtual Server 2005 (2006)

to the parent. When the GUIDs match, Virtual Server updates both rela-tive and absolute location information.

For more information on virtual hard disks, refer to the Virtual HardDisk Image Format Specification available at www.microsoft.com/win-dowsserversystem/virtualserver/techinfo/vhdspec.mspx.

The logical properties of the parent are inherited with the differencingdisk. For example, the logical disk size is still the same. But the amount ofdisk space available on the virtual disk is what remained on the parent. Donot expect to extend a disk with a differencing disk when it has become full;the differencing disk will also be full.

ChainingThe fixed-size and dynamically expanding virtual disks can be a parent to a dif-ferencing disk. However, this is not the complete story.Actually, any virtual disktype can be a parent to a differencing virtual disk. So can a differencing disk. Insuch a scenario, there is more than one differencing disk “below” the disk in thevirtual machine.There is actually a chain of links from the last differencing diskto the last or top parent; this is called chaining. See Figure 5.22.

Figure 5.22 Chaining Differencing Disks

186 Chapter 5 • Virtual Disks

Differencing Differencing

Virtual Server

Virtual Machine

Disk1

Fixed Size /Dynamically Expanding

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 186

Page 212: Virtualization With Microsoft Virtual Server 2005 (2006)

This picture has the same logical view from both virtual machine andVirtual Server as that shown in Figure 5.19. However, the physical disk in thevirtual machine is built up of three virtual disks: two differencing disks andone dynamically expanding or fixed-size disk.

With chaining, the same rules apply as with a single differencing disk: alldisks in the parent chain are treated as read-only; only the differencing diskattached to the virtual machine is read/write. None of the parents maychange, as previously explained.Any change in the parent chain invalidates thedifferencing disk.

When would you use chaining? When you want to postpone changes tothe parent. Let’s take an example and see how chaining could enable that.

Suppose you have a Microsoft Exchange Server 2003 server with ServicePack 1.And suppose you want to test Service Pack 2 on the server withoutmaking the changes permanent while being able to research its functionalityfirst.You create a differencing disk with the Exchange server’s first disk.Youcreate a new virtual machine called ExchangeSP2 and start it with the newlycreated differencing disk.Then you apply Service Pack 2 and do yourresearch. If you want to revert to the original scenario you can discard thisdisk and start the original server with Service Pack 1. Or when you are happywith Service Pack 2 and want to keep the changes, you can keep them.

MergingIn the scenario above with the Exchange Server, you could either discard thechanges or keep them.The process of applying the changes to your originalconfiguration is called merging.

You have two choices when merging changes: you can merge them intothe parent, thereby overwriting the original virtual hard disk, or you canmerge them into a new virtual hard disk.

NOTE

There is a fundamental difference in merge scenarios.When you choose to merge with the parent, all changes are written

into the parent and the original parent’s content is lost. You end up withthe new configuration as if you applied them directly to the parent.

Virtual Disks • Chapter 5 187

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 187

Page 213: Virtualization With Microsoft Virtual Server 2005 (2006)

When you choose to merge to a different disk you merge all changesin the chain. So when you have three disks in the chain, you write a newdisk that has all updated content from all the disks in the chain.

If you want to merge differencing disks, the virtual machine must beturned off.To merge a virtual disk, go to Virtual Disks, click Inspect, andthen select the virtual disk you want to inspect. Figure 5.23 shows the resultsafter inspection of a virtual disk.

Figure 5.23 Differencing Disk Chain After Inspect

Notice that the results show a chain of disks; C:\VirtualMachines\Fixed-500 is a parent of C:\VirtualMachines\Machine1\Disk1-D, which in turn is aparent of C:\VirtualMachines\Machine1\Machine1-1\Disk1-D.Also noticethe maximum virtual hard disk size, which is 500 MB.This is inherited fromthe fixed-size disk, Fixed-500. Clicking Merge virtual hard disk results inFigure 5.24.

188 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 188

Page 214: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 5.24 Merging Virtual Hard Disks

Notice from the figure that you can merge with its parent or merge witha new virtual hard disk.Also notice that along with the merge you canchoose the type of virtual disk that will be created.

Using differencing disks is beneficial in test environments where modifi-cations need to be tested frequently and where the starting point needs to bethe same for each and every test cycle. Differencing disks enable you to veryquickly create a new environment and to easily and quickly restore to thatstarting point. Basically, using differencing disks saves you huge amounts oftime in setting up and configuring your virtual machines because you onlyhave to do that once.

Neither a differencing disk nor a fixed-size disk can be compacted.Toreduce their size, you should merge the changes of the differencing disk orconvert the fixed-size disk to dynamically expanding.

Virtual Disks • Chapter 5 189

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 189

Page 215: Virtualization With Microsoft Virtual Server 2005 (2006)

Configuring & Implementing…

Undo Disks versus Differencing DisksWhen you open a virtual machine’s disk properties, you can see a checkbox labeled “Enable undo disks.” See Figure 5.25 for a screen reference.When you select this feature, Virtual Server creates an undo disk for eachand every virtual hard disk of the virtual machine. Technically, these disksare differencing disks. The difference being that Virtual Server generatesthem for every disk and that they are enabled on a virtual machine level.

Using undo disks simplifies the process of creating differencing disksfor each virtual hard disk in a virtual machine. Another benefit is thatwhen using differencing disks, the undo disk feature delays modificationsto even the differencing disks.

Make sure that you have enough storage space when using undodisks. Recall the discussion on differencing disks and their nature ofrecording updates. These files can become quite large. If you plan to usethis feature often, enable NTFS compression on the virtual machine folder.

Figure 5.25 Enable Undo Disks Property

190 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 190

Page 216: Virtualization With Microsoft Virtual Server 2005 (2006)

Configuring & Implementing…

Storing Virtual Hard DisksThe demand of an application in a virtual machine finally comes down tothe host. If the application is best served with a machine containing twodisks, then your virtual machine will have the same. For best performancewith disk-bound applications, you should store the virtual disk files sepa-rately from the operating system disk on the host and separately fromeach other. The Virtual Server host is yet another server that serves virtualmachines. Very often such a server has a separate disk for the operatingsystem (being either logical or physical) and another disk for things likesources and paging.

Requirements of the host disk I/O subsystem increase with thenumber of virtual machines and number of virtual disks per virtualmachine. Performance of each virtual machine is mainly dependent on theperformance of the host disk I/O subsystem.

Always try to separate disk I/O intensive virtual machines by usingseparate spindles. If you do not want single spindles, then use RAID 0 orRAID 1. If they are mostly intensive readers, you could use RAID 5. Mostimportant is that these virtual machines do not influence each other.

You can also use virtualized storage like SAN or iSCSI. Whatever youchoose, always realize that virtual hard disks are very large files so designtheir storage appropriately.

Use fixed-size disks when fragmentation is an issue or you aredesigning virtual machines for production use. Production systems gener-ally are decommissioned only once at the end of their lifetime. Theyshould be designed properly and required disk space should be pre-allo-cated using fixed-size disk.

Virtual Disks • Chapter 5 191

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 191

Page 217: Virtualization With Microsoft Virtual Server 2005 (2006)

SummaryVirtual disks enable storage and retrieval in virtual machines. Virtual Serversupports a virtual floppy disk drive per machine and multiple virtualCD/DVD drives. Both can be attached to a host drive or can use an imagefile like a virtual floppy disk or ISO 9660 ISO file.

A Virtual hard disk is virtualized disk storage in a virtual machine. On thehost, a virtual hard disk is just a file. Depending on the type of disk, this filehas different characteristics.

The dynamically expanding virtual hard disk is expanded as needed;Virtual Server expands the file upon write requests when space in the file isinsufficient.

The fixed-size virtual hard disk is a file on the host that is of the same sizeas the logical size.Advantage is that Virtual Server never interferes to expand.However, you have to plan in advance for disk capacity.There is also no wayto reclaim unused space; you have to convert this type first.

The differencing virtual hard disk contains differences compared to con-tent that exists on a parent virtual hard disk.The relationship with the parentis established when the differencing disk is created.The parent can be anytype of virtual disk, even a differencing virtual hard disk.This makes chainingpossible, with which you can create a hierarchy of disks.

Disks can be converted from fixed size to dynamically expanding and viceversa. differencing disks can be merged with their parent or merged to a newdisk.

Performance in general is dependent on that of the disk I/O subsystem.Disk speed, storage architecture, and configuration all determine the final per-formance and capacity of disk I/O.

Solutions Fast Track

Removable Hard Disks

� Virtual Server emulates disks, which are called virtual disks.To a guestoperating system inside a virtual machine, these virtual disks are the

192 Chapter 5 • Virtual Disks

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 192

Page 218: Virtualization With Microsoft Virtual Server 2005 (2006)

same as those in a physical machine.They behave the same and havethe same limitations, determined by their emulated characteristics.

� Virtual Server emulates different kinds of disks that are common intoday’s physical machines.Those can be categorized as eitherremovable disks or hard disks.

� Virtual Server supports the use of removable media such as CD orDVD optical disks. Because a DVD drive also supports CDs, VirtualServer emulates a DVD drive.

Virtual Hard Disks

� Dynamically expanding disks are expanded on the host when storageis insufficient and the logical size has not been reached.

� Dynamically expanding disks start small and generally grow to thesize that is needed in the virtual machine.

� Dynamically expanding disks can get fragmented on the host. Heavyfragmentation decreases overall performance.

� Fixed-size disks are created at their full size.This requires planningand capacity management on the host.

� Differencing disks contain modifications relative to a parent disk’scontent.

� Differencing disks can be created of any type of virtual hard disk; thisenables chaining.

� The size of a virtual disk is set at creation time and cannot bemodified afterward.

Virtual Disks • Chapter 5 193

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 193

Page 219: Virtualization With Microsoft Virtual Server 2005 (2006)

Q: Can virtual disks be converted?

A: Yes. Both dynamically expanding and fixed-size virtual disks can be con-verted to each other’s type.

Q: Is it possible to mount a virtual hard disk from outside the virtualmachine?

A: No. Virtual Server does not provide this functionality. Virtual Server 2005R2 Service Pack 1 will support this, however.

Q: Can I change the size of a virtual disk?

A: No.The logical size of the virtual disk is set at time of creation. It is the“physical” size of the disk inside the virtual machine.You cannot changethe physical size of a disk. If you need more space you can add anotherdisk or ghost the disk and copy to a larger disk.

Q: Can I modify a parent to update the guest operating system of a virtualmachine that uses a differencing disk?

A: Technically you can modify the contents on a parent disk but you shouldnot do that. Modifying the parent will invalidate all modificationsrecorded in the differencing disk. If you need to update files of a guestoperating system, you should update them in the differencing disk.

Q: Can I create multiple differencing disks based on a single parent?

A: Yes.This way you can share the parent’s contents among multiple virtualmachines using differencing disks.The parent could contain the operatingsystem and base tools and each virtual machine’s differencing disk couldcontain the modifications.

194 Chapter 5 • Virtual Disks

Frequently Asked Questions

The following Frequently Asked Questions, answered by the authors of this book,are designed to both measure your understanding of the concepts presented in this chapter and to assist you with real-life implementation of these concepts. Tohave your questions about this chapter answered by the author, browse towww.syngress.com/solutions and click on the “Ask the Author” form.

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 194

Page 220: Virtualization With Microsoft Virtual Server 2005 (2006)

Q: Should I use IDE or SCSI when attaching virtual disks?

A: SCSI allows for multiple concurrent disk I/O. SCSI supports larger disksand more devices. For best performance, even with IDE on the host, youshould use SCSI disks in your virtual machines.

Q: Is it possible to compact a differencing disk?

A: No. If you need to reduce its size, you should merge the changes.

Q: Is it possible to move a bootable OS disk from IDE to SCSI?

A: Yes.You need to add a SCSI adapter to the virtual machine. Install the vir-tual machine additions. Move the disk from IDE to SCSI ID 0.

Virtual Disks • Chapter 5 195

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 195

Page 221: Virtualization With Microsoft Virtual Server 2005 (2006)

406_VIRTUAL_05.qxd 9/8/06 6:51 PM Page 196

Page 222: Virtualization With Microsoft Virtual Server 2005 (2006)

Introduction to ADSand Virtual ServerMigration Tool

Solutions in this chapter:

■ Automated Deployment Services

■ What Components Does ADS Use?

■ Installing ADS

■ Post-Installation: Configuring ADS

■ Administrative Agent Installing

■ Adding Hardware Drivers in the Boot OS

■ Editing Using the Sequence Editor

■ Installing Virtual Server Migration Toolkitonto the Virtualization Server

Chapter 6

197

� Summary

� Solutions Fast Track

� Frequently Asked Questions

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 197

Page 223: Virtualization With Microsoft Virtual Server 2005 (2006)

Automated Deployment ServicesOne of the key techniques in the virtualization process is the technique toduplicate the physical environment. With most people, third-party productslike Norton Ghost (by Symantec) pop into mind. But in this case we aregoing to take a look at the Microsoft solution in disk-duping land.

Microsoft released Automated Deployment Services (ADS) in 2003.Thefirst version was primarily used for rapid deployment scenarios.At that time,virtualizing needed two separate tools from Microsoft:ADS and the VirtualServer Migration Toolkit (VSMT).After the update on ADS, and lifting theversion to 1.1, Microsoft placed VSMT in the ADS software bundle.

Rapid Deployment Using ADSThere is a lot more to do than migrating using ADS. A lot of companiesinstall multiple servers. One of the problems that soon arise is the differ-ences that will exist when installing more that one server by hand. Evenwhen the server is installed using an installation manual, it is very likely thatthe servers are not the same.

In this situation, ADS can solve your problem. Because ADS is able toimage your hard disk, it also is able to deploy the same image to multipleservers (of the same type) at once. Combine this feature with the Windowscapability called Sysprep, and you have your deployment solution.

In step 1, you install one server (see Figure 6.1). In step 2 you sysprepand image it using one of the templates given by ADS. In step 3 you hookup several servers and deploy the image to those servers in one action.Theservers will reboot and start installing the same way. After the installation iscompleted, all servers are exactly the same.

198 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 198

Page 224: Virtualization With Microsoft Virtual Server 2005 (2006)

Designing & Planning…

Too Much Effort?It may sound like the effort needed to install three servers is less than theinstallation of ADS and going through steps 1 to 3. Maybe it is. But theservers are the same. And if you’re going to migrate servers, you need theADS server.

One even better thing is the capability to install ADS on a virtualserver. By doing so, you do not have to tear down an entire server todeploy multiple servers. Just install Virtual Server on a supported plat-form, install ADS on a virtual server, and you’re off.

After you’re finished, do the following: Delete all images in ADS,defragment the server, run decompactor, and Zip the server. Then burn itto DVD and store it in a safe place to be used the next time.

Figure 6.1 ADS Image and Installation Steps

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 199

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 199

Page 225: Virtualization With Microsoft Virtual Server 2005 (2006)

What Components Does ADS Use?ADS is composed of a set of services, imaging tools, and management agents.At its most basic,ADS contains three discrete services that work in harmonyto complete the solution.These services are:

■ Controller Service

■ Network Boot Service

■ Image Distribution Service

Each of these services has specific settings and areas to focus on. In thefollowing chapters we will take a closer look at these services.

ADS Controller ServiceThe Controller service is the cornerstone upon which all other ADS func-tionality is built.This service provides for coordination and sequencing oftasks, security and communication with client devices, a centralized databaseof device data and administrative tasks performed to those devices, and thecapability to group devices together to facilitate the management thereof.TheController service also provides the management of the ADS solution throughADS command-line tools, GUI tools, and WMI-based scripts.

The previously mentioned function of “sequencing of tasks” is one of themost important features because this is the function that allows for a “punch-list” of work to be completed during the deployment of the image-basedoperating system. For instance, a task sequence may include BIOS configura-tion, RAID Controller setup and volume creation, OS image deployment,and post-installation configuration (to name a few).

ADS Network Boot ServiceThe Network Boot Service (NBS) leverages DHCP to provide ADS bootcommand authority over the requests of PXE-enabled devices.The PXE-enabled device will receive the location of the NBS as part of its DHCPlease.The NBS is actually two separate services that work together.The first isADS PXE Service, which sends boot commands to the PXE clients.Thesecond is the ADS Deployment Agent Builder.

200 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 200

Page 226: Virtualization With Microsoft Virtual Server 2005 (2006)

The PXE Service is capable of issuing the following commands:

■ Download and boot an ADS Deployment Agent created by the AgentBuilder Service.

■ Download and boot a virtual floppy disk (can be very useful if exten-sive hardware/BIOS/RAID configuration is warranted prior to theOS image being deployed).

■ Ignore the PXE boot request.

■ Cease PXE operations and boot to disk (based on the configurationof the BIOS).

The ADS Deployment Agent Builder is a dynamic, device-specific, post-PXE boot service that can perform the following:

■ Analyze local hardware on the PXE client and report the findings tothe Controller service for recording

■ Build a custom “agent” based on the hardware discovered

■ Download the agent to execute in the client’s local memory

While technically not a component of ADS, a DHCP is required for theNBS part of ADS to function. NBS uses Trivial File Transfer Protocol (TFTP)to send deployments to the agents and the virtual floppy disks to clients.

ADS Image Distribution ServiceThe Image Distribution Service (IDS) provides for the repository and com-munications between ADS clients and the images these clients are down-loading or uploading.The Controller service facilitates this process and thecommunications with the client. IDS can deploy images using either a unicast(one-to-one) or multicast (one-to-many) mechanism and has built-in net-work bandwidth throttling to prevent overloading your network during thedeployment process.

The following section will outline the basic requirements to introduceADS into your environment.

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 201

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 201

Page 227: Virtualization With Microsoft Virtual Server 2005 (2006)

ADS Host Server RequirementsThe ADS host servers act as the infrastructure for capturing, deploying, andstoring the image-based files for your various Windows server hardware plat-forms. While all components of ADS could be installed on a single server, inmany enterprise-level environments, administrators will choose to separate thevarious component services that comprise an ADS solution.

The following list is the minimum requirements for a single server ADSsolution. For more information on ADS and enterprise ADS solutions, pleaseconsult the Microsoft Web site at: www.microsoft.com/windowsserver2003/technologies/management/ads.

■ One x86 32-bit computer to host the three basic components ofADS (Controller service, NBS, and IDS)

■ 1GHz or faster processor (x86 32-bit)

■ Windows Server 2003 Enterprise Edition in English, Japanese, orGerman

■ 2 GB of hard drive space for ADS setup process plus sufficient drivespace to store the various images to be distributed (plan ahead forcapacity needs because image-based installation can consume copiousamounts of disk space)

■ 128 MB of RAM (32 GB is the maximum supported and 512 MB ismore likely a bare minimum requirement for your host server(s) tofunction in most small environments)

■ 800x600 SVGA or better (mouse and keyboard are optional, becausethe host server could be treated as a “lights-out” operation for themost part)

■ ADS may be installed from local disk, CD/DVD, or network shares

ADS Client-Server RequirementsA “client” server is any Windows Server OS (capable of being managed)that either has the ADS client software installed and configured or is a pieceof hardware that meets the requirements for deploying the image-based

202 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 202

Page 228: Virtualization With Microsoft Virtual Server 2005 (2006)

operating system.The following is a list of the basic requirements to be anADS client:

■ x86 hardware capable of running one of the following operating sys-tems: Windows 2000 Server or Advanced Server with Service Pack 3or later; Windows Server 2003 Web, Standard, or Enterprise Editions;Windows powered with Service Pack 3 or later

■ Network adapter that is Preboot execution Environment (PXE) ver-sions 0.99C or later

■ BIOS must support booting from PXE and may require an update tosupport ADS client (consult your hardware manufacturer’s documen-tation to determine eligibility of your hardware to be an ADS client)

ADS Network and Management RequirementsADS management can occur from the console of the various componentservers (or remotely with Remote Desktop).Alternatively, you may choose toinstall some or all of the management tools on your Windows workstation. Inorder to remotely manage your ADS environment, you will need to meet thefollowing list of requirements for an x86-based workstation:

■ Run an English, Japanese, or German version of the following oper-ating systems: Windows 2000 Professional, Server, or Advanced Serverwith Service Pack 3 or later; Windows XP Professional with ServicePack 1 or later; Windows Server 2003 Standard or EnterpriseEditions.

■ All ADS services (and supporting services) must reside in the samemulticast domain as the IDS and in the same broadcast domain as theADS PXE service and DHCP Server.

■ All ADS and supporting services must be on the same network.

■ A Windows 2000 Server or Windows Server 2003-based DHCPserver is recommended and should be on the same network as theclients and ADS services.

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 203

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 203

Page 229: Virtualization With Microsoft Virtual Server 2005 (2006)

NOTE

It is important to note that although Windows Server 2003 Web Editioncan be a client of ADS, it is not supported as a management end-pointof ADS. Additionally, Windows XP Professional and all versions ofWindows 2000 first require the .NET Framework 1.1 installed in order touse the Sequence Editor tool.

Installing ADSThe first step in installing ADS is to determine how ADS will be deployed inyour environment.ADS may be installed on one, two, or three separate serversto gain flexibility, capacity, and scalability. In all but the largest environments, aone- or two-server install is probably sufficient in terms of scalability andcapacity.The questions to ask are:

■ How many discrete networks do I need to deploy servers?

■ How many images do I need to maintain?

■ How quickly do I need to be able to deploy an image?

■ What type of database will I be using for the Controller servicerepository? (MSDE and SQL 2000 SP3 or later are supported)

Installation OptionsPrior to beginning installation, the Controller service’s repository needs toexist; meaning that the MSDE must be installed on the server that will hostthe Controller service or the SQL 2000 SP3 or later server must be onlineand available.

During the installation process you will be presented with the option of“complete” or “custom” installations. For single-server environments, choose“complete.” For multi-server environments, or to install the tools and docu-mentation on a separate management workstation, choose “custom.” Of thethree core services for ADS, the Controller service and NBS are good candi-dates for installing on the same server in a two-server solution. In both two-

204 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 204

Page 230: Virtualization With Microsoft Virtual Server 2005 (2006)

and three-server deployments, IDS typically is installed on a separate serverwith fast disk and network performance.Additionally, if the Controller serviceand the Image Distribution Service are installed on separate servers, remotemanagement of images is not possible (except through Remote Desktop).

At this point, we are ready to begin the actual installation. Prior to doingthat, it is paramount that DHCP be provisioned on the network if images areto be captured or deployed and consideration should be given for the addi-tional network traffic generated by the PXE requests of the clients (and iso-lated if need be from other PXE solutions, like RIS).

Configuring & Implementing…

ADS and Boot ImagesAs mentioned, ADS is going to use a boot image to deploy theDeployment Agent. This boot image is a tiny version of a memory-loadedWindows. This is referred to as the Deployment Agent. And as with allWindows platforms, it needs to have information on the hardware. But inthis case you need to make sure the client is able to use his hardware, sobefore booting to the Deployment Agent, make sure the drivers for themachine that is going to boot to the Deployment Agent are installed inthe boot image on the ADS server.

Installation ProcessDownloading ADS from Microsoft is the best method to ensure that you havethe latest version, which, as of the writing of this book, is version 1.1.As anadded bonus, the current version of ADS also includes the VSMT, saving aseparate download. Whether you download both of these tools separately ortogether, they are free for use if you have a Microsoft Windows 2003Enterprise Edition deployed in your network that is able to host the MSDEdatabase.

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 205

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 205

Page 231: Virtualization With Microsoft Virtual Server 2005 (2006)

The first step is to extract the downloaded files onto your drive.This willgive a safety warning because you’re about to open a possibly unsafe file (seeFigure 6.2).You can safely ignore it and click Run.

Figure 6.2 Security Warning on Opening the ADS Source Files

You will be asked to give the location to store the installation files (seeFigure 6.3). Remember, you’re not installing anything yet; you’re justunpacking. Provide a clear path that is easy to find, such as C:\ADSINSTAL-LATION.

Figure 6.3 Selecting the Unpack Directory

After you have extracted the download, setup should begin automatically.If you do not have a SQL 2000 server available on your network, or intend touse this in a lab or small production environment, the MS SQL Server

206 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 206

Page 232: Virtualization With Microsoft Virtual Server 2005 (2006)

Desktop Engine (MSDE) option should be fine. Make sure you install theMSDE first if you plan on using it to host the repository for the Controllerservice in ADS.This is where you need to have the Windows Server 2003Enterprise Edition server because only then is the MSDE installation avail-able. If you are trying to install the MSDE on a Windows Server 2003Standard or Web Edition, or MSDE is already installed, the “Install MicrosoftSQL Server Desktop Engine SP4 (Windows)” is grayed out (see Figure 6.4).If this is not the case, just click the arrow and the installation will start andcomplete fully automatic (see Figure 6.5).

Figure 6.4 Grayed-out Installation Option in Case of Windows Server 2003Standard Edition or It Has Already Been Installed

Figure 6.5 Fully Automatic Installation of the MSDE Database

Now that the database is installed, you can start installing ADS. Click theInstall Automated Deployment Services option to get started (see Figure6.6).

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 207

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 207

Page 233: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 6.6 Splash Screen for ADS/VSMT Download

The Automated Deployment Services Setup Wizard will appear (seeFigure 6.7).

NOTE

It is a good idea to read the “ADS Quick Start Guide.” This brief step-by-step guide shows you how to use ADS for rapid deployment. That wayyou can lever the functionality of ADS in a shorter time span.

Figure 6.7 Beginning Installation of ADS

208 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 208

Page 234: Virtualization With Microsoft Virtual Server 2005 (2006)

During the installation, you need to accept the license agreement (seeFigure 6.8). Reading this will show the need for a licensed copy of MicrosoftWindows Server 2003 Enterprise Edition.

Figure 6.8 Accepting the ADS EULA

In the installation options, you can choose from several installations. For thisinstallation, select the “Full installation” option. If you want to install the man-agement tools only, select the second option,“Administrative tools only.” Ifyou’re going to distribute the ADS installation among several servers, choose“Custom installation,” which enables you to install only the components thatare needed. For now, choose Full installation (see Figure 6.9). If you wouldlike to change the path to which the application is installed, you need to changeit here. However, this does not have to be the location where the images arestored; this can be changed further on in the installation of ADS.

Figure 6.9 Installation Selection for ADS

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 209

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 209

Page 235: Virtualization With Microsoft Virtual Server 2005 (2006)

Remember, you are installing a software solution that supports NBS.Thismeans that other network boot solutions can be disrupted.To be sure not todisrupt the other NBS for the cause of virtualization, you can install it on aseparate network. Or Install a dedicated DHCP server on the ADS server.

Because of the risk of disrupting the other services, the warning in Figure6.10 is shown. Check if it is applicable for your situation and click OK toresume the installation.

Figure 6.10 ADS PXE Warning

The next step is about the choices for the Controller services.As men-tioned before,ADS uses SQL server to store information.This can be locallyon the server, but if you like it, it is possible to store it in a full-scale SQLserver solution. For a migration server, it is sufficient to store the data in aSQL Server Desktop Edition. If you are rebuilding an ADS server and youhave a backup of the old SQL database, you can choose to connect it to therestored one (see Figure 6.11).

Figure 6.11 ADS Controller Service Database Selection and Configuration

210 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 210

Page 236: Virtualization With Microsoft Virtual Server 2005 (2006)

The ADS server needs to be able to reference the setup files, not only tostore a copy of these files but also to install the TFTP to be used to downloadthe boot image to the clients. Select the option that is applicable (see Figure6.12).

Figure 6.12 NBS Path to Windows Setup Files

It is possible to use several ways to connect to ADS. One of these ways isby using Windows PE instead of the default Deployment Agent. If you useWindows PE, you’re able to give the repository a name and the location ofthe image or to insert a media if you’re prompted. In the case of a virtualiza-tion server, there is no need to use Windows PE; you will use the defaultDeployment Agent of ADS (see Figure 6.13).

Figure 6.13 ADS Windows PE Repository Location

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 211

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 211

Page 237: Virtualization With Microsoft Virtual Server 2005 (2006)

Next, you need to give the path to the location you like to store theimages that are created by ADS (see Figure 6.14).This should be a large diskbecause the images can grow large during migrations. Remember, you aremigrating physical servers to virtual, which means all information on the diskswill need to be migrated.

Figure 6.14 Image Distribution Service Image Repository Location

After making the selections on the previous pages, you are ready to installADS on the server, except when you have a multihomed server. In that case,ADS needs to know where to bind the servers and will provide you with aselection dialog box (see Figure 6.15).

Figure 6.15 Network Binding Selection

212 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 212

Page 238: Virtualization With Microsoft Virtual Server 2005 (2006)

After the previous dialog box appears, you are ready to install ADS. ClickInstall to start the installation (see Figure 6.16).

Figure 6.16 ADS Ready to Install

Just wait patiently to finish the installation (see Figure 6.17).

Figure 6.17 Installing ADS

You selected Prompt for the path when required on the NetworkBoot Service Settings dialog box (see Figure 6.12), which will result in thefollowing dialog box asking to provide ADS with the installation media (seeFigure 6.18).

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 213

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 213

Page 239: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 6.18 Insert the Installation Media

Insert a Windows Server 2003 installation media into the server and theinstallation will finish (see Figure 6.19). Click Finish to end the installation.

Figure 6.19 Done Installing ADS

Post-Installation: Configuring ADSAt this point, you have installed ADS. But, as always, installing something willresult in a working server but not a configured server. Next, you must con-figure ADS to do what is necessary with the least amount of administration.

Automatically Accepting New ClientsIf there are a lot of clients that need to be installed, it can be handy to auto-matically insert clients into ADS.You do this by setting the correct parametersin the Controller services. Open the ADS Administrator (see Figure 6.20).

214 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:27 PM Page 214

Page 240: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 6.20 ADS Administrator Screen

Next you need to expand until your ADS Administrator has the sameview as Figure 6.21. Here you can see the several components that makeADS. We are especially interested in the Controller service.This service isresponsible for controlling the access and actions of clients.

Figure 6.21 Expanded View of the ADS Administrator Console

Select Controller Service, right-click, and then select Properties fromthe drop-down menu.The Controller Service Properties dialog box appears,as shown in Figure 6.22, where you can see some important information onthe network connectivity.

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 215

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 215

Page 241: Virtualization With Microsoft Virtual Server 2005 (2006)

Configuring & Implementing…

Changing the ADS Controller Service IP AddressThe IP address is shown and it looks like you’re able to change the IPaddress the ADS server is listening on. However, this is not the case. If youchange the IP address here, ADS will stop functioning. To change the IPaddress of the server, follow these steps:

1. Change the IP address of the server the controller is runningon and check connectivity from the new IP address.

2. Open the registry and locate the following key:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Adsctlr\BMDP\Parameters

3. Change BindExcept to reflect the new IP address.

4. If the server full fills all roles, repeat steps 2 and 3 for the fol-lowing keys: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ADSBUILDER\ParametersHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\adsimgsvc\ParametersHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ADSPXE\Parameters

5. Go to the ADS Administrator and change the IP address on thetab, as shown in Figure 6.22.

6. Restart ADS Controller, ADS Deployment Agent Builder, ADSPXE Service, and ADS Administration Agent.

7. Check that all services are restarted correctly.

Change to the Service tab to see the important settings.The dialog box inFigure 6.23 is divided into two sections: the first one gives the option to setthe default boot method if none is selected. In this case, boot-to-da. In thelower part are the automatic responses in case there is a network boot.ADS isnot doing anything unless you take control of the device in ADS. If this is notthe case, the client will not boot. If you set the “To PXE action” to Add andclick Apply, you will be given a warning (see Figure 6.24).

216 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 216

Page 242: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 6.22 ADS Controller Service Properties Dialog Box

Figure 6.23 ADS Service Controller Services Default Behavior Configuration

Figure 6.24 Warning Message if PXE Action is Set to Add

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 217

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 217

Page 243: Virtualization With Microsoft Virtual Server 2005 (2006)

Then you can set the “Device description for new auto-added device” toa recognizable value like “New devise.”This way you will spot the new clientdirectly. Of course, you need to tell them what to do the first time they con-nect to the controller.The options are the same as in the global job template.Typically, you will end up with something similar to Figure 6.25.

Figure 6.25 Typical Setting When Auto Adding Clients

Click OK and close the ADS Administrative Panel.

Enabling MulticastADS is able to push images with multicast.This makes it possible to installan image on a large number of clients using the same network utilization(from the server) as one. Multicast is enabled by default. If you need to dis-able it, open the ADS Administrator console and go to the services. Openthe Properties of the Image Distribution service (see Figure 6.26).

To disable multicast, click the Service tab and uncheck Multicastimage deployment (see Figure 6.27).

218 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 218

Page 244: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 6.26 Properties of the Image Distribution Service

Figure 6.27 Image Distribution Service Properties—Service Tab

Administration Agent InstallingIf you are going to virtualize a physical machine, there is no need for anadministration agent. However, if you have ADS running, you might see theease of use.As the back is running,ADS is waiting for clients to connect tothe ADS Controller service.

There are two methods for connecting to the ADS server: booting toPXE and installing the administration agent in the client. In the following

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 219

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 219

Page 245: Virtualization With Microsoft Virtual Server 2005 (2006)

steps, you will install the agent. First, open the installation files that youcopied from the server.You will get the familiar splash screen (see Figure6.28). On this screen, select Install ADS Administration Agent.

Figure 6.28 ADS Splash Screen

The Administration Agent Setup Wizard will appear (see Figure 6.29).Select Next to start the installation.

Figure 6.29 Welcome to the Administration Agent Setup Wizard

Accept the license agreement by selecting I accept the terms of thelicense agreement and clicking Next (see Figure 6.30).

220 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 220

Page 246: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 6.30 Agent License agreement

All information transferred between the client and the server is encryptedusing certificates (see Figure 6.31). In this screen you need to give the loca-tion of the server certificate so you are able to communicate securely withthe ADS server.The certificate is stored on the ADS server in%ADSInstallationpath% \certificates.There is a certificate called ADSRoot.cer.Copy this file to the server and give the location to the installation program.

Figure 6.31 Certificate Installation Dialog Box

Next, you need to set up the account that ADS is going to use per-forming jobs on the system (see Figure 6.32). If you like ADS to perform jobson the domain level, you need to use a domain account.You can use the local

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 221

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 221

Page 247: Virtualization With Microsoft Virtual Server 2005 (2006)

system so that you are able to get all information and perform every functionon the client.

Figure 6.32 ADS Service Account Information

The final step is to give information about the location where the agentshould be installed.This is shown in Figure 6.33. Select the correct locationand click Install to install the agent.

Figure 6.33 Click Install to Start the Agent Installation

After the installation is completed, the server is shown in the ADS admin-istrative console and you are able to perform jobs. Sample jobs are provided inthe %ADSInstallationPath%\Samples directory of the ADS server.

222 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 222

Page 248: Virtualization With Microsoft Virtual Server 2005 (2006)

Adding Hardware Drivers in the Boot OSIt is common to have multiple server brands within a company. Still, you needto be able to connect the network adapter to the ADS server and access thedisks to put the image on.To do this in Windows Server 2003, you usedrivers.

The Deployment Agent of ADS is completely compatible with WindowsServer 2003.This means that you can use the drivers that you need straightfrom the Internet or driver CD.The next question is where to put it.

To install the drivers, take the following steps:

1. Copy the .inf and .sys files into the Microsoft ADS\nbs\reposi-tory\user\PostSystem directory on the Microsoft ADS server.

2. If the Microsoft ADS console is running, shut it down.

3. Select Start | All Programs | Administrative Tools | Services.The Services window opens.

4. Right-click ADS Deployment Agent Builder; then click Stop.

5. Right-click ADS Deployment Agent Builder; then click Start.

6. Close the Services window.

7. Start the Microsoft ADS Console.

After you have done this you should be able to boot to the DeploymentAgent and access the hard disks in the physical servers.

Editing Using the Sequence EditorADS is the tool to use when you’re going to virtualize a physical server to avirtual server. But again, that is not the only thing ADS can do for you.

You can use ADS to do mass administration, run scripts, make or deployimages, and so on. Everything is done by ADS through the use of sequencefiles.These files can be created using the Sequence Editor (see Figure 6.34).

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 223

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 223

Page 249: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 6.34 ADS Sequence Editor

You are able to select several types of commands (see Figure 6.35), andtherefore build a controlled series of actions.ADS is able to monitor allactions taken on the client.As the several actions are selected, a sequence fileis build. By selecting a client in the ADS administrator console, you are ableto select the target computer that performs the sequence. Of course, allsequences can be stored on disk to be used in a later stage.

Figure 6.35 Actions That Can Be Performed Using the Sequence Editor

224 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 224

Page 250: Virtualization With Microsoft Virtual Server 2005 (2006)

If you select File | Open, you are able to open a sequence file. Samplescan be found in the %ADSInstallationPath%\Samples directory. In this case(see Figure 6.36), I selected “DA-DEPLOY-IMAGE-DOMAIN,” whichstands for “deploying a Sysprep image of a server and connecting it to thedomain.”

Figure 6.36 Sample Sequence File

In this sample file, we see several actions, such as partitioning the diskwhere the image is going to be deployed (see Figure 6.37).The partition isgoing to be on the first harddisk (or hardware raid device) and it will be thefirst partition on the disk (“/init”), blowing any existing partitions from thedisk.The size is 5 GB and it is made active (/A).

Figure 6.37 Partitioning a Disk

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 225

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 225

Page 251: Virtualization With Microsoft Virtual Server 2005 (2006)

In Figure 6.38, an image is deployed to the server.The image is called“imagename” and deployed to the first physical disk on the first partition.

Figure 6.38 Deployment of an Image

During one of the following stages the server is rebooted (see Figure 6.39).If the server has the network as first boot device, the server will automaticallyreturn to the job and continue with the next step,“Boot to hard disk.”

Figure 6.39 Reboot to Hard Disk

226 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 226

Page 252: Virtualization With Microsoft Virtual Server 2005 (2006)

The installation sequence of the servers is as follows:

1. Build the servers in the 19-in. rack.

2. Connect them to the network.

3. Boot from the network (by setting the network as first boot device)to the Deployment Agent.

4. Deploy an image.

After step 4, the servers are done and you can start installing additionalsoftware. So, although previously you could do one or maybe two servers aday, now you’re able to do all of them in one day. Let’s make things easy.…

Installing Virtual Server MigrationToolkit onto the Virtualization ServerThe installation of the VSMT starts with the famous splash screen (see Figure6.40), where you select Install Virtual Server Migration Toolkit.

Figure 6.40 Splash Screen ADS Installation

The Setup Wizard will start. Click Next to start the installation (seeFigure 6.41).

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 227

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 227

Page 253: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 6.41 Beginning Installation of VSMT

Of course, you need to accept the license agreement (see Figure 6.42) tobe able to install VSMT.

Figure 6.42 Accepting VSMT EULA

The next screen enables you to select the type of installation and where toinstall VSMT.The way it is installed is very important because if the serverthat is going to host the migrated server is not the one you’re using to virtu-alize, you need to do another installation. In this exercise, select Full installa-tion (see Figure 6.43). But if you are going to migrate to another virtualserver, install the Tools only (see Figure 6.44).This enables the ADS servers touse scripts to deploy the server. Click Next to continue.

228 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 228

Page 254: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 6.43 VSMT Installation Selection

Figure 6.44 VSMT Component Selection

You are ready to start copying files to the installation directory. ClickInstall to start (see Figure 6.45)

When everything goes according to plan, the installations should not takelong, and the dialog box in Figure 6.46 should be shown.

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 229

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 229

Page 255: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 6.45 Completing the Install of the VSMT

Figure 6.46 VSMT Successful Completion

VSMT is installed.You’re ready to start with the migration. For moreinformation on migrating virtual machines, see Chapter 8.

230 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 230

Page 256: Virtualization With Microsoft Virtual Server 2005 (2006)

SummaryIn this chapter we took a look at the several tools that are involved, besidesVirtual Server, during the migration from a physical server to a virtual server.There are two major tools involved:ADS and VSMT.ADS can be used tocapture and deploy new servers to maintain a common installation base andenable versioning.This is essential in a large server environment and leveragesthe reliability of the IT environment. Both are essential for a successful virtu-alization of the server.

Solutions Fast Track

Automated Deployment Services

� Free tool to use on Windows Server 2003 (Enterprise Edition) tocapture and deploy servers

� Is able to multicast

� Can be used to do more than virtualizing

What Components Does ADS Use?

� ADS Controller service controls and logs all action done by ADS.

� ADS NBS is used to PXE boot to the Deployment Agent.

� ADS Image Distribution Service is used to capture and deployimages.

Installing ADS

� The Installation files are delivered as one file.

� The image directory can be set separately during the installation.

� As ADS uses PXE, it is essential to separate the ADS environmentfrom other network boot systems.

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 231

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 231

Page 257: Virtualization With Microsoft Virtual Server 2005 (2006)

� ADS integrates with DHCP. If there are multiple DHCP servers, besure to check for integration on all servers.

Post-Installation: Configuring ADS

� After the installation, you can enable the option to automatically addservers to the ADS controller.

� Nothing is done to the servers until it is “in control.”

� Do not attempt to change the IP address only from the Controllerservice properties, as this results in failure.

Administrative Agent Installing

� Is needed to be able to run jobs on windows clients.

� The traffic between the server and the client are encrypted.

� The certificate used to communicate with the server can be foundon the ADS server in %ADSInstallationPath%\Certificates.

Editing Using the Sequence Editor

� The Sequence Editor is a graphical tool to build jobs to use in ADS.

� There are a lot of sample jobs in the %ADSInstallationPath%\Samplesdirectory.

� Sequence files are stored as XML files and can be reused over andover again.

Adding Hardware Drivers in the Boot OS

� Every piece of hardware that is supported by Windows Server 2003 issupported by the Deployment Agent.

� To add new drivers to the boot image, copy the drivers to the“Microsoft ADS\nbs\repository\user\PostSystem” directory andrestart the builder service.

232 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 232

Page 258: Virtualization With Microsoft Virtual Server 2005 (2006)

Installing Virtual Server Migration Toolkit onto the Virtualization Server

� The installation of the VSMT needs to be performed on the serverthat runs ADS.

� If the server that is going to host the virtual machine is not the oneused to virtualize, a “Tools only” installation must be done on thatserver.

Q: Is it possible to use the ADS techniques for deployment of workstations?

A: Maybe, but that’s not the intention of the product. It is build for deploy-ment of server operating systems.

Q: I do not have a Windows Server 2003 Enterprise Edition within my com-pany. Can I still install ADS?

A: I am afraid you cannot use ADS, because the license explicitly requiresWindows Server 2003 Enterprise Edition

Q: Is it possible to virtualize the ADS server?

A: Yes; even better, please do.The license constrains of Virtual Server 2005tells us we don’t have to have a license for a server that is not running, soif we need to virtualize, we shut down a production server to be able torun the ADS server.This way there is no license violation.

Q: Does this mean I can do bare metal deployments using ADS?

A: You sure can. I have done this successfully a number of times.

Introduction to ADS and Virtual Server Migration Tool • Chapter 6 233

Frequently Asked Questions

The following Frequently Asked Questions, answered by the authors of this book,are designed to both measure your understanding of the concepts presented in this chapter and to assist you with real-life implementation of these concepts. Tohave your questions about this chapter answered by the author, browse towww.syngress.com/solutions and click on the “Ask the Author” form.

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 233

Page 259: Virtualization With Microsoft Virtual Server 2005 (2006)

Q: Can I edit the images that I capture without deploying first?

A: Yes, you can mount the images as if it were a drive on the ADS server.That way you are able to add or remove software before deploying theimage to the servers.

Q: We already have RIS deployed in our network. Can I deploy ADS along-side?

A: No, not the easy way. Best practices tell us to logically separate the LANso you do not disrupt the existing RIS installation.

Q: Do you really think this is a cool tool that I should try?

A: Yes, I sure do.

234 Chapter 6 • Introduction to ADS and Virtual Server Migration Tool

406_VIRTUAL_06.qxd 9/8/06 7:28 PM Page 234

Page 260: Virtualization With Microsoft Virtual Server 2005 (2006)

Managing Virtual Server

Solutions in this chapter:

■ The Management Interface

■ Using the Virtual Server COM API

■ Accessing a Virtual Server Using Script

■ Creating a Virtual Machine Using Script

■ Creating a Virtual Network Using Script

■ Retrieving Guest OS Information UsingScript

■ Changing a Virtual Machine State UsingScript

■ Attaching Scripts to Virtual Server Events

Chapter 7

235

� Summary

� Solutions Fast Track

� Frequently Asked Questions

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 235

Page 261: Virtualization With Microsoft Virtual Server 2005 (2006)

IntroductionTo manage a virtual server, you use the Virtual Server Administration Website, available on each and every Virtual Server host. If you do not want toinstall the Administration Web site on every host or want to automate admin-istration tasks, you have several options to choose from.

The Management InterfaceBy now you should be familiar with the management interface of VirtualServer. Configuration management of Virtual Server as well as that of eachvirtual machine from a graphical user interface can only be done from theVirtual Server Administration Web site.As the name clearly implies, this man-agement requires a Web server which, in this case, is Internet InformationServices.

NOTE

The next generation of virtualization product, Windows ServerVirtualization, no longer requires Internet Information Server. The man-agement interface is completely based on Microsoft ManagementConsole 3.0.

New releases of Virtual Server 2005 R2, of which Service Pack 1 is thenext update to be released in 2006, will still require Internet InformationServices. However, Microsoft has announced a virtual machine manage-ment product called System Center Virtual Machine Manager. Thisproduct will be able to manage both Virtual Server 2005 and WindowsServer Virtualization installations.

You can install Virtual Server on Windows Server 2003 and Windows XPProfessional with Service Pack 2. Windows Server 2003 comes with InternetInformation Services 6.0 and Windows XP Professional comes with InternetInformation Services 5.1.

236 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 236

Page 262: Virtualization With Microsoft Virtual Server 2005 (2006)

NOTE

Virtual Server on Windows XP Professional with Service Pack 2 is notsupported for production use. Windows XP is a desktop operatingsystem and not designed for server products.

Depending on the underlying operating system, the Virtual ServerAdministration Web site is installed on port 1024 for Windows Server 2003or port 80 for Windows XP. The reason for this is obvious: InternetInformation Services on Windows XP supports only a single Web site which,by default, listens on port 80.

Now that you know what is required and what options you have forInternet Information Services, there is not much else to choose from when itcomes to managing a single Virtual Server instance. But what if you havemultiple Virtual Server hosts? Do you have to install Internet InformationServices on each host? Actually, you don’t, and the solution lies in a centralVirtual Server management site.

Configuring a Central Virtual Server Management SiteA central Virtual Server management site enables you to leverage a singleInternet Information Services instance with the Virtual Server AdministrationWeb site for management of all Virtual Server hosts.The Internet InformationServices instance may exist on a Virtual Server host, but you can even dowithout a single installation on any of your Virtual Server hosts.

You can leverage an instance of Internet Information Services that alreadyexists in your environment and place the Virtual Server Administration Website on that instance.This way you establish a management server for allVirtual Server hosts.The only requirement for this scenario to work is that allVirtual Server hosts are in the same domain as the management server andthat the domain is in Windows Server 2003 mode.

Managing Virtual Server • Chapter 7 237

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 237

Page 263: Virtualization With Microsoft Virtual Server 2005 (2006)

Designing & Planning…

Domain Functional Levels and Kerberos Constrained DelegationWindows Server 2003 supports several domain functional levels. Theseare Windows 2000 mixed, Windows 2000 native, Windows Server 2003Interim, and Windows Server 2003.

In all modes except Windows Server 2003, there is only KerberosDelegation. What does this mean? When a user connects to a Web ser-vice, and that service needs to access a resource on yet another server, theWeb service impersonates the user. So the Web service accesses theresources on the server as if it were the user accessing the resources.

However, there is no constraint in Windows 2000 to limit theresources the Web service can access on behalf of this user. Once the Webserver is trusted for delegation, it is trusted for delegation to any service.

In Windows Server 2003 mode, Kerberos Delegation can be con-strained or limited to certain services; hence Kerberos ConstrainedDelegation (KCD). In the example, the Web server can be trusted for del-egation to the specific services only.

With the domain in Windows Server 2003 mode, you configure the Webserver’s computer account to be trusted for delegation.The steps to be per-formed are outlined in greater detail later.

NOTE

Only the domain needs to be in Windows Server 2003 mode. You do notneed to enable the forest to Windows Server 2003 mode.

When the domain requirement has been met, you can manage any VirtualServer by using a Web browser (Internet Explorer 5.5 or higher) from any-where within the domain.

To make this work, you have to perform the following steps:

238 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 238

Page 264: Virtualization With Microsoft Virtual Server 2005 (2006)

1. Install the Virtual Server Administration Web site on the InternetInformation Services instance.

2. Configure the management server to be trusted for delegation.

The steps required to set up a central management server have been docu-mented in both the online product documentation and in a whitepaper called“Installing the Virtual Server Administration Web Site on a Separate Computer”(located at www.microsoft.com/downloads/details.aspx?FamilyID=c4dcf45b-72ea-44ed-86aa-1c389ece12f9&displaylang=en).The next paragraph gives arecap of the most important steps based on a fictitious environment. In thatenvironment there is a single-domain forest called vs.local and a managementserver called webmgmt. Internet Information Services are already installed onwebmgmt.

Start the installation of Microsoft Virtual Server 2005. Click InstallMicrosoft Virtual Server 2005 R2.Accept the License Agreement andclick Next. Enter appropriate information for Name and Organization,enter the Product Key, and click Next.You will see the Setup dialog box asshown in Figure 7.1.

Figure 7.1 Virtual Server Custom Setup

Managing Virtual Server • Chapter 7 239

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 239

Page 265: Virtualization With Microsoft Virtual Server 2005 (2006)

Click Custom and then click Next.Deselect all options except the Virtual Server Web Application. See

Figure 7.2.

Figure 7.2 Selecting the Virtual Server Features

Click Next. Now the most important setup dialog is the one in Figure 7.3.

Figure 7.3 Virtual Server Setup Option for KCD

240 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 240

Page 266: Virtualization With Microsoft Virtual Server 2005 (2006)

Make sure that you select the second option, which configures theAdministration Web site to always run as the Local System account.This isrequired for Kerberos Constrained Delegation. So enter the required portnumber for the Web site or use the default, select the second option, and thenclick Next.This will bring you to the final setup screen where you have theoption to let setup configure exceptions in the Windows Firewall configura-tion (see Figure 7.4).After that, you have configured everything the way itshould be in order to use the management server.

Figure 7.4 Setting Virtual Server Setup Windows Firewall Exceptions

After setup has completed, you are ready for the next and final configura-tion steps.These should be made on domain level in our fictitious environ-ment vs.local.

Open Active Directory Users and Computers.You can do this on adomain controller for the domain or on any member server in the domain.

NOTE

By default, you will not find the Active Directory Users and Computersshortcut in the Administrative Tools program group on member serversin the domain. However, the snap-in is available. Simply click Start |Run, enter dsa.msc, and click OK. This will bring up the MMC snap-in.

Managing Virtual Server • Chapter 7 241

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 241

Page 267: Virtualization With Microsoft Virtual Server 2005 (2006)

Find the computer account of the server holding the Virtual ServerAdministration Web site in the active directory. Select the computer account,Select Action | Properties.A dialog box opens, which may look like theone in Figure 7.5.

Figure 7.5 Web Server Properties at Incorrect Domain Functional Level

If the Properties dialog box for the computer object webmgmt looks likethe one in Figure 7.5, then your domain is not operating at the requiredfunctional level.You are not able to select any services, so you must first raisethe domain functional level.To raise the domain functional level, click thedomain node and select Actions | Raise Domain Functional Level….Select Windows Server 2003 and click Raise.

NOTE

Changing a functional level, either domain or forest, is irreversible.Functional levels can be raised, but they cannot be lowered. Each func-tional level enables new functionality but disables backwards compati-bility or interoperability.

For a complete overview of all forest and domain functional levelsand their characteristics, see the Microsoft Knowledge Base article322692 at http://support.microsoft.com/kb/322692.

242 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 242

Page 268: Virtualization With Microsoft Virtual Server 2005 (2006)

With the proper domain functional level, the Properties dialog box for thecomputer object webmgmt should look like Figure 7.6.

Figure 7.6 Web Server Properties at Correct Domain Functional Level

The difference between this and the previous dialog box is the Delegationtab.The existence of this tab indicates that the domain is running at theproper level and that Constrained Delegation can now be configured.

Click Delegation, click Trust this computer for delegation to spec-ified services only, click Use any authentication protocol, and thenclick Add…. Click Users or Computers… and enter the names of the vir-tual server hosts in your domain.You will then see a list of all services regis-tered for those hosts in Active Directory. Select the CIFS and vssrvc servicesand click OK. Figure 7.7 shows the results for two virtual server hosts calledp01 and p02.

WARNING

When the vssrvc service is not listed for a particular Virtual Server host,the Service Principal Name (SPN) has not been registered. You can verifywhether this is the case using the setspn command-line tool. Setspn ispart of the Support Tools package.

Managing Virtual Server • Chapter 7 243

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 243

Page 269: Virtualization With Microsoft Virtual Server 2005 (2006)

When issuing setspn –l <hostname> you should see two SPN’s regis-tered for the vssrvc service on the host: one single label entry and onewith the fully qualified name of the host.

When the Virtual Machine Remote Control service has been enabledon the host, you will also see two entries for the vmrc service. See Figure7.8 for output of setspn –l p02.

You can use setspn to set the required SPN, although we recommendthat you investigate the cause that prevents Virtual Server from regis-tering the SPN itself and solve the problem.

Figure 7.7 Web Server with Constrained Delegation Configuration

Figure 7.8 Registered Service Principal Names

244 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 244

Page 270: Virtualization With Microsoft Virtual Server 2005 (2006)

You should now be able to use the management server and connect to theVirtual Server hosts.To connect to the management server, start InternetExplorer and type the address (URL) of the management server as follows:http://<managment server>:<port>/VirtualServer/VSWebapp.exe?View=1. See Figure 7.9 for the result of this action to amanagement server called P03.

Figure 7.9 Connecting to the Management Server

At this stage you are connected to the management server. However, thereis no Virtual Server available and none has been specified in the URL.Toconnect to a Virtual Server, for example P01, type P01 in the Computername field.You can choose to select Add this computer name to theVirtual Server Manager list to record the Virtual Server host name.Youcan then later select it from a list. Click Connect to connect to the VirtualServer host. Figure 7.10 shows the result when connecting to P01.

Managing Virtual Server • Chapter 7 245

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 245

Page 271: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 7.10 Connecting to the Virtual Server Host from the ManagementServer

Notice that the URL now includes a remoteServer=p01 at the end.Thisinstructs the Virtual Server Administration Web site to connect to p01.

If you need to connect to another Virtual Server host, click VirtualServer Manager, click Switch Virtual Server or select a previouslyrecorded Virtual Server host name. See Figure 7.11 for a reference. Noticethat you have the option to record the name for later use.

Configuring a central management site was the most advanced topic ofWeb-based management using the Virtual Server Administration Web site.There are no other means of management by a graphical user interface.However, you can manage Virtual Server by using scripts.

246 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 246

Page 272: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 7.11 Specify Virtual Server

Using the Virtual Server COM APIAll management of Virtual Server is performed through the Virtual ServerCOM API.You can see the whole management picture from the VirtualServer architecture in the Virtual Server Administrator’s Guide. From thearchitecture you can see that the Virtual Server Administration Web site alsouses the API. Virtual Server basically exists in a COM (Component ObjectModel) object.This model abstracts internal functionality to interfaces withwhich you can interact. Figure 7.12 shows a similar view on the COM inter-face of Virtual Server.

This figure depicts the COM interface as a layer between the manage-ment application and the Virtual Server configuration.You can see thatVirtual Server is managed from Internet Explorer by using the Virtual ServerAdministration Web site through COM. By using COM through scripts, youcan manage Virtual Server exactly the way you want.

Managing Virtual Server • Chapter 7 247

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 247

Page 273: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 7.12 Virtual Server COM Interface

You do not have to be an expert on COM to leverage the API usingscripts.You interact with the COM object in a very natural way.You can askVirtual Server to perform an action like creating a virtual machine or askwhich virtual machines are currently running.The way you ask Virtual Serverdepends on the scripting language you use.You can use any scripting lan-guage, like VBScript or Jscript, or any other language that supports COMautomation, like C++, VB.Net, or C#.

Since VBScript is the most widely used language of the scripting lan-guages, we will use VBScript in all sample scripts in this chapter.Therefore,you should have some basic knowledge of VBScript, although the samples arekept to minimal complexity to focus more on the API than the language.

Using the Virtual Server Programmer’s GuideThe Virtual Server Programmer’s Guide is available from the MicrosoftVirtual Server program group. When you open that documentation you maynotice it is called the Microsoft Virtual Server SDK.That acronym stands forSoftware Development Kit and usually consists of documentation and tools toenable developers to create a custom solution on top of the product. In thecase of Virtual Server, the SDK consists only of the documentation called theprogrammer’s guide.

248 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 248

Page 274: Virtualization With Microsoft Virtual Server 2005 (2006)

The base for success on using the API lies in understanding its documen-tation.You should investigate it to become familiar with navigating throughthis guide. It may seem cryptic at first, but once you browse and navigate youwill quickly be able to find the information you need.To help you getstarted, the section below covers some steps you can perform to becomefamiliar with its organization.

Click Start | All Programs | Microsoft Virtual Server, VirtualServer Programmer’s Guide. By default, this opens the Microsoft VirtualServer SDK in “collapsed view,” as shown in Figure 7.13.

Figure 7.13 Default View of the Virtual Server SDK

From here you can navigate through the SDK in several ways.You canexpand the left node by clicking the + next to the book icon.You can alsouse the shortcuts on the right pane which leads directly to the chosen sec-tion.The shortcuts are more appropriate once you are familiar with thedocument.

Click on the + sign next to the book to expand its contents.This resultsin Figure 7.14.

Managing Virtual Server • Chapter 7 249

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 249

Page 275: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 7.14 Virtual Server SDK Sections

In this figure you can see that there are actually four main sections inthe documentation: the “About” section, the “Using” section, and two“Reference” sections. Notice that the right pane’s shortcuts correspond tothese sections.

You should read all sections, but the most interesting section, and theone you will use most often, is the Microsoft Virtual Server 2005 COMInterface Reference. Open the section by clicking the + sign next to thebook.This leads to Figure 7.15.

Remember, in the beginning, to navigate using the left pane and use theright pane as the “results” pane.This prevents you from getting confused innavigating. Once you are familiar with the reference, you can use the rightpane to quickly go to the referenced locations.

250 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 250

Page 276: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 7.15 Virtual Server 2005 COM Interface Reference

For now, open the Virtual Server COM Interface Interfaces section byclicking the + sign next to the book icon. From there, navigate to theIVMVirtualServer node and expand it by clicking the + sign.The result isdisplayed in Figure 7.16.

Figure 7.16 Virtual Server Object Reference

Managing Virtual Server • Chapter 7 251

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 251

Page 277: Virtualization With Microsoft Virtual Server 2005 (2006)

There are several things to notice. First, you probably noticed that youneed to scroll down to the IVMVirtualServer node.The nodes are sorted andrefer to a corresponding object. Second thing is that all objects start withIVM.This is their internal representation in the COM object. For navigatingand using them in VBScript you can ignore the first IVM acronym. Last thingyou can see from the figure is that the right pane gives you information onthe IVMVirtualServer interface.

NOTE

The IVMVirtualServer interface is the interface to the root of the VirtualServer object. As the right pane states, this is the top-level Virtual Serverapplication object. You connect to this object (using this interface) in allscripts that follow and access all “derived” objects from this object.

To get a good clear overview of the Virtual Server methods and propertiesit is easier to use the left pane than to use the right pane and browse its con-tents. When you click on the methods node you will get a screen like that inFigure 7.17.

Figure 7.17 Virtual Server Methods

252 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 252

Page 278: Virtualization With Microsoft Virtual Server 2005 (2006)

The right “results” pane lists its methods in a more human-readable form.The methods are displayed in sorted order and written in clear English inPascal notation.

NOTE

In Pascal notation or Pascal casing the first letter is capitalized and eachfirst letter of each concatenated word. For example the method used tocreate a virtual machine is written as CreateVirtualMachine, where thewords create, virtual, and machine are concatenated and each first lettercapitalized.

Figure 7.18 lists the properties of the Virtual Server object.

Figure 7.18 Virtual Server Properties

Notice that the meaning of these properties can also be easily understoodfrom their name.

Managing Virtual Server • Chapter 7 253

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 253

Page 279: Virtualization With Microsoft Virtual Server 2005 (2006)

Connecting to the Virtual Server COM ObjectThe Virtual Server Programmer’s Guide has many code samples for C++,Visual Basic, and VBScript.The samples for “Connecting to the VirtualServer COM object” in the guide cover only Visual Basic, C#, and C++.However, you can find the necessary information in the numerous VBScriptsamples throughout the SDK.

To connect to the COM object from VBScript, type the following:Set objVS = CreateObject("VirtualServer.Application")

This is all there is to it to connect to the COM object.This line of codehas several parts.

■ Set Used with objects to assign an object reference to a variable.The reference here is to the Virtual Server COM object, the vari-able is objVS.

■ objVS The variable assigned to the Virtual Server COM object.This could be any name you like (within VBScript rules) but theprogrammer’s guide uses objVS to denote an object variable toVirtual Server (objVS).

■ CreateObject CreateObject instantiates a variable to an automationobject.

■ VirtualServer.Application This is the so-called ProgID by whichthe COM object has been registered on the operating system.

The only thing you can change in this single line of code is the name ofthe variable. If you are happy with the one from the programmer’s guidethen you can copy this line into your scripts and start using this variable.

254 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 254

Page 280: Virtualization With Microsoft Virtual Server 2005 (2006)

Configuring & Implementing…

Setting Up Your Scripting EnvironmentWe highly recommend that you set up your scripting environment priorto writing and testing (executing) your scripts. Your scripts can either runin the Wscript or Cscript host. We recommend that you execute yourscripts from the command line and force its output to the console byusing the command prompt of either supported operating system andsetting the scripting host. You can set the scripting host to cscript bytyping:

Cscript //h:cscriptUsing cscript enables all output to be directed to the console or com-

mand prompt. If you were to output many results in your scripts theywould result in a dialog box when using wscript as scripting host. Referto Figures 7.20 and 7.21 for the difference in output when using cscriptand wscript.

Besides the scripting host, make sure you have both the MicrosoftVirtual Server SDK and the Windows Script Technologies (Windows ScriptV5.6 Documentation) open for quick reference. The Windows Script V5.6Documentation can be downloaded from the Microsoft Download Centerat www.microsoft.com/downloads/details.aspx?FamilyID=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en.

Last but not least, choose a script editor that supports line numbers.There are many free editors available that support even syntax high-lighting and other features. Most commercial script editors support moreadvanced features like debugging and step through.

Cscript has many switches you can use to configure the host or modify itsdefault behavior. Figure 7.19 shows all available switches.

Managing Virtual Server • Chapter 7 255

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 255

Page 281: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 7.19 Listing Cscript Parameters

For the scope of this chapter the most important switches are the //Hswitch to set the script host and the //Logo switch to suppress the banner.Other commonly used but less-frequent switches are the //D switch foractive debugging and the //Job switch for running specific jobs when using aWindows Script File, but we will not discuss these switches in this chapter.For more detailed explanation of the switches, please refer to the WindowsServer online documentation through Help and Support Center.

Accessing a Virtual Server Using ScriptNow that you know what is required to access the Virtual Server COMobject and what your scripting environment should look like, you are readyto create your first scripts.

Listing Virtual Server PropertiesThe Virtual Server COM object has several properties. Many properties areread-only, such as informational and runtime properties. Examples of suchproperties are Name, Version, ProductID, and UpTime. Here is a script that dis-plays the Name and Version properties of Virtual Server.

256 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 256

Page 282: Virtualization With Microsoft Virtual Server 2005 (2006)

Set objVS = CreateObject("VirtualServer.Application")

Wscript.echo objVS.Name & ", " & objVS.Version

You execute this by executing cscript <scriptname.vbs> where script-name is the name you chose for this script.The output of this script is shownin Figure 7.20.

Figure 7.20 Output of Virtual Server Name and Version

The script separates the Name output from the Version output by acomma.Although not very powerful, the script clearly depicts the ease bywhich you can retrieve information from Virtual Server. Notice the com-mand that has been used to execute the script. Because cscript has been set asthe default scripting host, it is possible to simply enter the script name on thecommand line without its extension. Figure 7.21 shows the same script resultswhen using wscript as a script host.

Figure 7.21 Output of Virtual Server Name and Version Using Wscript

Managing Virtual Server • Chapter 7 257

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 257

Page 283: Virtualization With Microsoft Virtual Server 2005 (2006)

A script that lists runtime information like UpTime is similar to the scriptabove.You access the UpTime property through objVS.UpTime.Set objVS = CreateObject("VirtualServer.Application")

Wscript.echo objVS.Name & ", " & objVS.UpTime

Designing & Planning…

Accessing Object Properties and MethodsObjects have properties and methods. Properties are values you can read(get) or write (set). The SDK always marks properties as either read-onlyor read/write.

Methods are actions you can execute. For example, theCreateVirtualMachine method of the Virtual Server object is the functionto create a virtual machine.

Methods may require parameters to be able to perform their func-tion. For CreateVirtualMachine you must supply the name and path forthe virtual machine config file or the fully qualified path. The SDKdescribes the parameters it expects, their type, and what the methodreturns.

Methods often have return values. This can be a result code, aBoolean or integer, or even an object. For example, theCreateVirtualMachine method returns an object reference to the new vir-tual machine.

Always read the explanation section on the method and its requirements.

Another script that displays the configuration paths for virtual machinesand virtual networks looks like this:Set objVS = CreateObject("VirtualServer.Application")

wscript.echo objVS.DefaultVMConfigurationPath & vbCrLf &objVS.DefaultVNConfigurationPath

The output (Figure 7.22) lists both locations on separate lines. Because theDefaultVNConfigurationPath is usually long (as the default is often kept) it isbetter to display each property on its own line.The

258 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 258

Page 284: Virtualization With Microsoft Virtual Server 2005 (2006)

DefaultVMConfigurationPath is read/write. We point this out to you because inmost Virtual Server configurations this property is changed to point to a dif-ferent location. If you want to assign a value by using script, then the onlything you would have to do is assign a value like this:objVS.DefaultVMConfigurationPath="C:\VirtualMachines"

Figure 7.22 Output of Virtual Server Configuration Paths

Setting Virtual Server PropertiesIn the previous paragraph we accessed the Virtual Server object to list someproperties. But some of those properties are likely to be changed right afterinstalling Virtual Server. One such property is the DefaultVMConfigurationPathwhich is the path Virtual Server uses to store virtual machine configurationfiles.Another property that is likely to be changed is the SearchPaths property.This is an array of strings that is being used to search for files like configura-tion files, virtual floppies, ISO images and such. Setting this property is mainlyuseful when using the Virtual Server Administration Web site for manage-ment. Because it keeps you from having to navigate to those locations, VirtualServer searches the paths and fills the list boxes in the interface. Because youprobably use the interface from time to time, it is handy to configure thisproperty from script as well. Here is how you do it:Set objVS = CreateObject("VirtualServer.Application")

objVS.SearchPaths=Array("C:\Media","C:\VirtualDisks","C:\VirtualMachines")

Managing Virtual Server • Chapter 7 259

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 259

Page 285: Virtualization With Microsoft Virtual Server 2005 (2006)

NOTE

VBScript has no definition for safearray. This type is known in Jscript.When you encounter a property of type safearray as with theSearchPaths property, you can assign a value to it. However, you cannotsimply assign a value like objVS.SearchPaths = “C:\Media” even if youonly want to assign a single value. You have to “format” the value usingthe Array function and then assign it to the variable as outlined in thecode sample.

The trick is with the array statement.The SearchPaths property is a so-called safearray of strings. By using the array statement, you assign theSearchPaths property a collection of string values.

If you want to list the SearchPaths property, you cannot do this by using asingle wscript.echo statement; the echo method of wscript requires a string, not acollection of strings. What should it display from this array? The way to dis-play values in a collection (an array is also a collection) is to use the For Each… Next loop. See the following script:Set objVS = CreateObject("VirtualServer.Application")

For Each strPath in objVS.SearchPaths

wscript.echo strPath

Next

By using a For Each loop, you instruct the script host to walk through theproperty until the last value is found. So in our example the SearchPaths prop-erty consists of three values. Every time a value is found it is assigned to thestrPath variable and echoed to the output.

Another example of setting a Virtual Server property is the VMRCEnabledproperty.This property is of type Boolean (true/false) and setting this to trueenables the Virtual Machine Remote Control service.The statement lookslike this:

objVS.VMRCEnabled=vbTrueIn this statement the intrinsic constant vbTrue is assigned to the property.

As with the previous examples you would use this in a Virtual Server config-uration script, which would run right after the installation of Virtual Server.

260 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 260

Page 286: Virtualization With Microsoft Virtual Server 2005 (2006)

The previous paragraphs were about retrieving and setting Virtual Serverproperties. Setting Virtual Server properties is probably something you won’tdo very often; they are concerned with the configuration of Virtual Serverand once set they are not likely to change frequently.You only need toretrieve those properties for monitoring or diagnostic purposes.

Most of your scripts will focus on Virtual Server’s “data”-like virtualmachines and virtual networks.The next paragraphs are about creating virtualmachines and virtual networks.

Creating a Virtual Machine Using ScriptCreating virtual machines through script saves you lots of time.The process isalso more predictable and error free.You develop the script once, test it, anddistribute it for repetitive use of creating virtual machines. It will probablystart out as a simple script without any error handling, but as you areexploring the Virtual Server SDK, you will probably end with an advancedscript that creates all aspects of the virtual machine, like virtual disks.A virtualmachine has a lot of properties just like a physical machine. When using theVirtual Server Administration Web site, you will probably create and modifyseveral of them in several steps.

You may wonder how the method CreateVirtualMachine requires so fewparameters. Notice that you have to supply only name and path or the fullyqualified name, which includes the path.The reason for this is that VirtualServer has some default values it assigns to properties like Memory andNetworkAdapters.

So creating a virtual machine from script is fairly easy, as shown in the fol-lowing example:Const strVMName="Machine1"

Set objVS = CreateObject("VirtualServer.Application")

Set objVM = objVS.CreateVirtualMachine(strVMName, _

objVS.DefaultVMConfigurationPath & "\" & strVMName)

Notice the underscore (_) at the end of the third line.This is to break uplong lines of code and tell the script host to continue reading on the nextline. If you want a single line of code, delete the underscore and place thefourth line of code after the comma.

Managing Virtual Server • Chapter 7 261

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 261

Page 287: Virtualization With Microsoft Virtual Server 2005 (2006)

You may recall from the “Accessing Object Properties and Methods”sidebar that the method CreateVirtualMachine returns an object.Therefore,we assign the returned object to a variable, which is objVM in the codesample. By doing so we can use the objVM variable and set its properties. Inthis example, we could have accomplished the same with this line of code:objVS.CreateVirtualMachine strVMName, _

objVS.DefaultVMConfigurationPath & "\" & strVMName

Notice that the parentheses in CreateVirtualMachine and the set statementhave been removed.

NOTE

Using parentheses in VBScript: When you ran the previous script, youassigned a value to objVM, which was returned from theCreateVirtualMachine method. If you modify that line by removing the“Set objVM =” part, VBScript will complain with a “Cannot use paren-theses when calling a Sub” error message. You can fix this in two ways:

Remove the parentheses (as shown above).Use a Call statement such as Call

objVS.CreateVirtualMachine(“strVM…….”).

CreateVirtualMachine is a method of the Virtual Server object. Please verifyand confirm this from the SDK because it is essential that you understandthis.The code further declares a constant for the name of the virtual machine.This constant is used in the method as parameter.Also notice that the prop-erty DefaultVMConfigurationPath is used as parameter in this method.This waywe don’t have to retrieve the value separately but “feed” it directly to thismethod.The concatenation of DefaultVMConfigurationPath, the backslash, andthe virtual machine name causes the virtual machine configuration file to becreated in its own folder.This is to follow best practices where all virtualmachine files (configuration, disks, saved state, etc.) are all grouped in thesame folder.This also eases ACL administration when configuring access tovirtual machines.

262 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 262

Page 288: Virtualization With Microsoft Virtual Server 2005 (2006)

Creating a Virtual HardDiskAlthough it is perfectly okay to have a virtual machine without virtual disks,you will most often create virtual machines with multiple virtual disksattached to them. Creating a virtual disk is not a virtual machine objectmethod but a Virtual Server method.Again, please verify that several methodsexist on the Virtual Server object to create different types of virtual disk.

If not a virtual machine method, why discuss it here? Because anothercomplexity exists with creating a virtual disk that would probably not beunderstood if it were discussed earlier in this chapter.The default type of vir-tual disk in the Virtual Server Administration Web site is the DynamicallyExpanding virtual disk.The method to create this type of disk isCreateDynamicVirtualHardDisk. Please verify from the SDK that this methodrequires two parameters: the full path to the image file and the size of the diskin megabytes.Also confirm that this method returns an object called a taskobject, defined as IVMTask.

The task object consists of several properties and methods. Some proper-ties of interest are IsCancelable, IsComplete, and PercentCompleted.An interestingmethod is Cancel, which only works if the property IsCancelable is true.Creating a virtual disk takes up time. It may be a couple of milliseconds totens of seconds depending mainly of the type of virtual disk.A dynamicallyexpanding disk is created fairly quickly whereas Fixed Size disk may takesome time to be created. Because of this you need to have a way to giveVirtual Server time to complete its operation by looping in a wait state andwithout stressing the CPU.

Let’s look at the code of creating a dynamically expanding virtual disk.Const strDisk="C:\VirtualMachines\Machine1\Machine1-disk1.vhd"

Set objVS = CreateObject("VirtualServer.Application")

Set objTask = objVS.CreateDynamicVirtualHardDisk(strDisk,500)

While not objTask.IsComplete

wscript.sleep 500

Wend

The first three lines should be clear by now.The important piece of code,which is different from all previous samples, is the While Wend loop. Here weuse the property IsComplete of the objTask object to check whether the opera-

Managing Virtual Server • Chapter 7 263

406_VIRTUAL_07.qxd 9/8/06 7:34 PM Page 263

Page 289: Virtualization With Microsoft Virtual Server 2005 (2006)

tion is complete. If not, we wait for 500 ms before checking again.This waywe prevent the script from pegging the CPU continuously.

NOTE

If you use a while loop without a back off like the 500 ms sleep, you willstress the CPU up to 100% because it is basically continuously askingitself if the condition is true. It will do so at the maximum speed pos-sible. During this chitchatting with itself it will not use the time to dothings that are actually important.

Putting It All TogetherWith our knowledge of creating a virtual machine and creating a virtual disk,we can create more advanced scripts for virtual machines.The sample shownin Code Listing 7.1 creates a virtual machine, Machine1, with 256MB ofmemory, one fixed-size virtual disk of 500MB attached to a SCSI controllerand a DVD drive.

Code Listing 7.1 Creating a Virtual Machine

Const strVMName="Machine1"

Const intMemory=256

Const strVMDisk="Machine1-Disk1-F.vhd"

Const intVMDiskSize=500

Set objVS = CreateObject("VirtualServer.Application")

strVMPath=objVS.DefaultVMConfigurationPath

'enable error handling

On error resume next

'echo stage

wscript.stdout.write "Creating fixed disk"

'get a Task object

set objTask = objVS.CreateFixedVirtualHardDisk(strVMPath & "\" & _

strVMName & "\" & strVMDisk,intVMDiskSize)

'on success use a loop to check for complete. If not complete echo dot toshow activity.

264 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 264

Page 290: Virtualization With Microsoft Virtual Server 2005 (2006)

If err.number = 0 then

While not objTask.IsComplete

wscript.stdout.write "."

wscript.sleep 500

Wend

wscript.StdOut.write(" done." & vbCRLF)

'on failure call the error handler sub routine

Else

Handle(err)

End If

'disable error handling

on error goto 0

'echo stage

wscript.StdOut.write("Creating virtual machine...")

Set objVM = objVS.CreateVirtualMachine(strVMName,strVMPath & "\" _

& strVMName)

wscript.StdOut.write(" done." & vbCRLF)

If err.number = 0 then

wscript.StdOut.write("Adding SCSI controller... ")

objVM.AddSCSIController

wscript.StdOut.write(" done." & vbCRLF)

wscript.StdOut.write("Adding SCSI disk 0... ")

'link the hard disk to the virtual machine

Call objVM.AddHardDiskConnection(strVMPath & "\" & _

strVMName & "\" & strVMDisk,1,0,0)

If err.number <> 0 then

handle(err)

End If

wscript.StdOut.write(" done." & vbCRLF)

wscript.StdOut.write("Adding DVDROMDrive...")

objVM.AddDVDROMDrive 0,1,0

wscript.StdOut.write(" done." & vbCRLF)

wscript.StdOut.write("Setting memory ...")

objVM.Memory=intMemory

wscript.StdOut.write(" done." & vbCRLF)

Else

Handle(err)

End If

Managing Virtual Server • Chapter 7 265

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 265

Page 291: Virtualization With Microsoft Virtual Server 2005 (2006)

'this is a basic erro handler routine. If anything fails, it logs and quits.

Private Sub Handle(byval error)

wscript.echo Cstr(hex(error.number)) & ", " & error.description

wscript.quit

End Sub

Set objVS = Nothing

Notice that this script does not introduce new things we have not dis-cussed earlier. What is different is white space, a different way of echoingresults (status) to the screen by using the StdOut.Write method and a separateerror handler for displaying error number and description. Notice the callstatement in front of objVM.AddHardDiskConnection.This prevents us fromhaving to remove the parenthesis.

Wscript.StdOut.Write echoes or writes to StdOut, which, in this case, is theconsole or command prompt window. It does not automatically put a carriagereturn at the end, so you can display bullets after each other to show thatsomething is happening (see Figure 7.23 for output).The last line of code isalso related to VBScript. By setting objVS to Nothing, we destroy the objectand release the memory it had occupied. Strictly speaking, this is not neces-sary but more a matter of clean programming.

Figure 7.23 Displaying Results to Show Activity

266 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 266

Page 292: Virtualization With Microsoft Virtual Server 2005 (2006)

Creating a Virtual Network Using ScriptCreating a virtual network is very similar to creating a virtual machine.Themethod to use is a method of the Virtual Server object calledCreateVirtualNetwork, as shown in Code Listing 7.2. Notice that this methodalso requires a name and a path, and you can choose how to specify them.Aswith CreateVirtualMachine, it is up to you to specify a name and path or a fullpath.This method also returns an object to the newly created virtual network.After you have created the network, you can set its properties (it has nomethods).

Because the creation of a virtual network is basically the same as for cre-ating a virtual machine, we skip the single line of code. Creating the virtualnetwork itself is not very challenging now that we know how to do that.Simply calling the CreateVirtualNetwork method with a name and path resultsin a Guests Only network.

The more interesting part is configuring the virtual network.

Code Listing 7.2 Creating a Virtual Network

Const strVNName="Network1"

Const strNetwork="192.168.150.0"

Const strMask="255.255.255.0"

Const strStartIP="192.168.150.16"

Const strEndIP="192.168.150.32"

Const strServerIP="192.168.150.1"

Set objVS = CreateObject("VirtualServer.Application")

Set objVN=objVS.CreateVirtualNetwork(strVNName,_

objVS.DefaultVNConfigurationPath)

Set objDHCP=objVN.DHCPVirtualNetworkServer

objDHCP.IsEnabled=vbTrue

objDHCP.ConfigureDHCPServer strNetwork,strMask,_

strStartIP,strEndIP,strServerIP

This script first sets the network name and DHCPServer parameters. Pleaseconfirm that when you need to configure the virtual DHCP server of thenetwork that you have to use the DHCPVirtualNetworkServer property. Noticethat this property returns an object of type DHCPVirtualNetworkServer, which

Managing Virtual Server • Chapter 7 267

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 267

Page 293: Virtualization With Microsoft Virtual Server 2005 (2006)

has both methods and properties. In the last two lines, the script sets theIsEnabled property to true and uses the ConfigureDHCPServer method of theDHCPVirtualNetworkServer object (objDHCP) to configure DHCP scope settings.

Suppose we just ran this script but we wanted to attach this virtual net-work to the Virtual Server host adapter. Suppose you have a physical hostadapter called “Broadcom NetXtreme Gigabit Ethernet.”A script that changesthe configuration of Network1 would look like this:Const strVNName="Network1"

Set objVS=CreateObject("VirtualServer.Application")

Set objVN=objVS.FindVirtualNetwork(strVNName)

objVN.HostAdapter="Broadcom NetXtreme Gigabit Ethernet"

In the third line of code, we retrieve a virtual network object from thecollection of objects. Notice that this is a Virtual Server object method.Afterwe have the virtual network object (objVN), we can set the HostAdapter prop-erty to that of the physical host adapter description.

NOTE

The value for the HostAdapter property of the virtual network can beretrieved from ipconfig using the /all switch. You can then copy thedescription from the host network adapter.

Retrieving Guest OS Information Using ScriptInformation from the Guest OS can also be retrieved using script. However,there are some dependencies and restrictions for a successful retrieval of information.

The GuestOS is a property of a virtual machine. When you access theproperty an object is returned.The problem is that the GuestOS propertyexists only when a virtual machine is running.This means that the followingscript fails when the machine is in saved state.

268 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 268

Page 294: Virtualization With Microsoft Virtual Server 2005 (2006)

Const strVMName="Machine1"

Set objVS=CreateObject("VirtualServer.Application")

Set objVM=objVS.FindVirtualMachine(strVMName)

Set objOS=objVM.GuestOS

wscript.echo objOS.OSName

The resulting output of this script contains an error message like this:(null):The virtual machine could not be found or is not running.Another issue with the GuestOS property lies with the existence of the

Virtual Machine Additions.They must be installed inside the virtual machinefor the properties to get values. Without the additions, the properties will stayempty.

So how should you retrieve information properly? Look at the followingmodified script:Const strVMName="Machine1"

Set objVS=CreateObject("VirtualServer.Application")

Set objVM=objVS.FindVirtualMachine(strVMName)

Set objOS=objVM.GuestOS

If objOS.IsHeartbeating then

wscript.echo objOS.OSName

End If

This script uses the IsHeartBeating property of the GuestOS object. Whenthis property is true you validate two things:

1. The additions are installed.

2. The virtual machine is running and sending information (heart-beating).

The following script lists all properties of the object:Const strVMName="Machine1"

Set objVS=CreateObject("VirtualServer.Application")

Set objVM=objVS.FindVirtualMachine(strVMName)

Set objOS=objVM.GuestOS

On Error Resume Next

If objOS.AdditionsVersion <> "" then

If err.number <> 0 then

Managing Virtual Server • Chapter 7 269

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 269

Page 295: Virtualization With Microsoft Virtual Server 2005 (2006)

wscript.echo err.Description

wscript.quit

End If

If objOS.IsHeartbeating then

With objOS

wscript.echo "VM Additions version : " & .AdditionsVersion

wscript.echo "Operating System Name : " & .OSName

wscript.echo "HeartBeat percentage : " & .HeartBeatPercentage

wscript.echo "Is Heart Beating : " & _

BoolToString(.IsHeartbeating)

wscript.echo "OS can shutdown : " & _BoolToString(.CanShutdown)

wscript.echo "Host time sync enabled : " & _BoolToString(.IsHostTimeSyncEnabled)

End With

End If

End If

Function BooltoString(bool)

If bool = vbTrue then

booltostring="True"

Else

booltostring="False"

End If

End Function

Figure 7.24 displays the output of the script. Note the capital T at the endof Server. It is the Trademark symbol, which cannot be displayed.Also noticethe can shutdown property. When this property is set to true, you can executethe GuestOS.Shutdown method to shut down the virtual machine.This is theoperating system shutdown function, which is the same when you interac-tively select Start | Shut Down from the Start Menu.

270 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 270

Page 296: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 7.24 Listing GuestOS Properties

Another method to notice is the GuestOS.InstallAdditions.This methodalso does not have any parameters. When executed, Virtual Server will mountthe Virtual Machine Additions ISO (VMAdditions.iso), which in turn resultsin execution of the Virtual Machine Additions setup, but only if Autorun isenabled on the guest OS.

Changing a Virtual Machine State Using ScriptScripts help out with automating tasks that are either time consuming, errorprone, or repetitive.The previous paragraphs all covered retrieving or modi-fying settings or creating virtual machines and networks. But scripts also havea huge value for operational tasks such as monitoring and control.

For example, if you have a lot of virtual machines on a Virtual Serverhost, and it’s very likely that you will, it can be a very tedious job to save theirstate or shut them down manually. Suppose that you have to do maintenanceon the Virtual Server host, which requires you to shut it down.Touching eachand every virtual machine is unrealistic and unnecessary. Scripting is theanswer here as well.

From the previous paragraphs we have seen that there is a Shutdownmethod on the GuestOS object.You may need that method from time totime. Very often you may not want to shut down the operating system butwant to save the state of the virtual machine. Methods to change virtualmachine state exist on the virtual machine object.These methods are:

Managing Virtual Server • Chapter 7 271

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 271

Page 297: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Pause Puts a running virtual machine on hold. In this state there isno execution, but the machine still has all its resources allocated.

■ Reset This resets the virtual machine. Compare to a hard power offor unplugging the power.

■ Resume This resumes a paused virtual machine.

■ Save This puts a running virtual machine in saved state. In that statethe virtual machine releases its resources on the host.

■ Startup This starts a virtual machine. If it was in the turned off stateit will start. If it was in saved state it will load from the saved state fileand continue running.

■ TurnOff This has the same effect as reset except that it is kept turnedoff.

The Virtual Machine State ModelThe Virtual Server SDK contains a Virtual Machine State Diagram.This dia-gram of a State Machine is important when using virtual machines andchanging state.The transition of a virtual machine from one state to the otherfollows a strict path. For example, a virtual machine cannot go from turned offto saved state. It must enter the running state first.Also, the change of staterequires time.As with the creation of virtual disks, this depends on the statethe virtual machine is in and the state it has to transition to (see Figure 7.25).

Figure 7.25 Virtual Machine States

272 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 272

Page 298: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 7.25 shows three virtual finite machine states: running/paused, saved,and turned off.The events or methods are denoted with a vertical arrow.Thetransition states are shown by dashed lines.

This figure is drawn to clearly depict states, their transition path, and theevent that results in a state change. For example, when a virtual machine is inthe running/paused state, the save method causes a transition to saved state.Thestartup method can then be used to change the state back to running. Duringthese transitions, the machine state is saving and restoring respectively.Thesestates depict a transition. Notice that technically a saved virtual machine isturned off but in a special state, the saved state.

Changing the state of a virtual machine requires a good understanding ofeach type of virtual machine state and the paths the virtual machine canfollow to change into the desired state. In your code you have to retrieve thecurrent state and based upon that decide what you can do. Consider the fol-lowing script:Const strVMName="Machine1"

Set objVS=CreateObject("VirtualServer.Application")

Set objVM=objVS.FindVirtualMachine(strVMName)

objVM.Startup

If we assume for now that machine1 does exist, then the startup methodmay still fail. For example, when the virtual machine is paused, the startupmethod will not make it resume.Therefore, you should add code that com-plements the method you want to execute.Const strVMName="machine1"

Const vmVMState_Invalidvm = 0

Const vmVMState_TurnedOff = 1

Const vmVMState_Saved = 2

Const vmVMState_TurningOn = 3

Const vmVMState_Restoring = 4

Const vmVMState_Running = 5

Const vmVMState_Paused = 6

Const vmVMState_Saving = 7

Const vmVMState_TurningOff = 8

Const vmVMState_MergingDrives = 9

Const vmVMState_DeleteMachine = 10

Managing Virtual Server • Chapter 7 273

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 273

Page 299: Virtualization With Microsoft Virtual Server 2005 (2006)

Set objVS=CreateObject("VirtualServer.Application")

Set objVM=objVS.FindVirtualMachine(strVMName)

If objVM.State = vmVMState_TurnedOff then

objVM.Startup

End if

This code properly checks the state of the virtual machine prior to callingthe startup method. Notice the virtual machine state codes.These are definedin the Virtual Server SDK under Virtual Server COM InterfaceEnumerations.The virtual machine state codes are the values for theVMVMState enumeration, which you will find mentioned under the virtualmachine state methods. Using the values as constants makes your code easierto read.

Code Listing 7.3 is a somewhat different script that basically does thesame. It uses the state codes differently (in an array) and is more generalbecause it works with command-line arguments.

Code Listing 7.3 Starting Virtual Machines That Are in Turned Off State

Option Explicit

Dim objVS, objVM, strVMName, VMStates

VMStates = Array("Invalid", "Turned Off","Saved","Turning On", "Restoring","Running", "Paused", "Saving", "Turning Off", "Merging Drives", "DeletingMachine")

If wscript.Arguments.Count <> 0 then

Set objVS=CreateObject("VirtualServer.Application")

strVMName=wscript.arguments(0)

Set objVM=objVS.FindVirtualMachine(strVMName)

If err.number = 0 then

On Error Resume Next

wscript.echo "Current state of " & strVMName & " _

is " & VMStates(objVM.State)

if err.number <> 0 then

Handle(err)

end if

If VMStates(objVM.State) = "Turned Off" then

objVM.Startup

274 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 274

Page 300: Virtualization With Microsoft Virtual Server 2005 (2006)

End If

else

wscript.echo "An error occcurred finding virtual machine " & strVMName

End If

Else

wscript.echo "You must supply the name of the virtual machine"

End If

Sub Handle(err)

wscript.echo Cstr(hex(err.number)) & ", " & err.description

wscript.quit

End Sub

Attaching Scripts to Virtual Server EventsScripts can be attached to both Virtual Server and virtual machine events.Theevents for virtual machines are mostly related to virtual machine statechanges, loss of heartbeats, and processor- and disk-related conditions of thehost.The events for Virtual Server are related to Virtual Server servicechanges and the previously mentioned events for virtual machines except thatthese events are for any virtual machine. So events on the Virtual Server levelare generic for all virtual machines; those on virtual machine level are virtualmachine specific.

Attaching scripts to these events gives you more flexibility in controllingthe behavior of Virtual Server. For example, when Virtual Server starts, youmay want to be able to control the sequence in which virtual machines arestarted. Furthermore, you may not only want to start those machines insequence, but also only start additional virtual machines when specific serviceslike Active Directory are operational. In such a scenario, you could attach ascript to the event called Command-line action when Virtual Server starts. Let’slook at a script that starts two virtual machines but only starts the secondwhen the operating system is running:Option Explicit

Dim objVS, objVM, strVMName, VMStates

Managing Virtual Server • Chapter 7 275

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 275

Page 301: Virtualization With Microsoft Virtual Server 2005 (2006)

VMStates = Array("Invalid", "Turned Off","Saved","Turning On", "Restoring","Running", "Paused", "Saving",_

"Turning Off", "Merging Drives", "Deleting Machine")

Const strVM1="Machine1"

Const strVM2="Machine2"

Set objVS=CreateObject("VirtualServer.Application")

Set objVM=objVS.FindVirtualMachine(strVM1)

If err.number = 0 then

objVM.Startup

End If

On error resume next

While not objVM.GuestOS.IsHeartbeating

wscript.sleep 1000

Wend

Set objVM=objVS.FindVirtualMachine(strVM2)

objVM.Startup

Notice that we did not create a Task object to track completion. In thiscase, we use a While Wend loop and check for the IsHeartBeating Boolean.When set to true, the machine has successfully started and the operatingsystem is running.

To attach this script to the Virtual Server event called Command-lineaction when Virtual Server starts, perform the following:

Open the Virtual Server Administration Web site, click ServerProperties, click Virtual Server scripts, and tick the checkbox next toEnable scripts attached to this server. See Figure 7.26 for a screen reference.

276 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 276

Page 302: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 7.26 Attaching a Script to a Virtual Server Event

Attaching Scripts to Virtual Machine EventsAttaching a script to a Virtual Server event involves just a few steps.You haveto enable scripting in the Virtual Server properties and attach the script to thedesired event. If you want to attach a script to a virtual machine, then youhave to configure additional settings.

First, you have to enable scripting on the virtual machine level. See Figure7.26 for the location to enable scripting.To enable scripting, tick thecheckbox next to Enable scripts attached to virtual machines runningon this server.You will not be able to configure scripting on any virtualmachine without this setting enabled.

Second, you will have to configure the virtual machine to run under aspecific user account.This is for security reasons. By default, the local admin-istrator’s security group has full control of Virtual Server. When a virtualmachine has not been configured to run under a specific user account, it runsunder the account that started it and so would any script that would run as aresult of a virtual machine event.Therefore, you must configure each andevery virtual machine to run under a specific user account if you want toattach scripts.

Managing Virtual Server • Chapter 7 277

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 277

Page 303: Virtualization With Microsoft Virtual Server 2005 (2006)

The user account can be an account with user privilege.The user needsproper NTFS access to all the objects that belong to the virtual machine orare related due to its configuration. For example, with a virtual machine witha differencing disk and one parent and attached to a virtual network, theaccount must have read access to the parent virtual disk, read access to thevirtual network, and write access to the differencing disk, the virtual machineconfig file, and any other writeable file. Generally, it is easier to give thataccount write access to the virtual machine folder. Of course, you must alsogive that account read access to the script and consider all access requirementsas a result of running the script.

Scripts in ActionCode Listings 7.4 through 7.9 are examples of several scripts that you can usein day-to-day operations of Virtual Server.The scripts are focused towardsusing the COM API and do not deal much with error handling.This is keptto a minimum to keep the scripts small and clear. Code Listing 7.4 showshow to save all running virtual machines.

Code Listing 7.4 Save All Running Virtual Machines

Option Explicit

Dim objVS, objVM, objTask, objVMCol, NameLength, MaxNameLength, VMStateCodes

Set objVS = CreateObject("VirtualServer.Application")

VMStateCodes = Array("Invalid", "Turned Off","Saved","Turning On","Restoring", "Running", "Paused", "Saving",_

"Turning Off", "Merging Drives", "Deleting Machine")

Set objVMCol = objVS.VirtualMachines

'Get maximum Name Length for display formatting

For Each objVM in objVMCol

NameLength = Len(objVM.Name)

If MaxNameLength < NameLength Then

MaxNameLength = NameLength

End If

Next

'Start up all VMs

Wscript.stdout.write("MACHINE" & Space(MaxNameLength-7) & " - " & "STATUS" &vbCRLF)

wscript.echo

278 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 278

Page 304: Virtualization With Microsoft Virtual Server 2005 (2006)

For Each objVM in objVMCol

Wscript.stdout.write(objVM.Name & Space(MaxNameLength - Len(objVM.Name))& " - " & VMStateCodes(objVM.State) & vbCRLF)

If VMStateCodes(objVM.State) = "Running" then

Set objTask = objVM.Save()

wscript.sleep(500)

Wscript.stdout.write(Space(MaxNameLength) & " " &VMStateCodes(objVM.State) & " ")

While not objTask.IsComplete

wscript.sleep(1000)

Wscript.stdout.write(".")

Wend

wscript.stdout.write(" " & VMStateCodes(objVM.State))

End If

wscript.stdout.write(vbCRLF)

Next

Set objVS = Nothing

Code Listing 7.5 Start All Saved Virtual Machines

Option Explicit

Dim objVS, objVM, objTask, objVMCol, NameLength, MaxNameLength, VMStateCodes

Set objVS = CreateObject("VirtualServer.Application")

VMStateCodes = Array("Invalid", "Turned Off","Saved","Turning On","Restoring", "Running", "Paused", "Saving",_

"Turning Off", "Merging Drives", "Deleting Machine")

Set objVMCol = objVS.VirtualMachines

'Get maximum Name Length for display formatting

For Each objVM in objVMCol

NameLength = Len(objVM.Name)

If MaxNameLength < NameLength Then

MaxNameLength = NameLength

End If

Next

'Start up all VMs

Wscript.stdout.write("MACHINE" & Space(MaxNameLength-7) & " - " & "STATUS" &vbCRLF)

wscript.echo

For Each objVM in objVMCol

Managing Virtual Server • Chapter 7 279

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 279

Page 305: Virtualization With Microsoft Virtual Server 2005 (2006)

Wscript.stdout.write(objVM.Name & Space(MaxNameLength -Len(objVM.Name)) & " - " & VMStateCodes(objVM.State) & vbCRLF)

If VMStateCodes(objVM.State) = "Saved" then

Set objTask = objVM.Startup()

wscript.sleep(500)

Wscript.stdout.write(Space(MaxNameLength) & " " &VMStateCodes(objVM.State) & " ")

While not objTask.IsComplete

wscript.sleep(1000)

Wscript.stdout.write(".")

Wend

wscript.stdout.write(" " & VMStateCodes(objVM.State))

End If

wscript.stdout.write(vbCRLF)

Next

Set objVS = Nothing

Code Listing 7.6 List all MAC Addresses per Virtual Machine

Option Explicit

Dim objVS, objVMCol, objVM, objAdap, objAdapCol

Set objVS = CreateObject("VirtualServer.Application")

Set objVMCol = objVS.VirtualMachines

For Each objVM in objVMCol

Set objAdapCol = objVM.NetworkAdapters

For Each objAdap in objAdapCol

wscript.stdout.write("MAC address: " & objAdap.EthernetAddress _

& ", Virtual machine: " & objVM.Name & vbCRLF)

Next

Next

Set objVS = Nothing

Code Listing 7.7 List all Attached Floppy Images

Option Explicit

Dim objVS, objVM, objVMCol, objVF, objVFCol

Set objVS = CreateObject("VirtualServer.Application")

Set objVMCol = objVS.VirtualMachines

280 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 280

Page 306: Virtualization With Microsoft Virtual Server 2005 (2006)

On error Resume Next

For Each objVM in objVMCol

Set objVFCol = objVM.FloppyDrives

If objVFCol.Count > 0 then

For Each objVF in objVFCol

If objVF.ImageFile <> "" then

wscript.stdout.write("Machine: " & objVM.Name _

& " " & objVF.ImageFile & vbCRLF)

End If

Next

End If

Next

Set oVS = Nothing

Option explicit

Dim objVS, objVM

Set objVS = CreateObject("VirtualServer.Application")

If wscript.arguments.count > 1 then

Set objVM = objVS.FindVirtualMachine(wscript.arguments(0))

If objVM.DVDROMDrives.Count > 0 then

Select case objVM.DVDRomDrives.Item(1).Attachment

case 1 objVM.DVDRomDrives.Item(1).ReleaseImage

case 2 objVM.DVDRomDrives.Item(1).ReleaseHostDrive

End Select

On Error Resume Next

objVM.DVDROMDrives.Item(1).AttachImage(wscript.arguments(1))

If err.number <> 0 then

handle(err)

End If

wscript.echo objVM.DVDROMDrives.Item(1).ImageFile & " attached to " &objVM.Name

Else

wscript.echo "No DVD Drive in virtual machine " & wscript.arguments(0)

End If

Else

wscript.echo "Syntax: AttachDVDImage <VirtualMachineName><FullPathToImageFile>"

End If

Managing Virtual Server • Chapter 7 281

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 281

Page 307: Virtualization With Microsoft Virtual Server 2005 (2006)

Code Listing 7.8 Attach DVD Image to Virtual Machine

Private Sub Handle(byval error)

wscript.echo Cstr(hex(error.number)) & ", " & error.description

End Sub

Set objVS = Nothing

Code Listing 7.9 List all Registered Virtual Machines

Option Explicit

Dim objVS, objVMCol, objVM, VMStateCodes, NameLength, MaxNameLength

Set objVS = CreateObject("VirtualServer.Application")

VMStateCodes = Array("Invalid", "Turned Off","Saved","Turning On","Restoring", "Running", "Paused", "Saving",_

"Turning Off", "Merging Drives", "Deleting Machine")

Set objVMCol=objVS.VirtualMachines

For Each objVM in objVMCol

NameLength = Len(objVM.Name)

If MaxNameLength < NameLength Then

MaxNameLength = NameLength

End If

Next

wscript.stdout.write "Number of registered VM's: " & objVMCol.Count & vbCRLF

For Each objVM in objVMCol

wscript.StdOut.write(objVM.Name & space(MaxNameLength - Len(objVM.Name))& " - ")

wscript.echo VMStateCodes(objVM.State)

Next

Set objVS = Nothing

282 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 282

Page 308: Virtualization With Microsoft Virtual Server 2005 (2006)

SummaryThis chapter covered the more advanced methods of managing Virtual Server.By setting up a management server, you can manage all Virtual Server hostsusing a single instance of the Virtual Server Administration Web site.This wayyou do not have to install Internet Information Services on each and everyVirtual Server installation.

The other method of managing Virtual Server is by using the COM APIand programming the actions through your favorite programming environ-ment, whether a scripting environment or any other development language. Itdoes not matter what you choose as long as your language supports theCOM object model.

By using scripting with VBScript or Jscript, your code is open toeveryone and can easily be shared among all Virtual Server hosts. Scripts caneasily be modified and new functionality can be created of them.

Scripting Virtual Server is easy after you understand the Virtual ServerCOM API.Tasks that require many steps in the graphical user interface cannow be automated, which saves time, prevents errors, and makes your VirtualServer configuration tasks more predictable.

Solutions Fast Track

The Management Interface

■ The Virtual Server management interface is Web based and requiresInternet Information Services.

■ System Center Virtual Machine Manager, to be released in the nearfuture, no longer has this requirement.

■ Virtual Server hosts in the same Windows Server 2003 domain canall be managed centrally from one Internet Information Services siteusing the Virtual Server Administration Web site.

Managing Virtual Server • Chapter 7 283

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 283

Page 309: Virtualization With Microsoft Virtual Server 2005 (2006)

Using the Virtual Server COM API

■ The Virtual Server COM API is documented in the Virtual ServerProgrammer’s Guide.

■ This guide is really the Virtual Server SDK and installed with theproduct.

■ Being able to navigate through the SDK is a requirement for easyand successful programming of Virtual Server.

Accessing a Virtual Server Using Script

■ You can access Virtual Server properties and methods with a singleline of code.

■ Use the VBScript CreateObject function with the Virtual ServerProgID to establish the connection.

Creating a Virtual Machine Using Script

■ Create a virtual machine by using the CreateVirtualMachine method.

■ You must create machine properties such as virtual disks first.

Creating a Virtual Network Using Script

■ Create a virtual network by using the CreateVirtualNetwork method.

Retrieving Guest OS Information Using Script

■ Retrieve guest OS information through the GuestOS property of thevirtual machine object.

■ Information is only available when the virtual machine additionshave been installed and the virtual machine is in the running state.

284 Chapter 7 • Managing Virtual Server

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 284

Page 310: Virtualization With Microsoft Virtual Server 2005 (2006)

Changing a Virtual Machine State Using Script

■ Change the state of a virtual machine by using the appropriate statemethod of the virtual machine object.

■ The state transition of a virtual machine follows a state machinemodel.

Attaching Scripts to Virtual Server Events

■ You can attach scripts to both Virtual Server and virtual machineevents.

■ Attaching scripts gives you more control of the operations.

Q: Are Internet Information Services required to manage Virtual Server?

A: No.You can manage Virtual Server any way you like by using the COMAPI.

Q: Does every Virtual Server installation require Internet InformationServices?

A: No.You can manage any Virtual Server using a central management site.

Q: Do sample scripts exist for managing Virtual Server?

A: Yes.You can download Virtual Server script samples from the Microsoftscripting center.

Managing Virtual Server • Chapter 7 285

Frequently Asked Questions

The following Frequently Asked Questions, answered by the authors of this book,are designed to both measure your understanding of the concepts presented in this chapter and to assist you with real-life implementation of these concepts. Tohave your questions about this chapter answered by the author, browse towww.syngress.com/solutions and click on the “Ask the Author” form.

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 285

Page 311: Virtualization With Microsoft Virtual Server 2005 (2006)

Q: Do I need to be a developer to successfully script Virtual Server?

A: No.You need basic scripting skills and the Virtual Server Programmer’sGuide.

Q: Can scripts developed for Virtual Server 2005 be used on Virtual Server2005 R2?

A: Yes.The COM API has not changed between these versions.

Managing Virtual Server • Chapter 7 286

406_VIRTUAL_07.qxd 9/8/06 7:35 PM Page 286

Page 312: Virtualization With Microsoft Virtual Server 2005 (2006)

Migrating Physical Machines

Solutions in this chapter:

■ Getting the Virtualization EnvironmentReady for Usage

■ Capturing the Physical Machine

■ Creating the Virtual Machine on the VirtualServer Host

■ Deploying the Virtual Machine on the Host OS

Chapter 8

287

� Summary

� Solutions Fast Track

� Frequently Asked Questions

406_VIRTUAL_08.qxd 9/8/06 6:46 PM Page 287

Page 313: Virtualization With Microsoft Virtual Server 2005 (2006)

IntroductionThis is where it all comes together.You’re getting ready to duplicate all datafrom the physical server to your virtualization environment. Now everythingcomes down to the procedure.There are three stages that the system will passthrough, during which you must take several actions. First is preparation: youmust retrieve the information of the physical server, check and validate theinformation, and generate the virtualization scripts, making it possible to cap-ture the physical server. Second is creation: you must create the virtualmachine before the captured image can be deployed.Third is deployment:you must deploy the captured data to the virtual machine and perform thepost-migration actions.

Getting the Virtualization Environment Ready for UsageThe virtualization environment has to be prepared for the virtualization pro-cess. For the virtualization of servers you need three components:AutomatedDeployment Services (ADS), Dynamic Host Configuration Protocol(DHCP), and the virtual server migration tool. If you already have DHCP orADS running on your network, you can use these installations.

Setting Up the Virtualization toolsIn this chapter you will learn about the additional tools needed for the virtu-alization process.The first step for preparing our virtualization environment isthe installation of an ADS server, which is described in Chapter 6.This serverwill make the image of the physical server, deploy the image to a virtualmachine, and make the necessary changes for the machine to run in a virtualenvironment.These changes are described later in this chapter.

You will also install the virtual server migration tools on this server. Withthis installation, you install the tools for gathering information and generatingthe migration scripts and sources for changing files in the operating system.All this will be described in more detail in the following paragraphs.

288 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:46 PM Page 288

Page 314: Virtualization With Microsoft Virtual Server 2005 (2006)

Designing & Planning…

Planning the ADS ServerIt is possible to install ADS (the virtualization server) on the same server asthe virtual server. This is the simplest installation and is the best option ifyou use ADS only for virtual server migration.

If you use ADS for other purposes, such as installing new servers, youcan better separate the ADS server from the virtual server by installing iton another server. This eliminates the performance loss that the virtualmachines will encounter when you use the ADS server.

ADS uses PXE boot to capture and deploy the images. If you useother PXE services on your network (like Remote Installation Services[RIS]), you have to separate these services from the ADS services.

As mentioned before, you can install ADS on a separate server, butthis doesn’t necessarily have to be a physical server, it can be a virtualmachine. If you install ADS on a virtual machine, you can connect to thevirtual machine on a loopback adapter and you can use a second networkinterface card with a crosslink cable or on a different VLAN for the virtu-alization process.

Installing VSMT and ADS Agent on the Virtual Server HostThe Virtual Server Migration Toolkit software has to be installed on both thevirtualization server and the virtual server host computer. If you run ADS onthe virtual server host computer, you don’t have to install the ADSAdministration Agent.

If you choose to install ADS on a separate server, you will have to installthe ADS Administration Agent on the server hosting your virtual machines.Install the agent by launching ADSSetup.exe from the directory where youunpacked the ADS_VSMT_1.1.exe file and selecting Install ADSAdministration Agent (see Figure 8.1).

Migrating Physical Machines • Chapter 8 289

406_VIRTUAL_08.qxd 9/8/06 6:46 PM Page 289

Page 315: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 8.1 ADS Setup Splash Screen

During the installation of the ADS server service, a certificate is createdon the ADS server. During setup of the ADS agent, install this ADS certificateso that the client can communicate with the ADS server.The certificate islocated in the certificate folder of the ADS installation directory. Normallythis is \\Servername\C$\program files\microsoft ADS\certificate\adsroot.cer(see Figure 8.2).

Figure 8.2 ADS Agent Certificate Installation

290 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:46 PM Page 290

Page 316: Virtualization With Microsoft Virtual Server 2005 (2006)

When asked, provide the credentials of a user who can access resources onthe Virtual server host and the ADS server (see Figure 8.3).These credentialsare used to run the ADS Administration Agent service, which communicateswith the ADS server.The credentials that you use must have access rights onthe ADS server.

Figure 8.3 ADS Agent Logon Settings

NOTE

If you for some reason chose a wrong account during the installation,you can later change the account by using the changeagentlogon.exeprogram. This program can be found in the bin directory of the folder inwhich you installed the ADS Administration Agent. By default this is:%systemroot%\program files\Microsoft ADS\bin.

The syntax is: changeagentlogon username /password password.

Whether you separated Virtual Server and ADS or you are running themon the same machine, in both cases you need to install VSMT.

The installation of VSMT on a computer running Virtual Server and ADSserver is described in Chapter 6.

The following information is the installation of VSMT on the virtualserver host computer where ADS is installed on a separate server.

Migrating Physical Machines • Chapter 8 291

406_VIRTUAL_08.qxd 9/8/06 6:46 PM Page 291

Page 317: Virtualization With Microsoft Virtual Server 2005 (2006)

From the directory where you unpacked the ADS_VSMT_1.1.exe file,launch ADSSetup.exe and select Install Virtual Server MigrationToolkit.

On the Setup Type screen, choose Tools only (see Figure 8.4).The onlydifference between tools only and a full installation are the source directorieswith patches for all the different Windows versions.These directories areneeded only on the computer running the ADS server.

Figure 8.4 VSMT Installation Setup Type

This is the only setup choice you have to make during this installation.On the next page, click Finish and you are done.

Creating the Virtual NetworkFor the creation of the virtualized machines, the Virtual Server MigrationTool (VSMT) uses a virtual network.The default network that is used isVM0.And it can be created by running a script that is installed with VSMT.The script is located in the installation folder of VSMT in a subfolder calledSamples and is called CreateVirtualNetwork.vbs (see Figure 8.5).

292 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:46 PM Page 292

Page 318: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 8.5 Virtual Network VM0

This script has to be run on the virtual server host computer. It firstchecks for the installation of Virtual Server and VSMT and then creates thevirtual network VM0.

The virtual network VM0 will be connected to the first network interfacecard of the host server (see Figure 8.6).

Figure 8.6 Virtual Network VM0

NOTE

The virtual network can be used during the deployment step and for thecreation of the virtual machine. But it is also possible to use another vir-tual network by default. This is done by editing the Vsmt_initenv.cmdfile. It is also possible to specify a different virtual network for onemigration by using the VSHostNet switch when you generate the migra-tion scripts.

Capturing the Physical MachineNow that the virtualization environment is complete, it’s time to start withthe process of capturing the physical machine.

Migrating Physical Machines • Chapter 8 293

406_VIRTUAL_08.qxd 9/8/06 6:46 PM Page 293

Page 319: Virtualization With Microsoft Virtual Server 2005 (2006)

Before you begin the migration, you will have to perform the followingtasks to prepare the physical machine: If the machine contains any FAT vol-umes, you have to convert them to NTFS. VSMT does not migrate FAT vol-umes.You can convert FAT volumes to NTFS by using a conversion toolsuch as Convert.exe.

If the machine is running Windows NT Server 4.0 Service Pack 6a, youhave to install hotfix 872952 to solve issues with NTFS and you have toinstall the Windows Management Instrumentation core 1.5.To get a betterperformance during migration, it’s advisable to run chkdsk on the WindowsNT4 server and defragment drives with fragmentation.

Make sure that the computer is not being managed by ADS. If it is, releasecontrol of the device and delete the device record.

When your source computer contains multiple network adapters, make anote of the Media Access Control (MAC) address of the network adapter youwill use for the migration.This network adapter must support PXE booting.

Remember, there are a lot of hardware devices that require specificdrivers, but there is a large possibility that Microsoft Virtual Server 2005 R2is not able to provide support for all of them.This lack of support can resultin performance loss of even failure to boot to Windows. Fortunately, thesethings do no harm to the source machine because no data is written on thesource servers. But when you are in the middle of a migration, you do notwant to have a failing target server.

One example of Microsoft Virtual Server having trouble booting orshowing a performance loss is when Virtual Server uses unsupported RAIDcontrollers or other non-SCSI or non-IDE storage devices

Other problems may arise on the type of chipset that is used. It is likelythat the drivers of the old system are not compatible.

There is stop-gap option for this problem, however: editing theP2Vdrivers.XML file.

294 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:46 PM Page 294

Page 320: Virtualization With Microsoft Virtual Server 2005 (2006)

You can define these specific drivers in the P2Vdrivers.xml file.This filecan be found in the Patches folder in the VSMT installation directory.

An example is shown here:<?xml version="1.0" encoding="utf-8" ?>

<!--

This file is part of the Microsoft Virtual Server 2005 Migration Toolkit

Copyright (c) Microsoft Corporation. All rights reserved.

-->

<Configuration>

<!-- The services to disable -->

<Service Name="VMware Tools Service" Start="Disable" />

<!-- drivers to disable -->

<Driver Name="vmx_svga" Start="Disable" />

<Driver Name="vmmouse" Start="Disable" />

<Driver Name="vmscsi" Start="Disable" />

<Driver Name="amdpcn" Start="Disable" />

<Driver Name="PCnet" Start="Disable" />

<Driver Name="cirrus" Start="Disable" />

<!-- storage drivers -->

<Driver Name="buslogic" Start="Disable" />

<Driver Name="symc810" Start="Disable" />

<Driver Name="cpqarray" Start="Disable" />

<Driver Name="pcntn4m" Start="Disable" />

<Driver Name="cpqnf3" Start="Disable" />

<Driver Name="MRaidNT" Start="Disable" />

<Driver Name="Symc8XX" Start="Disable" />

<!-- VIA chipset drivers -->

<Driver Name="viaide" Start="Disable" />

<Driver Name="VIAudio" Start="Disable" />

<Driver Name="VIAPFD" Start="Disable" />

Migrating Physical Machines • Chapter 8 295

406_VIRTUAL_08.qxd 9/8/06 6:46 PM Page 295

Page 321: Virtualization With Microsoft Virtual Server 2005 (2006)

<Driver Name="viafilter" Start="Disable" />

<Driver Name="viaagp" Start="Disable" />

<Driver Name="viaagp1" Start="Disable" />

<!-- network drivers: Intel(R) PRO/100 -->

<Driver Name="E100B" Start="Disable" />

<Program Name="ProMON.exe" Action="Remove" />

<!-- tape drivers -->

<Driver Name="4mmdat" Start="Disable" />

<Driver Name="4mmdat-SeSFT" Start="Disable" />

<Driver Name="SCSIChanger" Start="Disable" />

<!-- The programs in the autorun section to disable -->

<Program Name="s3tray2" Action="Remove" />

</Configuration>

NOTE

Virtual Server replaces drivers so that the machine can run in a virtualenvironment. These drivers are the English versions; if you want to uselocalized versions of drivers, you can copy them to the Patches folder inthe VSMT installation folder. To capture the data of the physicalmachine, you must follow a three-step process. The first is to inventorythe hardware and operating system; the second is to create the scripts;and the third is to capture the disks into image files (see Figure 8.7).

Figure 8.7 Capture Process

296 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 296

Page 322: Virtualization With Microsoft Virtual Server 2005 (2006)

Hardware InventoryThe first step is to gather information about the physical server.To be able tomigrate a physical machine to a virtual environment, it is necessary for VSMTto know which hardware and which operating system is used on the sourcecomputer.To gather this data, use a program called GatherHW.exe, which canbe found in the Microsoft VSMT directory.

GatherHW /? shows the available parameters (see Figure 8.8).

Figure 8.8 The GatherHW Command Prompt

GatherHW generates an XML file from which the migration scripts aregenerated. By default, this file is written in the same location thatGatherHW.exe is run from.This can also be a removable medium, like anFDD or a USB drive.The data in the XML file can be categorized as follows:

■ General system information (operating system, number of processors,memory)

■ Storage configuration (IDE/SCSI)

■ Physical disks, partitions and logical drives

■ Network information (MAC, IP, DHCP, DNS, etc.)

■ Video configuration

Migrating Physical Machines • Chapter 8 297

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 297

Page 323: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Ports (serial, parallel, sound)

■ DVD/CD information

■ Services

■ Drivers

■ AutoRun information

To gather all this information, the tool uses Windows ManagementInstrumentation (WMI).

WARNING

WMI is not installed by default on Windows NT4 systems. To be able touse GatherHW on NT4 systems, you’ll need to have Service Pack 6ainstalled. You will also have to download and install WMI (wmint4.EXE)from the following URL: www.microsoft.com/downloads/details.aspx?dis-playlang=en&FamilyID=C174CFB1-EF67-471D-9277-4C2B1014A31E

Run GatherHW.exe on the source server and get the XML file that con-tains all the information needed for the migration.You can run this file froma floppy disk, USB disk, or network share (see Figure 8.9).

Figure 8.9 Example XML File

298 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 298

Page 324: Virtualization With Microsoft Virtual Server 2005 (2006)

Creating the ScriptsNow that you have gathered all the information about the source system, youcan create the migration scripts.You need these scripts to create the virtualhardware in your virtual server environment and to capture and deploy theserver.

You create the scripts in two steps. In the first step, you validate the hard-ware of the source system and in the second step you create the scripts tomigrate.

Validating HardwareValidation is required to check if the source server hardware and operatingsystem configurations are compatible with Virtual server and VSMT. Forexample, software RAID1 is not supported.You validate the configurationinformation by running VMScript. VMScript analyzes the configurationinformation and reports any issues that could prevent a successful migration. Ifissues are reported, you need to correct them, if possible, and start the processagain by gathering and validating the configuration information to verify thatno issues remain.

To start with this step, copy the XML file to the VSMT directory of theADS server and run the following command from within a command promptin the VSMT directory.VMScript.exe /HWValidate /HWInfoFile:<servername>.xml

Where <servername> should be replaced with the name of your XML file.If everything is okay, you will see the results that are shown in Figure

8.10.If the output indicates that a required system (“patch”) file is missing, you

can use the VMPatch tool to load the required file(s) before taking the nextmigration step.

Migrating Physical Machines • Chapter 8 299

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 299

Page 325: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 8.10 Hardware Validation Output

VMPatch requires only one switch: /s:<path>. Enter the path of thefolder that contains the files that are mentioned in the hwvalidate output.

If you try to migrate a server that is installed with a service pack that wasreleased after VSMT was released, you will see the output that is shown inFigure 8.11.

Figure 8.11 Hardware Validation Error

To resolve this issue, use Windows Explorer to navigate to the directorythat is mentioned in the warning. If it doesn’t exist, create it. Copy the filesthat are needed (use the files in \Patches\Source\OS_NUMBER as a refer-ence) from the source server, the installation CD, or an extraction of the ser-vice pack file to the new directory.

The reason gatherhw generates this error is because during the imagedeployment, VSMT swaps system files for other system files of the same ver-sion that support a different type of hardware.This is because the hardwareconfiguration that virtual machines emulate may not be the same as the hard-ware configuration of the source computer, and some system files depend on

300 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 300

Page 326: Virtualization With Microsoft Virtual Server 2005 (2006)

hardware configuration. For example, the physical machine is multi-processorand Virtual Server emulates only single-processor machines. In this case, thekernel files have to be replaced by VSMT, so VSMT must have the correctversion of the files.

After you copy the necessary files, run hwvalidate again to check if thewarning is resolved.

Creating Migration ScriptsTime to create the scripts.The scripts are created by using the same vmscripttool but with another parameter.You now use the /hwGenerateP2V parameter.

HwgenerateP2V requires at least the following switches:

■ /hwInfoFile:”<server>.xml” States the xml file that is to be used

■ /name:<VM name> The name that the server will use within thevirtual environment

■ /vmConfigPath:”<vmc Path>” The path where the vmc filewill be stored on the virtual server

■ /virtualDiskPath:”<vhd Path>” The path where the vhd filewill be stored on the virtual server

■ /hwDestVS:<VS name> The name of the virtual server that willhost the virtual machine

The command shown in Figure 8.12 will generate scripts to migrate aserver called Poseidon to the virtual server host Hercules.You see that thecommand creates a subfolder with the server name in the p2v directory ofthe VSMT program directory and that the filename of all the scripts that arecreated start with the servername.

The following switches are optional:

Migrating Physical Machines • Chapter 8 301

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 301

Page 327: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 8.12 Migration Script Generation

■ /hwTaskSeqPath:”path” The path of the folder in which to storethe generated scripts.The default path is%SYSTEMDRIVE%\Program Files\Microsoft VSMT\P2V.

■ /hwPatchDir:”path” The path to patch files that are not in thedefault patch folder.

■ /vsHostNet:virtual network The name of the virtual network towhich to attach the machine.The default network is VM0. If youwant to change the default setting, you can edit theVsmt_initenv.cmd file.

■ /virtualDiskDynamic Creates all virtual hard disks as dynamicallyexpanding disks. If this is not specified, all are created as fixed-sizevirtual disks.

■ /adminMac:MAC address If the source device has multiple MACaddresses, the MAC address that is used for PXE booting the device.

■ /virtualMacDynamic Specifies that Virtual Server will dynami-cally assign a MAC address to the network adapter on the virtualmachine.

302 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 302

Page 328: Virtualization With Microsoft Virtual Server 2005 (2006)

■ /fixHAL:<options> Auto|None|ACPI|NACPI Specifies the typeof HAL to use for the destination virtual machine.

■ /vmMemory:memory in MB The amount of physical memory tobe allocated for the virtual machine. If not specified, the allocatedmemory equals the amount of memory in the source computer.

■ /serviceDriverState:”file path” The path to the XML file thatspecifies services and drivers that are to be stopped during the migra-tion.

■ /suppressVsConsole Suppresses the invocation of the VirtualServer Administration Web site. By default, the Administration Website automatically displays following virtual machine creation.

■ /excludeDrives:logical drive 1 The logical drive letters toexclude from image capture (for example G:;H:;I:).A drive letter ismapped to a volume. If it is excluded, then the volume is excludedfrom capture. If all partitions of a hard drive are excluded, then thehard drive is not created.

■ /postDeployAction:0|1|2 The action to perform on the virtualmachine after deployment is finished. 0 (default) leaves the VM in theADS Deployment Agent, 1 shuts down the VM, and 2 restarts theVM.

■ /forceGenerate Forces VMScript to generate scripts and tasksequences, even if the validation phase produced errors. If errors werereported, the generated scripts probably will not work.

WARNING

A minimum of 96 MB of memory must be allocated to a virtual machineor it will not boot to the ADS Deployment Agent and the migration willfail.

Migrating Physical Machines • Chapter 8 303

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 303

Page 329: Virtualization With Microsoft Virtual Server 2005 (2006)

After the task is completed, the following scripts can be found in thedirectory c:\program files\microsoft VSMT\:p2v\<servername>\ (see Figure 8.13):

Figure 8.13 Migration Scripts

■ <SERVERNAME>_commonInit.cmd This file is a script thatcontains the configuration settings for the virtual machine that youspecified when you ran VMScript to generate the scripts. Within thisscript you can change settings like the Mac address that will be usedduring capture, the name of the virtual machine, etc.

■ <SERVERNAME>_capture.cmd This script file captures thedisks on the source computer and stores them in ADS image files onthe computer running ADS.

■ <SERVERNAME>_CreateVM.cmd This script file creates a vir-tual machine to host the captured disk images.This script calls theCommoninit to set common environment variables. It then creates aseries of ADS jobs to create the virtual machine.

■ <SERVERNAME>_DeployVM.cmd The deploy script deploysthe image files to the created virtual machine.

■ <SERVERNAME>_PostDeploy.cmd This script performs actionson the new virtual machine upon the first logon following migration:The script resets attributes of boot.ini file to System, Hidden, and

304 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 304

Page 330: Virtualization With Microsoft Virtual Server 2005 (2006)

Read-only.And on computers running Windows NT 4.0 ServerSP6a, it runs fixsetup.cmd to update the Setup.log file in thewinnt\repair directory to reflect that the operating system is runningon a single-processor computer. Service packs and hotfixes use theinformation in the Setup.log file to install the appropriate components.

■ <SERVERNAME>_CleanupVM.cmd Use this script to clean upthe files associated with a failed migration, so that you can reattemptthe migration.This script deletes a virtual machine, its resource files,and the ADS devices records associated with it.

■ <SERVERNAME>_internalState.xml This XML file containsinformation about the hardware, file system, and startup.

■ <SERVERNAME>_P2V_readme.txt In this file you find thetasks that have to be manually done after the deployment.

■ <SERVERNAME>_boot.ini This is the boot.ini file of the sourcemachine.

■ <SERVERNAME>_captureDisk.xml This is an ADS tasksequence, which is initiated by Capturedisk.cmd, which captures thedisk partitions on the physical computer.

■ <SERVERNAME>_DeployVM.xml This task sequence deploysthe captured disk partitions to the virtual machine and is initiated bythe DeployVM.cmd script.

■ <SERVERNAME>_ServiceDriver.xml This task sequence is ini-tiated by DeployVM.cmd and configures the start state of specified ser-vices and devices for a virtual machine. VMScript uses theP2Vdrivers.xml as input to generate this file.You can use the/serviceDriverState parameter of VMScript to change the file that isused as input.

Data CaptureThe next step is the capturing of the disks of the physical server. For this stepit is necessary to PXE boot the machine. If the machine does not supportPXE boot, you must have a compatible NIC to be used by a Remote

Migrating Physical Machines • Chapter 8 305

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 305

Page 331: Virtualization With Microsoft Virtual Server 2005 (2006)

Installation Services (RIS) boot floppy disk. If your NIC does not supportany of these methods, you need to install another NIC and start over.

NOTE

ADS does not encrypt the traffic, because of performance reasons. If youdo need to encrypt the traffic between the ADS server and the physicalsource computer or the virtual target computer, then delete the none-tencrypt option from the capturedisk.xml and/or the deployVM.xml.

On the ADS server, run the script <SERVERNAME>_capture.cmd.Thisscript creates a device and the jobs in ADS and will keep running until thecapture process completes (see Figure 8.14).

Figure 8.14 capture.cmd Output

Inside the ADS management console you should now see the physicalserver as a new device (see Figure 8.15).The identifier of the device is theMAC address of the first network card or the MAC address given with the/adminmac parameter during script creation.

306 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 306

Page 332: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 8.15 ADS Device

Configuring & Implementing…

MAC Address AdjustmentIf your physical server contains more than one network card, make sureyou have the network card connected that is used as the device identifier.In the commoninit.cmd file you can check which MAC address will beused (DEVICE_SOURCE_MAC). If it isn’t the correct address, you canregenerate the scripts with the parameter /adminmac or edit theDEVICE_SOURCE_MAC value in the commoninit file.

In the ADS management console you can also see the job that is created.See Figure 8.16.

Figure 8.16 ADS Capture Image Job

Migrating Physical Machines • Chapter 8 307

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 307

Page 333: Virtualization With Microsoft Virtual Server 2005 (2006)

Reboot the physical server and make it boot to PXE.The server gets anIP address from your DHCP server and then obtains a boot image from theADS server.This boot image is called the Deployment Agent.This agent exe-cutes all the tasks that are configured in the job on the ADS server. Figure8.17 shows the deployment agent while it is running the capture task.

Figure 8.17 Deployment Agent Capture Process

When you double-click the job under running jobs in the ADS manage-ment console, you can see the tasks that are completed and the tasks that stillhave to be executed.You can also see the exact status of each task (see Figure8.18).

For each directly attached logical disk, an image is captured.Approximately 1 GB of data is captured per minute, depending on your hard-ware and network settings.

When the capture is completed, the physical server will be shut down, theADS device object will be released, and this object will be deleted.

Check the job for any errors.You can find the job in the ADS manage-ment console under history. If all tasks have run without errors, you will seeno text under the error tab and all tasks will be green, like in Figure 8.19.

308 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 308

Page 334: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 8.18 Capture Job Details

Figure 8.19 Capture Job Results

The image file(s) can be found under images like the one shown in Figure 8.20.

Migrating Physical Machines • Chapter 8 309

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 309

Page 335: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 8.20 Captured Image File

You are now ready to create the virtual machine.

Creating the Virtual Machine on the Virtual Server HostNow that you have an image and all the information about the system, it istime to create the virtual machine. Use the script called CreateVM.cmd.Thecaptured image(s) will later be deployed to this virtual machine.

The next steps are illustrated in Figure 8.21.

Figure 8.21 Deploy Process

310 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 310

Page 336: Virtualization With Microsoft Virtual Server 2005 (2006)

Before you can start with the creation of the virtual machine, add the vir-tual server host to the devices in the ADS management console so that thescript can execute the necessary tasks on the host server.To do this, go intothe console, right-click Devices and select Add device. Enter the name ofyour virtual server host and enter the MAC address of the network card (seeFigure 8.22).

Figure 8.22 Adding Devices

After the device is created, right-click the device and select TakeControl.

Now run the CreateVM.cmd script from the folder containing the generated scripts.

Unless you specify different settings, the virtual machine is created withthe same amount of RAM, same number of network adapters (up to four),with the same MAC addresses, and the same disk sizes as the source com-puter. For more information about customizing settings, see the list ofoptional switches in the Creating Migration Scripts section earlier in thischapter.The new virtual machine is allocated 100 percent of a single CPU,minus any percentage that the host operating system is using and any per-centage that has been allocated to other virtual machines.

It may take several minutes to create the virtual hard disk(s).

Migrating Physical Machines • Chapter 8 311

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 311

Page 337: Virtualization With Microsoft Virtual Server 2005 (2006)

The script displays the actions being performed on Virtual Server.You canmonitor the creation of the new virtual machine and assignment of propertiesfrom the Event Viewer page of the Virtual Server Administration Web site aswell as from the ADS Management snap-in.

NOTE

By default, the script creates a virtual machine that is equal to the phys-ical machine. Make sure there is enough available memory and diskspace or the creation of the virtual machine will fail. If you do not haveenough memory or disk space, re-create the scripts and add the switches/virtualdiskDynamic or /vmMemory to the generating command.

When the script completes, the new virtual server is ready for deploymentof the disks.The new virtual machine will be attached to the VM0 networkand will have the Ris2003.vfd floppy image attached to the floppy disk drive,as shown in Figure 8.23.

Figure 8.23 Virtual Machine Properties

312 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 312

Page 338: Virtualization With Microsoft Virtual Server 2005 (2006)

In the ADS Management snap-in, a new ADS device object for the virtualmachine is also created to perform the image deployment and post-imagingfix-ups or tasks (see Figure 8.24).

Figure 8.24 ADS Device Object

Deploying the Virtual Machine on the Host OSYou’re almost there.The next step, and almost last step, is the deployment ofthe disks. For this step, the newly created virtual machine is booted into thedeployment agent by using PXE. So make sure the machine is connected to anetwork on which the machine can contact the DHCP and the ADS server.

From the folder containing the generated scripts, run the DeployVM.cmdscript.

The virtual machine that you created turns on.You can view this in theVirtual Server Administration Web site. Because the RIS2003 floppy disk isattached to the virtual floppy disk drive, the virtual machine receives an IPaddress and PXE boots into the ADS Deployment Agent. Figure 8.25 showsthe Deployment Agent when deployment is running.

Migrating Physical Machines • Chapter 8 313

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 313

Page 339: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 8.25 Deployment Agent Deploy Image

NOTE

If loading of the RamDisk (Deployment Agent) fails, the virtual machinewill reboot and try again.

Within the deployment agent, the deployment of the disks is startedsequentially. Deployment of the image takes longer than capturing. It alsotakes more time to deploy an image to a dynamically expanding disk than toa fixed size virtual disk.

After the deployment, some actions are taken, including swapping systemfiles and changing configuration settings (removing the virtual floppy disk andassociating the virtual hard disks with the virtual machine). When all is com-pleted, the script exits.

The deployed virtual machine is left in the Deployment Agent screen.Tochange this behavior, add the switch /postDeployAction to the command togenerate the scripts.

Now that the deployment is completed, there are a few steps left.First, verify that there are no errors in the virtual server event log.Then

let the virtual server reboot: this can be done by sending a reboot commandfrom the ADS console.

Select Run job in the ADS console (see Figure 8.26) and select theReboot Template.

314 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 314

Page 340: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 8.26 Add Job to Reboot the Device

After the virtual machine reboots, release control of it in the ADS man-agement console.To do this, use the Release Control command (visible inFigure 8.26).

When the virtual server is booting, Windows will install drivers andchange the necessary configuration settings.

NOTE

The virtual server will not have an IP address configured anymore. If youwant the virtual server to boot with the IP address it had when it wasstill a physical machine, make a reservation in the dhcp scope (you canview the MAC address of the virtual machine under Edit configuration -network cards).

You can follow the progress by viewing the machine within the virtualserver management Web site. Finally, when everything is done, the machinewill stop at the Windows login.

A few manual tasks have to be done on the virtual machine:

■ Log on to the machine with an administrative account that is amember of the local administrators group.

■ Run the Virtual Machine Additions setup.You can start this setup byclicking on the link in the Virtual Server remote control Web site.

■ Configure the network card and TCP/IP properties.

■ Verify that the machine runs correctly and at last remove the imagefiles from the ADS server.

Migrating Physical Machines • Chapter 8 315

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 315

Page 341: Virtualization With Microsoft Virtual Server 2005 (2006)

SummaryMigrating physical servers to a virtual environment is easy to do by followingthe steps outlined in this chapter.You start with building the environment youneed for the virtualization process.This environment consists of an ADSserver, your virtual server, and a DHCP server.You then gather the hardwareinformation of the server by running a tool on the physical server.You vali-date the hardware and generate the migration scripts—these scripts automatethe virtualization process.The next step is getting the data to images.You dothis by running one of the generated scripts.You then create the target virtualmachine by running another one of the generated scripts and finally youdeploy the image files to the created virtual machine by running another generated script.

Solutions Fast Track

Getting the Virtualization Environment Ready for Usage � The ADS server does not have to be a physical server.

� DHCP addressing must be available to the device systems.The systemhosting the DHCP service can be an existing DHCP server, but it canalso be installed on the computer hosting the ADS Controller.

� If there are existing PXE services in your environment, such asRemote Installation Services (RIS), you need to isolate them from theADS implementation.

Capturing the Physical Machine� The virtualization process is disk intensive. Make sure you use fast disks.

� The time the capture process needs is about one-half to one and a halfminutes per gigabyte.

316 Chapter 8 • Migrating Physical Machines

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 316

Page 342: Virtualization With Microsoft Virtual Server 2005 (2006)

� By default, the capture and deploy processes don’t use encryption forperformance reasons. If you want to encrypt the traffic, delete thenonetencrypt parameter from the capturedisk.xml and the deployvm.xml.

Creating the Virtual Machine on the Virtual Server Host� The virtual machine that is created will be configured with the same

amount of disk space and memory as the physical server had. Makesure you have enough resources available

� The creation of fixed size disks takes a lot longer than the creation ofdynamically expanding disks

� The created Virtual Machine will be connected to the VM0 virtualnetwork by default.You can change this behavior by adding the/vsHostNet parameter when generating the migration scripts with thevmscript /HWgenerateP2V command.

Deploying the Virtual Machine on the Host OS� To improve performance, don’t put the images and the virtual hard

disks of the target on the same physical disk or in folders withcompression turned on.

� Delete or archive the job history in ADS to improve the performanceof VSMT.

� On a network with a high level of traffic, the deployment of theimage may fail because the virtual machine cannot connect to ADSafter booting into the Deployment Agent.There is an ADS hotfix, KB875533, to fix this.

Migrating Physical Machines • Chapter 8 317

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 317

Page 343: Virtualization With Microsoft Virtual Server 2005 (2006)

Q: Does VSMT support migrating virtual machines to physical machines?

A: No, this is not possible with this tool.

Q: Which operating systems can be migrated with VSMT?

A: Windows NT4 with Service Pack 6a, Windows 2000 SP4, and WindowsServer 2003 systems can be migrated with this tool.

Q: What should I do if the migration fails?

A: Turn the physical machine back on. Nothing is changed on the physicalserver during the migration process.

Q: Is it possible to migrate from one virtual machine to another virtualmachine?

A: Yes, VSMT and ADS interact with virtual machines the same way as withphysical machines.

Q: Where can I find error messages if one of the steps fails?

A: Error messages can be found either in the ADS job history or in the vir-tual server log.

Q: Does VSMT require the Enterprise Edition of Virtual Server?

A: No, VSMT works with both the Enterprise and the Standard Editions.

318 Chapter 8 • Migrating Physical Machines

Frequently Asked Questions

The following Frequently Asked Questions, answered by the authors of this book,are designed to both measure your understanding of the concepts presented in this chapter and to assist you with real-life implementation of these concepts. Tohave your questions about this chapter answered by the author, browse towww.syngress.com/solutions and click on the “Ask the Author” form.

406_VIRTUAL_08.qxd 9/8/06 6:47 PM Page 318

Page 344: Virtualization With Microsoft Virtual Server 2005 (2006)

Troubleshooting

Solutions in this chapter:

■ Troubleshooting Virtual Server 2005 R2

■ Troubleshooting Automated DeploymentServices

■ Troubleshooting the Virtual ServerMigration Toolkit

■ Troubleshooting the Migration Process

Chapter 9

319

� Summary

� Solutions Fast Track

� Frequently Asked Questions

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 319

Page 345: Virtualization With Microsoft Virtual Server 2005 (2006)

IntroductionMachine setup…OK; Server compatibility…OK;ADS running…OK; every-thing is running, but still problems come up.That’s why we wrote thischapter, to provide you with the information to troubleshoot problems, orga-nized by technique. Enjoy and solve the problems.

Troubleshooting Virtual Server 2005 R2In this section, we go over troubleshooting for the Virtual Server 2005 R2itself. While this is not an exhaustive list of problems you may encounter,these tips and tricks should be helpful when dealing with problems in the following areas:

■ Virtual Server Administration Web Site

■ Virtual Server Settings

■ Virtual Machine Performance Issues

Troubleshooting Virtual Server Administration Web SiteThe bulk of the administrative functions and troubleshooting you will per-form in Microsoft Virtual Server 2005 R2 will be done through the VirtualServer Administration Web site.This section will go over what to do whenthe Administration Web site is the problem.

Troubleshooting LsaLogonUser() failed!You’ve got your shiny new Virtual Server loaded and all ready to go and youlaunch the Administration Web site only to be confronted with the dreadedLsaLogonUser() failed! error (see Figure 9.1).

320 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 320

Page 346: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 9.1 LsaLogonUser() failed! Error

You likely won’t see this error unless you’ve set up your virtual server as amember of a workgroup, rather than as a member of a domain.This errorcomes from the default settings of the Virtual Server Administration Web siteto use Integrated Windows Authentication.

Designing & Planning…

Domains. To Join or Not to Join?One of the most important decisions you will make when deploying yourvirtual server is whether or not to join the server to a domain. An evenmore common question is whether to run your virtual server on a domaincontroller. Table 9.1 lists some of the pros and cons of each scenario.

Table 9.1 Virtual Server Deployment Scenarios

Type of Deployment Pro Con

Virtual Server as a stand- This is the easiest The key drawback to a workalone workgroup server way to go, since group server is that you won’t

you don’t have to have the ability to use Active worry about too Directory for user security or many “what ifs” group policy. Each user of the or “gotchas.” virtual server will have to have a

separate user account createdand maintained on the virtualserver host. If this is not aproblem, we recommend thisroute.

Troubleshooting • Chapter 9 321

Continued

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 321

Page 347: Virtualization With Microsoft Virtual Server 2005 (2006)

Table 9.1 continued Virtual Server Deployment Scenarios

Type of Deployment Pro Con

Virtual Server as a This option is a There are a couple of reasons to domain member server good middle be wary, however, of putting

ground. If you guest machines that are domain need to be able controllers on this server:to administrate (1.) Server Message Block (SMB) users and group signing is a critical part of policy from domain communications in within the Active Windows Server 2003, and if you Directory, then have a virtual domain controller this is the best as a guest on a domain member, way to go. it won’t take long before other

domain controllers will confusecommunications from the hostwith communications from theguest domain controller. Whenthis happens, Active Directoryreplication and authenticationcan go haywire rapidly. If youintend to load a guest domaincontroller on a domain member,consider disabling SMB signingon the Virtual Server host. Formore information on SMBsigning, refer to Microsoft’sKnowledge Base Article ID887429 at http://support.microsoft.com/kb/887429/en-us.(2.) Another reason to be carefulof guest domain controllers isthe issue of time synchroniza-tion. When you load the VirtualMachine Additions, there is anoption to synchronize the guestmachine’s time with the host.This can be very dicey, when youconsider that the host machinecould very well be getting itstime from the guest domain

322 Chapter 9 • Troubleshooting

Continued

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 322

Page 348: Virtualization With Microsoft Virtual Server 2005 (2006)

Table 9.1 continued Virtual Server Deployment Scenarios

Type of Deployment Pro Con

controller. Make sure that timesynchronization is turned off inany guest domain controller. Formore information on time syn-chronization, refer to Microsoft’sKnowledge Base Article ID888746 at http://support.microsoft.com/kb/888746/en-us.

Virtual Server on a None. This option is by far the least domain controller attractive and you should avoid

it at all costs. SMB signing prob-lems get worse now, since youcan’t turn off SMB signing onjust one domain controller andhave any hope of ActiveDirectory replication going onnormally. And having one ofyour guest machines mistaken asthe host domain controller whenit talks to another domain con-troller on the network is a veryreal possibility.And if you already have VirtualServer loaded on a system, thenupgrade it to a domain con-troller, expect that every serviceand setting will break and youwill need to just reload VirtualServer.We strongly caution againstloading Virtual Server on adomain controller.

Fixing the LsaLogonUser() failed! error can be tackled in a couple ofways. First, you could go ahead and join the Virtual Server to your domain.This comes with the benefits discussed above, such as centralized administra-tion and pass-through authentication for the Administration Web site, but it

Troubleshooting • Chapter 9 323

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 323

Page 349: Virtualization With Microsoft Virtual Server 2005 (2006)

also comes with the drawbacks. If you feel comfortable putting your VirtualServer into your domain then, by all means, go right ahead. If you prefer tokeep your Virtual Server as a stand-alone host in a workgroup, then followthe procedures below.

First, open the Internet Information Services (IIS) Manager byclicking Start | Control Panel | Administrative Tools | InternetInformation Services (IIS) Manager. Next, browse to the Virtual ServerWeb site, right-click it, and select Properties, as shown in Figure 9.2.

Figure 9.2 Virtual Server Web Site Administration

Next, select the Directory Security tab and click the Edit button, asshown in Figure 9.3.

Figure 9.3 Virtual Server Administration Web Site Directory Security

324 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 324

Page 350: Virtualization With Microsoft Virtual Server 2005 (2006)

Now, uncheck the Integrated Windows authentication check box (seeFigure 9.4).

Figure 9.4 Virtual Server Administration Web Site Authentication

Next, check the Basic authentication (password is sent in cleartext) box, as shown in Figure 9.5. Click Yes to the warning message for basicauthentication (Figure 9.6).

Figure 9.5 Changing Virtual Server Administration Web Site Authenticationto Basic

Troubleshooting • Chapter 9 325

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 325

Page 351: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 9.6 Virtual Server Administration Web Site Basic AuthenticationWarning

NOTE

If you are concerned about clear text authentication, you can install adigital certificate on the Virtual Server Web site and permit only SSL con-nections.

The only thing left to do is to restart the Web server.To do this, click Start| Run and type iisreset as the command to run, as shown in Figure 9.7.

Figure 9.7 Issue the IISRESET Command

After IIS has finished restarting, go to the Virtual Server AdministrationWeb site and witness your victory: a logon box asking for a username andpassword (from the local server, of course).

326 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 326

Page 352: Virtualization With Microsoft Virtual Server 2005 (2006)

Troubleshooting Internal Server Error 500Another common error with the Virtual Server Administration Web site isthe HTTP 500 – Internal server error, shown in Figure 9.8.This error tendsto show up after you attempt to configure constrained delegation, whichsounds like a good idea at first, but is not compatible with a workgroup serverapproach if you installed your Virtual Server as a stand-alone server and choseConstrained Delegation (see Figure 9.9).

Figure 9.8 Administration Web Site HTTP 500 - Internal Server Error

Figure 9.9 Virtual Server Web Site Configuration for Constrained Delegation

Troubleshooting • Chapter 9 327

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 327

Page 353: Virtualization With Microsoft Virtual Server 2005 (2006)

The reason for the HTTP 500 – Internal server error is really quitesimple, but is not terribly obvious. In order to use constrained delegation, theproduct installation needs to register service principal names (SPNs) insideActive Directory, and thus the security delegation fails. In a workgroup mode(or Windows NT 4 domain, for that matter) configuration, there is no ActiveDirectory to register the SPNs with.

As before, there are a couple ways to tackle this error. First, you can join thevirtual server to a Windows domain with Active Directory available, or you candisable constrained delegation.Although there is a procedure to generate theSPNs after the installation (See the “Note” below), it is not necessarily the bestway to go about it. Since you probably have not installed any virtual machinesyet, the better course is to join the virtual server to the domain and then unin-stall and re-install Microsoft Virtual Server. It won’t take that long and you’ll besure to have created the right SPNs in the right place.

Your other option is to disable constrained delegation, but you’ll need touninstall and re-install Microsoft Virtual Server to this as well. Just make surethat when you are doing the installation, you select Configure theAdministration Website to always run as the authenticated user(Recommended for most users), as shown in Figure 9.10.

Figure 9.10 Virtual Server Configuration for Standard Authentication

328 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 328

Page 354: Virtualization With Microsoft Virtual Server 2005 (2006)

NOTE

In some cases, the SPNs will not be registered correctly even if you dojoin the Virtual Server to the domain before installation. This happensbecause the Network Service account of the virtual server fails to gen-erate the appropriate SPNs because of a permissions issue.

For more information on what to do when this happens, or if youwant to manually register the SPNs, refer to Microsoft’s Knowledge BaseArticle ID 890893 at http://support.microsoft.com/kb/890893/en-us.

Troubleshooting Access Denied ErrorsYour virtual server has been running fine for a while now, but suddenlywhenever you go to the Administration Web site, you are presented with“Could not connect to Virtual Server. Access was denied.” Did you justinstall Windows Server 2003 Service Pack 1? Or maybe Windows XPService Pack 2?

Yes, that’s probably what’s done you in.The security changes in these ser-vice packs break DCOM permissions for the Virtual Server AdministrationWeb site.There are two ways to fix this. First, change them manually, fol-lowing the steps laid out in Microsoft’s Knowledge Base Article ID 891609 athttp://support.microsoft.com/kb/891609/en-us.

Alternatively, you can just uninstall and re-install Virtual Server 2005 andlet the setup program do all the work for you.

Troubleshooting VMRC Server Disabled ErrorsBy default, the Virtual Machine Remote Console (VMRC) is turned off. Ifyou try to remotely control a server though the Virtual Server AdministrationWeb site before enabling VMRC, you will be sent to the settings page so thatyou can enable it (see Figure 9.11).To enable the VMRC, simply clickEnable, verify the other settings, and click OK.

Troubleshooting • Chapter 9 329

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 329

Page 355: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 9.11 Virtual Machine Remote Control (VMRC) Server Properties

Another reason that VMRC may fail is if you are running VNC on yourVirtual Server. Both VNC and VMRC run over Port 5900 by default, so inorder to resolve the conflict, you can either uninstall VNC from the virtualserver or change the ports used by VNC or VMRC.

To change the port used by VMRC, open the Server Properties screen byclicking Virtual Server | Server Properties in the Virtual ServerAdministration Web site. Next, click Virtual Machine Remote Control(VMRC) Server, as shown in Figure 9.12.

Figure 9.12 Configuring VMRC in Server Properties

Next, enter a new port number not in use by another network service inthe field, as shown in Figure 9.13, and then click OK.

Figure 9.13 Changing the VMRC Server Port

330 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 330

Page 356: Virtualization With Microsoft Virtual Server 2005 (2006)

NOTE

To make sure that you don’t pick a port that might be used by some-thing else, you can find a listing of well-known ports atwww.iana.org/assignments/port-numbers.

Troubleshooting Virtual Server SettingsThere are a myriad of individual settings in Microsoft Virtual Server 2005R2, and maintaining them can be a fulltime chore. It’s even harder to main-tain them when the virtual server is fighting against you every time you makea change.This section will show you how to deal with the Virtual Serverwhen you make changes and they don’t seem to go as planned.

Troubleshooting Disappearing Server SettingsAfter you have Virtual Server 2005 R2 installed, you will invariably wish tochange some of the settings to meet your needs. However, you may find yoursettings have disappeared on you after a reboot or a system crash. While this isannoying at best, disastrous at worst, it is explainable.

During a normal shutdown of Virtual Server, it attempts to save the cur-rent running state of the guest machines. If Virtual Server was not able tofinish saving the state of the guest machines during a system shutdown, thenit is possible for it to not save any of its settings, thus all your settings are lost.To avoid this problem, always, always, always allow your Virtual Server tofinish an orderly shutdown.

If the problem persists, even though you’re allowing the server to shutdown gracefully, one of your guest machines could be causing the problem.Aguest machine hanging at shutdown could keep Virtual Server from com-pleting the save of its running state, thus keeping the service from saving yourother settings. If this is the case, you will need to use good old process ofelimination to find the culprit. Manually shut down one of the guestmachines and then reboot the server. Move on to the next guest machineuntil you are able to get a clean reboot where your changes are saved, atwhich point you know which guest is the problem and you can go aboutfixing that one virtual machine.

Troubleshooting • Chapter 9 331

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 331

Page 357: Virtualization With Microsoft Virtual Server 2005 (2006)

Troubleshooting Virtual Network ChangesAnother thing you may want to change after you have Virtual Server installedand ready to go is your network adapter. Whether you need to add new ones,or just want to update the driver for the Network Interface Card (NIC) thatyou have already, it is a pretty common thing to change on a network server,so you would think Virtual Server would be able to take it in stride, right?Not so much.

The key thing to remember about your virtual network settings is thatthey are not dynamically generated, so whenever you make a change to yournetwork cards, you need to make a corresponding change in the networkbindings for your virtual networks.Also, bear in mind that this is not just forwhen you physically add or remove a network card. Oftentimes, if youupgrade the driver for a NIC from the Microsoft-provided driver to one pro-vided by the manufacturer, the adapter name may change, forcing you toupdate the virtual network setting.

To update your settings, open the Virtual Server Administration Web site,and then select the Virtual Network you want to update by clicking it underVirtual Networks | Configure, as shown in Figure 9.14.

Figure 9.14 Configuring Virtual Networks

In the configuration screen for the virtual network, you may be presentedwith an error as shown in Figure 9.15.This is a sure sign that something hasgone awry with your virtual network and it’s time to reconfigure it.Also, takenote of the .vnc file name; if you can’t make changes to the configuration,you may need to remove the virtual network altogether, including deletingthe file from the system. We’ll talk about that in a minute, but for now let’sassume you can get away with a simple reconfiguration and go from there.

332 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 332

Page 358: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 9.15 Virtual Network Properties

Next, click on Network Settings, as shown in Figure 9.16, to modifythe virtual network’s bindings to the server’s physical network connections.

Figure 9.16 Changing Virtual Network Settings

If the Network Settings screen will come up, you will be shown some-thing similar to Figure 9.17. Select the appropriate physical adapter from thedrop-down list, and then click OK.

Figure 9.17 Selecting the Appropriate Network Adapter

Troubleshooting • Chapter 9 333

406_VIRTUAL_09.qxd 9/8/06 6:53 PM Page 333

Page 359: Virtualization With Microsoft Virtual Server 2005 (2006)

NOTE

What to do when your brand new network adapter doesn’t show up inthe list? Make sure that the Virtual Machine Networking Service is boundto the adapter.

You can check this by going to Start | Control Panel | NetworkConnections and then right-clicking the adapter you just added andselecting Properties. Make sure the Virtual Machine NetworkingService is checked and click OK.

Without this service enabled, the virtual server cannot make use ofthe adapter.

If the virtual network binding cooperated, then you are done; read nomore. If you were unable to open the Network Settings screen, however, it’stime for a procedure that’s a little bit more involved. From the Virtual ServerAdministration Web site, open the list of virtual networks by clicking VirtualNetworks | Configure | View All, as shown in Figure 9.18.

Figure 9.18 Viewing All Virtual Networks

Next, you will be treated to a listing of all of the virtual networks on yourvirtual server. Click on the virtual network that you want to remove and thenselect Remove, as shown in Figure 9.19.

Figure 9.19 Removing a Virtual Network

334 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 334

Page 360: Virtualization With Microsoft Virtual Server 2005 (2006)

You’re not quite done yet. Remember that .vnc filename back in Figure9.1? Now it’s time to go and manually delete that file from the virtual server.Removing it from the Virtual Server Administration Web site does notremove it from the server. Open Windows Explorer and browse to the file. Bydefault these files are stored on the system drive, under Documents andSettings | All Users | Shared Documents | Shared VirtualNetworks. Locate the file with the same name as the errant virtual networkand remove it, as shown in Figure 9.20.

Figure 9.20 Deleting the Virtual Network Settings File

Now, all that’s left to do is to create a new virtual network using the cor-rect physical adapter.

NOTE

After you modify the virtual networks, you may need to go back and re-configure the guest machines to use the correct one. To be safe, double-check every virtual machine on the server to ensure that they areconnected to the appropriate virtual network, even if you name the newvirtual network with the same name. Better safe than sorry.

Troubleshooting • Chapter 9 335

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 335

Page 361: Virtualization With Microsoft Virtual Server 2005 (2006)

Troubleshooting Virtual Machine Performance IssuesPerformance of your virtual machines is an important thing, especially if youplan to use Microsoft Virtual Server 2005 R2 for more than a test lab. Wecould write an entire book on optimizing guest machines, but we just didn’thave the space! So, here are the quick and dirty ways to optimize your guestmachines’ performance.

Disabling TCP Segmentation OffloadMost newer server-based network adapters have an option for TCPSegmentation Offload (TSO), which is designed to make the NIC do someof the work of breaking up larger network packets into smaller ones in orderto free up CPU cycles.This can also be called large packet offload or TCPoffload engine (TOE), depending on the server vendor. In a normal com-puting environment, this may be a beneficial technology, but in a MicrosoftVirtual Server environment, it can bring the network performance of all ofyour guest machines to a grinding halt.

The reason for this is that the network chipset that Virtual Server emu-lates to the guest machines does not support TSO, forcing the Virtual Serverhost machine to do the segmentation before the packets get to the NIC. Soinstead of offloading the packet segmentation to the NIC, you’re actuallythrowing it back on to the Virtual Server host’s CPU.Then, after that is done,the NIC still wants to try to do the TSO as well!

In general, any task offloading will cause the same headache, so turn offany offloading features your NIC may support, including the following:

■ TCP Segmentation Offload

■ IP Receive Checksum Offload

■ IP Transmit Checksum Offload

■ TCP Receive Checksum Offload

■ TCP Transmit Checksum Offload

336 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 336

Page 362: Virtualization With Microsoft Virtual Server 2005 (2006)

NOTE

With TSO enabled on your NICs, you’re forcing the Virtual Server host todo the segmentation inside the Virtual Server Network Driver InterfaceSpecification (NDIS) driver.

Although NDIS is not bad from a universal compatibility perspective,it is not renowned for being fast, given that it was a new idea backaround Windows for Workgroups 3.11. Avoid making the NDIS driver doany more work than it has to by disabling offloading.

For more information about TSO and Virtual Server, see Microsoft’sKnowledge Base Article ID 888750 athttp://support.microsoft.com/kb/888750/en-us.

Don’t Use Network Adapter Auto-ConfigurationWhile it may be nice when you are initially setting up your Virtual Server,network adapter auto-configuration can come back to bite you later.Manually set the speed and duplex for your network adapters. Nothing cancause poor network performance more often then mismatched speed andduplex settings.

Use ISOs instead of CDs Whenever PossibleUsing a physical CD-ROM to load software should be a last resort.The per-formance of the remote CD attachment, or even a CD in the host machine,will pale in comparison to using a local ISO file on the host’s disk. Unlessyou have nothing better to do for the rest of the week, load new guestmachines from an ISO image of the software.

Don’t Overallocate MemoryVirtual Memory is great, in a pinch, but don’t use it unless you’re desperate.Make sure that you don’t allocate more memory to guest machines than youhave physically in the server. If you force the Virtual Server host to swap, theperformance hit will be severe and global across all your virtual machines.Youcan monitor memory usage with Windows Performance Monitor.

Troubleshooting • Chapter 9 337

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 337

Page 363: Virtualization With Microsoft Virtual Server 2005 (2006)

Use a Separate Disk Controller for Guest MachinesNot only should you plan on using a different disk partition for your guestmachines, just to keep things tidy, you should consider using a completely dif-ferent set of disks and a second disk controller.The Virtual Server hostmachine will be cranking away with its own disk needs for basic operatingsystem tasks, so don’t weigh that controller down with the job of servicingguest machine disk requests too. If you can, just plan on giving the guestmachines their own disk array and disk controller.You’ll be glad you did.

Troubleshooting Automated Deployment ServicesIn this section, we’ll show you how to deal with the curveballs thatAutomated Deployment Services (ADS) will throw at you. If you can’t getyour systems to show up in ADS, then you’re dead in the water when itcomes to the Virtual Server Migration Toolkit (VSMT). But wait! Before youwalk away from ADS and VSMT to start rebuilding your physical servers inyour virtual environment, look here for help.

Troubleshooting PXEOftentimes, the problems you will encounter with ADS are not really ADSproblems at all; they are related to the way your network is set up. One of thekey dependencies of the ADS environment is the Preboot ExecutionEnvironment (PXE, pronounced “pixie”). Whenever you can’t get a system toshow up in ADS, or it always shows as “disconnected”, then it’s likely that thePXE setup is your problem. We’ll start by looking at these usual suspects:

■ DHCP Configuration

■ DHCP Relay Agent

■ Other PXE Servers

338 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 338

Page 364: Virtualization With Microsoft Virtual Server 2005 (2006)

Check the DHCP ConfigurationDynamic Host Configuration Protocol (DHCP) is the network serviceresponsible for handing out IP addresses and PXE server information to thesystems managed by ADS. Why is DHCP so important to PXE, you ask? It isthe only way that a device that boots into PXE has to “phone home” forstartup configuration information. While DHCP is generally your friend hereand can make configuration easy, it also has some pesky habits that can makeit your biggest foe in getting ADS to work properly.

Check to make sure that your DHCP server is running and assigningaddresses. If the DHCP server is a domain member, make sure that it isauthorized as well. If your DHCP server is installed on the same server asyour ADS, then make sure that the DHCP service has been configured toshare the required ports with the Network Boot Service (NBS).To do this,simply issue the adsdhcpconfig /add command at the Start | Run commandline.You can also view the current settings by giving the adsdhcpconfig /displaycommand.

DHCP Relay AgentRemember, DHCP is a broadcast-based protocol, and while this might seemhandy, it is not always the best approach to server deployment or virtualmigrations. It is definitely not the best approach when one of your mission-critical servers is rebooted and decides that booting into PXE and syncing upto your ADS server is better than starting its local operating system.

Although it is probably best to keep your migration environment separatefrom your production environment, (see the “Creating Your MigrationEnvironment” sidebar for our recommendations), sometimes this just can’t bedone. In the event that you feel the need to let PXE run rampant throughyour environment, make sure you plan around DHCP’s broadcast nature.

First, make sure that DHCP has a path across network segments, eitherthrough a router or VLAN switch that can handle DHCP forwarding, or byusing Microsoft’s DHCP relay agent. For more information on how to con-figure the DHCP relay agent for PXE, view Microsoft’s Knowledge BaseArticle ID 257579 at http://support.microsoft.com/kb/257579/en-us.

Troubleshooting • Chapter 9 339

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 339

Page 365: Virtualization With Microsoft Virtual Server 2005 (2006)

NOTE

When you configure your DHCP relay agent, make sure that you includeboth the DHCP server and the PXE server address. PXE responds tobroadcast requests for DHCP options 60, 66, and 67. If your DHCP andPXE servers are not one and the same, then both need to hear therelayed requests. For more on this, check out Microsoft’s KnowledgeBase Article ID 259670 at http://support.microsoft.com/kb/259670/en-us.

Configuring & Implementing…

Creating Your Migration EnvironmentThinking through the way you put your migration environment togetheris probably the most important part of setting it up. A well-planned envi-ronment will head off most of the problems we’ve talked about. Here aresome tips to consider when configuring your migration environment:

■ Place the migration components in an isolated networksegment. If you can, isolate as many of the migration environ-ment components (ADS, DHCP, Virtual Server) onto their ownsegment. By avoiding the need for a DHCP relay agent, youreduce the complexity of your migrations immensely. Not onlydo you isolate your production environment from the migrationenvironment, reducing the risk that you might accidentallymove a server that is not quite ready to move, but you alsokeep the imaging traffic from impacting normal operations.

■ Keep your scripts simple. Don’t try to be fancy with yourmigration environment. The main purpose of it is to get animage off your production server onto a guest machine withminimal change. The only major changes from the physical tothe virtual platform should be disk and network drivers, andthe VSMT scripts should take care of most of this for you.Anything else just complicates matters.

■ Have all your drivers before you start. Having the correctdrivers is important when you’re imaging and deploying

340 Chapter 9 • Troubleshooting

Continued

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 340

Page 366: Virtualization With Microsoft Virtual Server 2005 (2006)

servers. Make sure that you have included all the drivers youare likely to run across, otherwise you will spend much of yourmigration time chasing downloads.

Check for Other PXE ServersUnlike DHCP, PXE does not have any mechanism to detect other PXEservers on the same network segment. What happens when two PXE serversare listening on the same segment, you ask? Whoever answers first wins.

So, if your device isn’t acting right in ADS, check to see if there is anotherPXE server on the subnet. It could be a RIS server or any other number ofthird-party PXE servers (Wyse Rapport or Altiris/HP Rapid Deployment toname a few) that is the culprit. Either shut the offender down or move yourADS to a different subnet.

NOTE

If you do move your ADS server, you’ll need to remember to take care ofa few other things afterwards. First, make sure you change the DHCPand DHCP relay agent settings, if any, to reflect the new location of yourADS server. Second, make sure you change the IP address for the ADSserver. Changing the IP address for ADS is not exactly fun (it involves afair amount of registry work), so try not to have to do it at all. For theexact procedure, take a look at Microsoft’s Knowledge Base Article ID825039 at http://support.microsoft.com/default.aspx?scid=kb;en-us;825039.

Check Your Network DriversIf your target device boots into PXE, but then fails to identify the networkcard during the remote floppy boot, check to make sure that you haveinstalled the appropriate network adapter driver. Remember, the remotefloppy boot procedure looks only for the first NIC in the system BIOS, so ifyou have multiple adapters, make sure you’ve loaded the driver for the firstone recognized by the BIOS.

Troubleshooting • Chapter 9 341

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 341

Page 367: Virtualization With Microsoft Virtual Server 2005 (2006)

Check Your Storage DriversThe same goes for your storage drivers. If the remote floppy boot doesn’thave drivers for your SCSI controller, then it will have a hard time capturinga disk image. Make sure that there is a driver for each of your disk controllersin the remote boot floppy.

NOTE

Storage and network drivers used in the PXE boot process are stored inC:\Program Files\Microsoft ADS\nbs\repository\User\PreSystem directory.

Check Your BIOS ClockTo make sure it is talking to the right ADS server, the client checks the cer-tificate you installed during ADS setup. In PXE, the clock used is the localsystem BIOS clock, so if the time is significantly off in the BIOS then yourADS certificate may not be valid yet or expired, depending on which way theclock is off. Make sure that the BIOS clock on the target device is set to thecorrect time.

Troubleshooting the ADS ServicesNow that you’re certain that the network setup is not causing your headache,let’s talk about the actual ADS services.There are a few key areas to look atwhen ADS continues giving you fits.This section will lead you through them.

Check That the ADS Services Are RunningFirst, check to see that the ADS services are running. While it may seem likean obvious step, it’s generally the one that most people fly right past.This isalso a good place to start because other problems with ADS will keep the ser-vices from starting.You can check the state of the ADS services by going toADS Management Console and confirming that the ADS Controller Service,Image Distribution Service, and Network Boot Services are running. If theyshow as stopped or disconnected, then take a look at the Windows Event Logto see if there are any errors or if they just need to be restarted.

342 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 342

Page 368: Virtualization With Microsoft Virtual Server 2005 (2006)

Confirm the ADS Controller’s IP AddressIf the device and the Controller aren’t talking, check to make sure that theController is listening on the right IP address, especially if the controller hasmultiple NICs.To do this, just type adsservice /edit /controller /newipipaddress at the Start | Run prompt.

Check the ADS CertificatesADS makes use of a certificate to make sure that the PXE target device istalking to the correct ADS server.ADS also uses the same certificate toauthenticate the Deployment Agent server with the Controller server. If thesecertificates are not installed properly,ADS will fail.

You can use the regcert command to verify and update the appropriatecertificate on the Deployment Agent server and the Controller server.Toverify the certificate, type regcert /b /l at the command prompt of theDeployment Agent server. If the command returns the No ADS BuilderCertificates in registry message, then you need to install the appropriate certifi-cate.This is done by entering regcert /b certificate at a command prompt.The default certificate file is stored at C:\Program Files\MicrosoftADS\Certificate\Adsroot.cer on the ADS Controller server.

After you have completed these steps, the regcert /b /l command shouldreturn the following message: Registered ADS Builder Certificate ‘adsroot.cer’.

Troubleshooting the Virtual Server Migration ToolSo,ADS is working as expected and it’s time to start using the Virtual ServerMigration Toolkit (VSMT).Although most of the processes used by VSMTare similar to the ones used in ADS, they aren’t exactly the same, so nowyou’ve got to deal with the problems that are unique to Virtual Server migra-tions.This section is a quick and easy guide to get you through the frequentproblems encountered using the migration tool.

Troubleshooting • Chapter 9 343

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 343

Page 369: Virtualization With Microsoft Virtual Server 2005 (2006)

Troubleshooting the Virtual Network SetupOne of the first things you should have done when you installed the VSMTwas to run the Createvirtualnetwork.vbs script.This script creates a newvirtual network named VM0 which is the destination for the migratedimages. If your <virtual machine>_CreateVM.cmd script fails, check to makesure that VM0 has been created.

NOTE

Another network configuration item to keep in mind is that theGatherHW.cmd script collects the MAC address of the original system.When <virtual machine>_CreateVM.cmd is run, it sets the MAC addressof the guest machine to the same one that was on the physical server. Ifboth the virtual machine and physical host are on the network at thesame time, you may experience intermittent network failures on both.

Troubleshooting Script CreationThe GatherHW.cmd script is used to collect information about the targetserver, but it cannot do its job without a little help from you. If theGatherHW.cmd script fails to process, make sure that the target machine hasWindows Management Instrumentation (WMI) installed and all of its diskpartitions are formatted NTFS. If you are migrating a Windows NT 4.0server, you will need to install the WMI Core for GatherHW.cmd to collectthe information it needs.

NOTE

You can download the WMI Core for Windows NT 4.0 atwww.microsoft.com/downloads/release.asp?releaseid=18490.

344 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 344

Page 370: Virtualization With Microsoft Virtual Server 2005 (2006)

Troubleshooting ADS IntegrationThe VSMT integrates with ADS through the <virtualmachine>_CreateVM.cmd file generated by VMScript.exe. If the ADS server isoffline or disconnected when you execute the <virtualmachine>_CreateVM.cmd, then the script will fail, but it may leave the job halfdone. If the migration process fails at any point, the best way to restart it is togo back, delete any reference to the new virtual machine, and start over. Ifyou try the same script again without cleaning up the pieces of the priorattempt, your attempt will only end in disaster.

Troubleshooting Migration from VMware to Virtual ServerIf you find yourself needing to move virtual machines from a VMware GSXServer 3 or a VMware Server 1.0 platform, you can use the same process asyou would for a physical server.The only difference is in the drivers you needto include in the C:\Program Files\Microsoft ADS\nbs\repository\User\PreSystem directory.

You can download the VMware SCSI driver from the VMware Web siteat www.vmware.com/download/server/drivers_tools.html.Also, you need toensure that the virtual machine you are moving is running the latest versionof the VMware Tools before you start the migration; otherwise, the SCSIdriver you download may not be compatible with the one on the virtualmachine.

Troubleshooting the Migration ProcessThe migration process from physical server to virtual machine is a combina-tion of ADS and VSMT.All of the troubleshooting steps we have alreadytalked about apply during the migration process as well.There are a few morethings to cover, though, so read on and we’ll show you how to avoid thesecommon pitfalls.

Troubleshooting • Chapter 9 345

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 345

Page 371: Virtualization With Microsoft Virtual Server 2005 (2006)

Imaging ProblemsThe most time-consuming portion of the migration process, other than set-ting up the migration environment, is the capture of the disk images to bemigrated and then their deployment onto the Virtual Server.This section willwalk you through the major obstacles and how to overcome them.

Most of the image capture problems will revolve around getting the targetdevice booted properly into PXE with the correct drivers. We won’t spendtoo much time going over what we already covered earlier except to rein-force that if you don’t have the correct drivers, you aren’t going to get veryfar with your image capture.

Image deployment is another matter altogether. Here, there are a numberof things that can get in your way. Imgdeploy.exe is the executable that han-dles the capture and deployment of images to the virtual machines, hence thename, but its error messages are not terribly helpful in determining whatwent wrong.Table 9.2 covers the common errors and what you can do aboutthem.

Table 9.2 Common Imgdeploy.exe Errors

Error Message Solution

Image imagename cannot be Occurs during image capture operation; added: the directory cannot this normally indicates that the image be removed. storage location has been set up on a FAT

volume.Move the image storage to an NTFS volumeor convert the existing storage volume toNTFS.

The command finishes Occurs during either image deployment or immediately without any capture; happens when not all files needed message; image is not for Imgdeploy.exe to function are in the captured or deployed. same directory.

Make sure that Imgdeploy.exe, Imglib.dll,and Adssupport.dll are all in the samefolder.

346 Chapter 9 • Troubleshooting

Continued

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 346

Page 372: Virtualization With Microsoft Virtual Server 2005 (2006)

Table 9.2 continued Common Imgdeploy.exe Errors

Error Message Solution

Imgdeploy.exe fails with error Occurs during the image deployment oper-107374180. ation; this error normally indicates image

corruption. Try capturing a new image and thendeploying again.

Network connection was reset Occurs during image deployment (exit code c000105a). operation; generally indicates that the ADS

server is sending the image faster than thevirtual server can write it to disk. Make sure the speed and duplex of the vir-tual server’s NICs are set correctly. Alsoensure that TCP offloading has been turned off.

IDE Disks Cannot Exceed 127 GBIn Virtual Server 2005 R2, the virtual IDE controller is not capable of seeingdisks greater than 127 GB.This used to be the upper limit for IDE tech-nology until very recently, and probably shouldn’t come as a surprise that vir-tualization technology still hasn’t completely caught up. While this may seemlike an almost academic fact, given that most servers will be migrating fromSCSI disk technology, it has considerable impact on the migration process.

VSMT and ADS can read existing SCSI disks, but when the VSMT gener-ates the virtual machine it defines the target disks as IDE disks, regardless ofwhat kind of disk they were before. So if you are trying to transfer a physicalserver with a disk larger than 127 GB, stop it. If you are lucky, this is just adata volume and you can migrate the system partition with VSMT and thenuse a third-party imaging product, such as Symantec Ghost, to migrate theoversized disk. If the disk that is too large is the system partition, then, unfor-tunately, it’s time to break out your ISO images and start building.

Converted SCSI Disks Fail to BootAlong the same lines as the IDE disk size limit, some real SCSI controllerswrite their master boot records (MBRs) out in such a way that the virtual

Troubleshooting • Chapter 9 347

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 347

Page 373: Virtualization With Microsoft Virtual Server 2005 (2006)

IDE controller cannot find where it starts. Hope is not lost, though. Becausethe imgdeploy.exe will simply lay down a sector-by-sector image of the orig-inal disk, your only problem will be once you try to actually boot the newlycreated guest machine. If your newly migrated server boots to a black screenand hangs, then it’s a good guess that this is your problem.

To work around this slight inconvenience, we are going to connect thenew virtual disk to a SCSI adapter instead of the IDE adapter created byVSMT.

First, go into the Virtual Server Administration Web site and select theguest machine you are working with and click Edit Configuration, asshown in Figure 9.21.

Figure 9.21 Editing the Virtual Machine Settings

Next, scroll down until you see SCSI adapters and click on it (seeFigure 9.22).

Figure 9.22 Configuring a New SCSI Adapter

348 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 348

Page 374: Virtualization With Microsoft Virtual Server 2005 (2006)

Now you’re going to add a SCSI controller to connect your virtual diskto by clicking Add SCSI Adapter and then accepting the default settings forthe SCSI Adapter and clicking OK, as shown in Figures 9.23 and 9.24.

Figure 9.23 Adding a SCSI Adapter to a Virtual Machine

Figure 9.24 Virtual Machine SCSI Adapter Properties

Then click on Hard disks (see Figure 9.25) and change the attachmentfrom the IDE channel it is currently on to the appropriate SCSI channel andID, as shown in Figure 9.26.You should try to mirror the SCSI configurationof the physical server as close as you can here, to ensure that you get thesystem partition on the right channel.

Figure 9.25 Changing the Virtual Machine’s Hard Disk Configuration

Troubleshooting • Chapter 9 349

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 349

Page 375: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure 9.26 Changing the Attachment for Virtual Disks from IDE to SCSI

After all your virtual disks are attached to the new SCSI adapter (seeFigure 9.27), you’re ready to power on the guest machine and finish anyother post-migration cleanup you need to do.

Figure 9.27 Virtual Machine Hard Disk Configuration after SCSI Attachment

NOTE

From a performance perspective, the virtual SCSI controller is faster thanthe virtual IDE controller. Because the .vhd files are readable by both vir-tual controllers, you should convert your disks to using the SCSI con-troller as a general rule. This will not only smooth out any migrationproblems from physical SCSI disks, but will also give you a performancegain inside the virtual environment.

350 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 350

Page 376: Virtualization With Microsoft Virtual Server 2005 (2006)

SummaryIn this chapter, we’ve tried to help you through some of the most nerve-wracking experiences when dealing with Virtual Server 2005 R2. Whetherit’s a permissions problem with the Virtual Server Administration Web site ormigrating a recalcitrant server to a more pliable guest machine, Virtual Server2005 R2 can throw some good ones at you. We’ve tried to give you a headstart on most of the common problems and some suggestions on how toavoid them.There will always be new problems to troubleshoot as our envi-ronments continue to evolve and change with the virtualization technologiesavailable to us. Remember to use your support resources in the MicrosoftKnowledge Base,Technet, and newsgroups, in addition to this chapter, to helpyou get the most out of your virtual server.

Solutions Fast Track

Troubleshooting Virtual Server 2005 R2

� The Virtual Server Administration Web site is very sensitive to thesecurity choices you make during installation. If you choose to useconstrained delegation, make sure that you are a member of a domainwith Active Directory available. If you make the server a member of aworkgroup, turn off Integrated Windows Authentication.

� VMRC is disabled by default, so remember to turn it on.Also,remember that it sits on the same port as VNC, so be sure to changeports if you need VNC as well.

� Virtual network definition files are not dynamically updated whenyou change network adapters. If you change NICs, update yourvirtual networks.

� Disable TCP offloading on your network adapters; it can only causeyou pain.

Troubleshooting • Chapter 9 351

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 351

Page 377: Virtualization With Microsoft Virtual Server 2005 (2006)

Troubleshooting Automated Deployment Services

� DHCP and PXE are key components for the correct function ofADS. Check to make sure that your DHCP server and NetworkBoot Services (NBS) server can be seen by all of the target devicesyou are planning to migrate.

� Storage and network drivers for each target device need to beincluded in the PXE boot floppy.

� The ADS certificate is referenced by the Controller, the Agent, andthe Device. If your certificate is not installed properly or your systemclocks are not in sync, then ADS is likely to fail.

Troubleshooting Virtual Server Migration Toolkit

� Make sure that the VM0 virtual network was created during theVSMT setup. If it’s not there, run Createvirtualnetwork.vbs.

� WMI is an important prerequisite for migration targets to haveinstalled on them. Without WMI, the VSMT cannot get enoughinformation to create the migration scripts.

� Don’t try to restart a migration job that has failed. Delete any recordof it from ADS and VSMT and then start over after you’ve fixed theproblem.

� Migrating from VMware GSX Server 3 or VMware Server 1.0 iseasy, as long as you are using the VMware SCSI driver in theC:\Program Files\Microsoft ADS\nbs\repository\User\PreSystem.

Troubleshooting the Migration Process

� Imgdeploy.exe will be the most frequent source of imaging problems,mainly stemming from network settings, NIC drivers, or diskcontroller drivers.Also, don’t be surprised if the image is corruptedduring the capture and you need to recapture it, especially on a busynetwork.

352 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 352

Page 378: Virtualization With Microsoft Virtual Server 2005 (2006)

� Virtual Server uses a slightly older virtual IDE controller, which islimited to a maximum capacity of 127 GB per IDE disk. If you aretrying to transfer a server with a disk larger than 127 GB, look for analternative method to migrate it.

� The virtual SCSI disk driver is more reliable and has betterperformance than its IDE counterpart.After the migration process iscomplete, convert your virtual hard disks to SCSI from IDE to avoidstartup and performance problems.

Q: Should I load Virtual Server 2005 R2 on a domain controller?

A: Not if you can help it.The problems with time synchronization, SMBsigning, and user security probably aren’t worth the hassle. If you are in acrunch for hardware, and still need a domain controller, consider loading avirtual domain controller on a standalone virtual server.

Q: You keep coming back to network drivers and disk controller drivers asbeing the source of migration problems. Is it really smooth sailing onceI’m through the drivers?

A: For the most part, yes.That’s why we strongly recommend that you down-load all the drivers you will need and include them, even if you’re notsure. It won’t hurt to have too many drivers, but you’ll be pulling yourhair out if you miss one.

Q: My images seem to continuously end up being corrupted. What am Idoing wrong?

Troubleshooting • Chapter 9 353

Frequently Asked Questions

The following Frequently Asked Questions, answered by the authors of this book,are designed to both measure your understanding of the concepts presented in this chapter and to assist you with real-life implementation of these concepts. Tohave your questions about this chapter answered by the author, browse towww.syngress.com/solutions and click on the “Ask the Author” form.

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 353

Page 379: Virtualization With Microsoft Virtual Server 2005 (2006)

A: For starters, make sure you have the right drivers.Then check your net-work settings for duplex and speed. If you’re still having problems, con-sider moving the target and the ADS server onto their own networksegment so they don’t have to contend with other network traffic duringthe capture.

Q: Does it matter if my DHCP and ADS services are on the same server?

A: Generally, no, you just need to make sure ADS has made the necessarychanges to DHCP; otherwise PXE will not work. So long as you installADS after DHCP, you should be fine.

Q: I’ve really fouled things up with my virtual server. What will it hurt if Iuninstall and re-install it?

A: None of your virtual machine, disk, or network files are removed duringan uninstall. So, as long as you don’t delete them, there are still there aftera re-install.All you need to do is to define your settings again and you’reno worse for the wear.

Q: Is TCP offloading really as big a problem as you make it sound?

A: Yes, absolutely it is.The amount of extra effort that the virtual server hasto go through is enormous if TCP offloading is enabled. It can make thenetwork performance of your guest machines so horrible that it will leaveeven the most ardent fan of virtualization wanting to throw the virtualserver out of a third-story window. Friends don’t let friends use TCPoffloading on a virtual server.

354 Chapter 9 • Troubleshooting

406_VIRTUAL_09.qxd 9/8/06 6:54 PM Page 354

Page 380: Virtualization With Microsoft Virtual Server 2005 (2006)

The Pros and Cons of RunningVirtual Server

This article written by Brien M. Posey firstappeared on TechGenix’s WindowsNetworkingWeb site (www.windowsnetworking.com). Formore information, see the note at the end ofthis appendix.

Appendix A

355

406_VIRTUAL_AppA.qxd 9/11/06 12:15 PM Page 355

Page 381: Virtualization With Microsoft Virtual Server 2005 (2006)

IntroductionMicrosoft’s Virtual Server 2005 helps cut hardware cost by allowing you tosimultaneously run multiple virtual machines on a single server. Before youconsider deploying Virtual Server 2005, though, you need to understand thevarious caveats and implications associated with virtual machines.

In this article, I discuss some of the pros and cons associated with usingVirtual Server 2005. In case you aren’t familiar with Virtual Server, it is aproduct that is designed to allow you to create multiple virtual servers on asingle Windows Server 2003 box. Each of these virtual servers functions as anindependent computer running its own operating system and individual set ofapplications.You can learn more about Virtual Server 2005 by visitingwww.microsoft.com/windowsserversystem/virtualserver/evaluation/vsoverview.mspx.

Why Is Virtual Server Beneficial?Virtual Servers are handy for a variety of reasons. Primarily, though, they areused in development environments and are also used for server consolidation.The reason why Virtual Server works so well in development environments isbecause it allows developers to test potentially buggy software on a variety ofdifferent operating systems without having to worry about crashing thesystem.

While it’s true that the virtual machines are running on top of Windows,Virtual Server is designed in a way that isolates each virtual machine from thecore operating system, and from other applications and virtual machines thatmight be running on the system.Therefore, if a buggy application were tocrash, it might bring down the virtual machine, but it will not have any effecton the machine’s main operating system.

Virtual machines are stored as hard drive image files.This means that adeveloper can create a virtual machine that’s running a specific operatingsystem and configuration. It is then possible to back up the virtual machine’shard drive image file.That way, if the virtual machine were to be destroyed orif the configuration were altered, it would be possible to restore the virtualmachine to its original state by simply restoring a single file.

356 Appendix A • The Pros and Cons of Running Virtual Server

406_VIRTUAL_AppA.qxd 9/11/06 12:15 PM Page 356

Page 382: Virtualization With Microsoft Virtual Server 2005 (2006)

Virtual Server is perfect for development environments because it enablesadministrators to quickly restore a specific configuration without worryingabout a buggy application trashing a server’s operating system. However,Virtual Server is also ideal for server consolidations.

Imagine, for instance, that you have an old Windows NT Server that’srunning a proprietary application that will not run under any other version ofWindows. Now, imagine that one day the ancient hardware that the applica-tion is running on decides to give up the fight and die.You could go out andspend big bucks on a new server, but that might not be the best course ofaction to take.Think about it for a moment. Compared with today’s stan-dards, Windows NT required very little computing power.You could installWindows NT and your proprietary application onto new hardware, but mostof the new server’s power would be wasted.A better solution might be tocreate a Windows NT virtual machine on an existing server and run yourproprietary application from there.

Obviously, this solution saves you the expense of a new server, but it alsoreduces clutter in your server room. Furthermore, Windows NT will runexactly as it would if it were running on a dedicated server.This means that itwon’t be any more difficult to install Windows onto a virtual machine than itwould be to install it on a physical machine. Furthermore, you have the addedassurance that because Windows NT and your application are running withina virtual machine, if there is ever a crash, the crash won’t take down the serverthat the virtual machine is running on.

Performance IssuesAs you can see, Virtual Server 2005 is an extremely useful product, but it doeshave some caveats that you need to heed.The first issue that you need to beaware of has to do with reliability.As I mentioned before, Virtual Server isdesigned so that if one of the virtual servers were to fail, it will not affect thephysical hardware, the host operating system, or other virtual servers or appli-cations running on the server.The problem is that a hardware failure or afailure in the host operating system can take down the virtual servers runningon that machine. For example, if your Windows 2003 Server running five vir-tual servers had a severe hardware failure, the host operating system and thevirtual servers running on it would become unavailable. Even though only

The Pros and Cons of Running Virtual Server • Appendix A 357

406_VIRTUAL_AppA.qxd 9/11/06 12:15 PM Page 357

Page 383: Virtualization With Microsoft Virtual Server 2005 (2006)

one server has actually failed, your end users will have the perception that sixdifferent servers have failed.

Another issue that you need to be aware of is performance.To successfullyrun Virtual Server 2005, your physical server must have sufficient hardware torun the host operating system, plus any necessary virtual machines. Re-member that each virtual machine has its own individual operating systemand its own set of applications, and your server needs to be beefy enough tohandle running all of this software simultaneously.

Unfortunately, I can’t tell you exactly what kind of hardware you willneed because the required hardware varies greatly depending on the numberof virtual machines that you are running and on the operating systems andapplications running on each virtual machine. What I can tell you, though, isthat from my experience you should plan on allocating a bare minimum of128 MB of memory for each virtual machine that you will be running, plusthe necessary hardware for the host operating system to run efficiently.

You also need to think about hard disk and processor utilization. In theexample that I gave earlier in which a legacy system died of old age and isbeing resurrected within a virtual machine, hard disk space and processor uti-lization aren’t major concerns because the legacy operating system and appli-cation are not resource intensive. However, if you plan on running neweroperating systems, high-demand applications, or large numbers of virtualmachines, then disk and CPU resources will become a major consideration.Virtual Server 2005 does allow you to limit the amount of resources that eachindividual virtual machine can consume, but even so, you might considergiving your system a high-performance RAID array and one processor foreach virtual machine for ideal performance.

Licensing IssuesAnother issue that you will need to consider in relation to running virtualservers is software licensing. While it’s true that running applications in a vir-tual server environment often saves money in hardware costs, you won’t saveany money on software licensing. For example, imagine that you have a serverthat is running four virtual Windows 2003 Servers.You would actually needfive separate licenses for Windows Server 2003—one for the host operatingsystem and one for each of the four virtual machines. By the time you also

358 Appendix A • The Pros and Cons of Running Virtual Server

406_VIRTUAL_AppA.qxd 9/11/06 12:15 PM Page 358

Page 384: Virtualization With Microsoft Virtual Server 2005 (2006)

throw in a Virtual Server 2005 license, you will have spent more money onsoftware than you would have if all your virtual servers were running on sep-arate hardware.

Security IssuesOne last issue that I want to address is security. Suppose for a moment that aphysical server is running four virtual servers and one of those servers gets avirus.The good news is that unless that virus has been specifically designed toattack Virtual Server 2005 (no such virus currently exists) then the virus willbe isolated to the virtual server that contracted it. Remember that VirtualServer 2005 treats each virtual server as a completely separate machine, so asecurity breach on one virtual server will not directly affect other virtualmachines running on the same system.

There are a couple of security-related issues that you should be aware of,though. For example, if the machine’s host operating system were broughtdown by a virus or other exploit, the virtual servers could potentially alsocrash since Virtual Server 2005 is dependent on the host operating system.

Another security issue that you need to be aware of is that virtualmachines must be secured, patched, and maintained, just like any other serverin your organization. It’s easy to think of a virtual server as not being a “realserver,” especially in a development environment, and therefore not take thesecurity precautions that might be taken with a production server.

Lax security on a virtual machine shouldn’t directly cause problems forother virtual machines, but it could allow the virtual machine to be moreeasily hacked. Hackers often use a machine with weak security as a platformfor gaining access to the rest of the network.To prevent a virtual server frombeing used to compromise the rest of your network, you must ensure that allservers (real and virtual) use the proper security.

ConclusionIn this article, I have explained that Microsoft’s Virtual Server 2005 will allowyou to run multiple virtual machines on one physical server. I then went onto explain that there are a number of performance, security, and softwarelicensing issues that you must address prior to deployment.

The Pros and Cons of Running Virtual Server • Appendix A 359

406_VIRTUAL_AppA.qxd 9/11/06 12:15 PM Page 359

Page 385: Virtualization With Microsoft Virtual Server 2005 (2006)

About Brien M. Posey Brien Posey is an award-winning author who has written over 3,000 articlesand written or contributed to 27 books.You can visit Brien’s personal Website at www.brienposey.com.

NotePosey, Brien M.“The Pros and Cons of Running Virtual Server.” TechGenix’sWindowsNetworking.com Web Site.August 25, 2004.(www.windowsnetworking.com/articles_tutorials/Pros-Cons-Virtual-Server.html). Copyright © 2006 TechGenix Ltd.This article was reprinted with permission from TechGenix Ltd.

360 Appendix A • The Pros and Cons of Running Virtual Server

406_VIRTUAL_AppA.qxd 9/11/06 12:15 PM Page 360

Page 386: Virtualization With Microsoft Virtual Server 2005 (2006)

Solutions Fast Track

This appendix provides you with a succintoverview of the most important concepts coveredthroughout this book.

Appendix B

361

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 361

Page 387: Virtualization With Microsoft Virtual Server 2005 (2006)

Chapter 1

Microsoft Virtual Server 2005 R2 and Dynamics System Initiative

� Streamline data center operations

� Increase server efficiency

� Improve operating system and application flexibility

What Is Virtualization, and When Should You Use It?� To rapidly deploy test systems

� To consolidate underutilized physical servers

� To take snapshots to create recovery points

� To increase disaster recovery potential.

What Virtualization Tools Are Available?� PowerRecon automates the process of consolidation feasibility and

planning.

� Consolidation planning is a useful tool in showing the value ofvirtualization to management.

� PowerConvert can convert both Windows and Linux physicalmachines.

� PowerConvert considerably eases the migration process.

How Does Virtualization Work?� Presents standard motherboard to the guest machines

� Uses up to 3.6 GB of physical RAM on the host

� Supports physical and virtual CDs

� Supports porting virtual machines from one host to another

362 Appendix B • Solutions Fast Track

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 362

Page 388: Virtualization With Microsoft Virtual Server 2005 (2006)

Virtual PC versus Virtual Server 2005� Virtual Server supports 3.6GB RAM per virtual machine.

� Virtual Server supports 32 processors.

� Virtual PC supports sound.

� Virtual PC was designed for desktop operating systems.

Virtual Server 2005 versus Virtual Server 2005 R2� x64 support

� iSCSI support

� Host-clustering support

� Enhanced PXE-booting support

Solutions Fast Track • Appendix B 363

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 363

Page 389: Virtualization With Microsoft Virtual Server 2005 (2006)

Chapter 2

Determining the Physical Size of the Server

� Verify the hardware requirements for Microsoft Virtual Server.

� Evaluate what will be running in the environment.

� Plan adequately for growth of the environment.

Installing Virtual Server 2005 R2

� Download latest media or order media form Microsoft.

� Install IIS if you plan to run the Virtual Server Administrative websitefrom the host.

� Determine if you are going to have a single or multiple VirtualServer environment.

Setting Up a Virtual Server Administration Web Site

� Install IIS before installing the Virtual Server Web Site.

� Determine if the site will be used to manage multiple Virtual Servers.

� Having a single Virtual Server Administrative Web Site can bedesirable for security conscious companies that want to reduce theamount of IIS server in their environment.

Setting Access Permissions on the Virtual Machine Remote Console

� Set the connection timeout to disconnect idle connections.

� If using the VMRC through a firewall ensure that the appropriateports are open.

� Determine is you want to utilize SSL to secure the connection.

364 Appendix B • Solutions Fast Track

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 364

Page 390: Virtualization With Microsoft Virtual Server 2005 (2006)

Setting Default Location and Search Paths

� For consistency keep the default virtual machine configuration folderthe same on each Virtual Server.

� If using a resource on a remote location ensure that constraineddelegating in configured.

� Always use fully qualified paths.

Setting Resource Allocation

� Utilize relative weight when running virtual machines with differentpriorities.

� Use the reserved capacity setting to guarantee a certain amount ofcpu resources to a virtual machine.

� Use Maximum capacity setting to prevent a virtual machine fromusing more that the desired amount of cpu resources.

Solutions Fast Track • Appendix B 365

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 365

Page 391: Virtualization With Microsoft Virtual Server 2005 (2006)

Chapter 3

Creating a Virtual Disk� Dynamic virtual hard disks are the default and start small but grow as

necessary to the configured size.These are good choices for virtualmachines that are newly created and do not require all the disk spaceat once.As a dynamic disk file grows larger then the physical diskdrive can handle, it can be moved to a large physical disk drive orpartition.

� Fixed virtual hard disks allocate all the configured space at once.Thisis the method used when a physical disk is migrated to a virtual harddisk.This is best used if a virtual machine requires all the allocateddrive space at once.

� Linked virtual hard disks are connected to physical partitions andused mainly for migration of physical machines to virtual machines.They are seen as fixed-size disks.

Creating the Virtual Server� Allocate only the amount of memory actually needed. Memory can

be increased if necessary but must be available on the host computerbefore it can be allocated.

� Virtual hard disk controllers can be IDE or SCSI. IDE can onlysupport virtual hard disk up to 128GB in size.The virtual SCSIsupports virtual hard disks up to 2 TB in size.You can also supportmore devices on a virtual SCSI than a virtual IDE interface.

� The virtual floppy disk and the virtual CD/DVD should beconfigured to “not connected” state unless you are actually usingthese devices on the virtual machine. Using image files enables youto manage and configure several different virtual machines withouthaving to load a physical floppy disk or CD/DVD in the hostcomputer.

366 Appendix B • Solutions Fast Track

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 366

Page 392: Virtualization With Microsoft Virtual Server 2005 (2006)

Adding Hardware to the Server� The hardware in a Virtual Server host computer must be recognized

and supported by the Windows version loaded on it.

� Processors, memory, and storage subsystems are the most valuableupgrades to the host computer.These are the primary resources usedby the virtual machines.Additional network cards can also be used bythe virtual machines.

� Virtual machines can share host computer resources.This featuremakes adding HBA cards, RAID cards, and SAN connections morepractical on a Virtual Server host computer.The cost of these devicescan be share across all the virtual machines making the return oninvestment (ROI) easier to justify. Hey, cost is always an object.

Installing a Windows OS� Create the virtual machine from the Virtual Server Administration

Web page.

� Configure a new virtual hard disk.

� Connect to an existing virtual hard disk.

� Define the memory for the virtual machine.

� Connect the virtual CD/DVD or virtual floppy disk drive to thehost computer’s CD or floppy disk drive or use an image file.

� Start the virtual server and load the operating system like a physicalcomputer.

� Use the SCSI Shunt driver to speed up the performance of WindowsServer 2003, Windows 2000, and Windows XP virtual machines.

Installing Virtual Machine Tools� Virtual Machine Additions improve the video, mouse, keyboard, and

network performance of the virtual machines.They should be loadedon all virtual machines if possible.

Solutions Fast Track • Appendix B 367

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 367

Page 393: Virtualization With Microsoft Virtual Server 2005 (2006)

� Use the checkbox in Virtual Machine Additions Properties page ofthe virtual machine status to load it.This is an .iso image file that ismounted to the virtual machine when you check the checkbox andclick OK.

� Remove the Virtual Machine Additions from the virtual machine byselecting Start | Settings | Control Panel | Add or RemoveSoftware.This is just like any other software loaded on a physicalcomputer.

Installing a Non-Windows OS� Create the virtual machine from the Virtual Server Administration

Web page.

� Configure a new virtual hard disk.

� Connect to an existing virtual hard disk.

� Define the memory for the virtual machine.

� Connect the virtual CD/DVD or virtual floppy disk drive to thehost computer’s CD or floppy disk drive or use an image file.

� Start the Virtual Server and load the operating system like a physicalcomputer.

� Load the Virtual Machine Additions for the Linux operating system ifapplicable.These have to be downloaded from Microsoft’s Web site.They are installed by connecting the virtual CD/DVD to the .ISOimage and running the script or .rpm file.

� You must reboot or start the services for the Virtual MachineAdditions to work in the Linux-based virtual machines.

368 Appendix B • Solutions Fast Track

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 368

Page 394: Virtualization With Microsoft Virtual Server 2005 (2006)

Chapter 4

Introduction to Virtual Networks

� There are two types of virtual networks: external and internal.

� Virtual networks can be combined to form a complete network infrastructureon a single computer.

� Virtual networks are not portable. Virtual machines must have theirvirtual network adapter connected to a virtual network configuredon the virtual server hosting the virtual machine.

Using the “Internal Network”

� There can be an unlimited number of internal virtual networks eachwith an unlimited number of connections.

� The internal network can be used to isolate a set of virtual machinesto form a DMZ or a completely isolated network for testing.

� Loading the Microsoft Loopback adapter enables host-to-guestcommunications.This enables guest virtual machines to share fileswith the host computer.

Creating a Virtual Network

� Virtual networks are created from the Virtual Server AdministrationWeb page.

� Use descriptive names for the virtual networks and use the notessection to maintain the pertinent information about the virtualnetwork.

� A virtual network is automatically created for each physical adapterin the host computer.

Solutions Fast Track • Appendix B 369

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 369

Page 395: Virtualization With Microsoft Virtual Server 2005 (2006)

Binding a Physical NetworkAdapter to a Virtual Network

� Multiple virtual networks can be bound to a single physical networkadapter.The physical adapter must have access to the VLAN resourcesthe virtual networks are using.

� The virtual network can be reassigned to a different physical networkadapter from the Virtual Server Administration Web page by clickingConfigure in the Virtual Network section and selecting the virtualnetwork to edit.

� The Microsoft Loopback adapter is seen as a physical adapter and isused to bridge a virtual machine to the host’s network connection.

Using the Virtual Server Network Services

� DHCP server is available for every virtual network but is disabled bydefault.

� This service can only be used by the virtual machines on a virtualserver and cannot service any outside requests.

� It avoids the necessity of loading a DHCP server on a virtualmachine using an internal network.

370 Appendix B • Solutions Fast Track

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 370

Page 396: Virtualization With Microsoft Virtual Server 2005 (2006)

Chapter 5

Removable Hard Disks

� Virtual Server emulates disks, which are called virtual disks.To a guestoperating system inside a virtual machine, these virtual disks are thesame as those in a physical machine.They behave the same and havethe same limitations, determined by their emulated characteristics.

� Virtual Server emulates different kinds of disks that are common intoday’s physical machines.Those can be categorized as eitherremovable disks or hard disks.

� Virtual Server supports the use of removable media such as CD orDVD optical disks. Because a DVD drive also supports CDs, VirtualServer emulates a DVD drive.

Virtual Hard Disks

� Dynamically expanding disks are expanded on the host when storageis insufficient and the logical size has not been reached.

� Dynamically expanding disks start small and generally grow to thesize that is needed in the virtual machine.

� Dynamically expanding disks can get fragmented on the host. Heavyfragmentation decreases overall performance.

� Fixed-size disks are created at their full size.This requires planningand capacity management on the host.

� Differencing disks contain modifications relative to a parent disk’scontent.

� Differencing disks can be created of any type of virtual hard disk; thisenables chaining.

� The size of a virtual disk is set at creation time and cannot bemodified afterwards.

Solutions Fast Track • Appendix B 371

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 371

Page 397: Virtualization With Microsoft Virtual Server 2005 (2006)

Chapter 6

Automated Deployment Services

� Free tool to use on Windows Server 2003 (Enterprise Edition) tocapture and deploy servers

� Is able to multicast

� Can be used to do more than virtualizing

What Components Does ADS Use?

� ADS Controller service controls and logs all action done by ADS.

� ADS NBS is used to PXE boot to the Deployment Agent.

� ADS Image Distribution Service is used to capture and deployimages.

Installing ADS

� The Installation files are delivered as one file.

� The image directory can be set separately during the installation.

� As ADS uses PXE, it is essential to separate the ADS environmentfrom other network boot systems.

� ADS integrates with DHCP. If there are multiple DHCP servers, besure to check for integration on all servers.

Post-Installation: Configuring ADS

� After the installation, you can enable the option to automatically addservers to the ADS controller.

� Nothing is done to the servers until it is “in control.”

� Do not attempt to change the IP address only from the Controllerservice properties, as this results in failure.

372 Appendix B • Solutions Fast Track

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 372

Page 398: Virtualization With Microsoft Virtual Server 2005 (2006)

Administrative Agent Installing

� Is needed to be able to run jobs on windows clients.

� The traffic between the server and the client are encrypted.

� The certificate used to communicate with the server can be foundon the ADS server in %ADSInstallationPath%\Certificates.

Editing Using the Sequence Editor

� The Sequence Editor is a graphical tool to build jobs to use in ADS.

� There are a lot of sample jobs in the %ADSInstallationPath%\Samplesdirectory.

� Sequence files are stored as XML files and can be reused over andover again.

Adding Hardware Drivers in the Boot OS

� Every piece of hardware that is supported by Windows Server 2003 issupported by the Deployment Agent.

� To add new drivers to the boot image, copy the drivers to the“Microsoft ADS\nbs\repository\user\PostSystem” directory andrestart the builder service.

Installing Virtual Server Migration Toolkit onto theVirtualization Server

� The installation of the VSMT needs to be performed on the serverthat runs ADS.

� If the server that is going to host the virtual machine is not the oneused to virtualize, a “Tools only” installation must be done on thatserver.

Solutions Fast Track • Appendix B 373

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 373

Page 399: Virtualization With Microsoft Virtual Server 2005 (2006)

Chapter 7

The Management Interface

� The Virtual Server management interface is Web based and requiresInternet Information Services.

� System Center Virtual Machine Manager, to be released in the nearfuture, no longer has this requirement.

� Virtual Server hosts in the same Windows Server 2003 domain canall be managed centrally from one Internet Information Services siteusing the Virtual Server Administration Web site.

Using the Virtual Server COM API

� The Virtual Server COM API is documented in the Virtual ServerProgrammer’s Guide.

� This guide is really the Virtual Server SDK and installed with theproduct.

� Being able to navigate through the SDK is a requirement for easyand successful programming of Virtual Server.

Accessing a Virtual Server Using Script

� You can access Virtual Server properties and methods with a singleline of code.

� Use the VBScript CreateObject function with the Virtual ServerProgID to establish the connection.

Creating a Virtual Machine Using Script

� Create a virtual machine by using the CreateVirtualMachine method.

� You must create machine properties such as virtual disks first.

374 Appendix B • Solutions Fast Track

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 374

Page 400: Virtualization With Microsoft Virtual Server 2005 (2006)

Creating a Virtual Network Using Script

� Create a virtual network by using the CreateVirtualNetwork method.

Retrieving Guest OS Information Using Script

� Retrieve guest OS information through the GuestOS property of thevirtual machine object.

� Information is only available when the virtual machine additionshave been installed and the virtual machine is in the running state.

Changing a Virtual Machine State Using Script

� Change the state of a virtual machine by using the appropriate statemethod of the virtual machine object.

� The state transition of a virtual machine follows a state machinemodel.

Attaching Scripts to Virtual Server Events

� You can attach scripts to both Virtual Server and virtual machineevents.

� Attaching scripts gives you more control of the operations.

Solutions Fast Track • Appendix B 375

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 375

Page 401: Virtualization With Microsoft Virtual Server 2005 (2006)

Chapter 8

Getting the Virtualization Environment Ready for Usage � The ADS server does not have to be a physical server.

� DHCP addressing must be available to the device systems.The systemhosting the DHCP service can be an existing DHCP server, but it canalso be installed on the computer hosting the ADS Controller.

� If there are existing PXE services in your environment, such asRemote Installation Services (RIS), you need to isolate them from theADS implementation.

Capturing the Physical Machine� The virtualization process is disk intensive. Make sure you use fast disks.

� The time the capture process needs is about one-half to one and a halfminutes per gigabyte.

� By default, the capture and deploy processes don’t use encryption forperformance reasons. If you want to encrypt the traffic, delete thenonetencrypt parameter from the capturedisk.xml and the deployvm.xml.

Creating the Virtual Machine on the Virtual Server Host� The virtual machine that is created will be configured with the same

amount of disk space and memory as the physical server had. Makesure you have enough resources available

� The creation of fixed size disks takes a lot longer than the creation ofdynamically expanding disks

� The created Virtual Machine will be connected to the VM0 virtualnetwork by default.You can change this behavior by adding the

376 Appendix B • Solutions Fast Track

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 376

Page 402: Virtualization With Microsoft Virtual Server 2005 (2006)

/vsHostNet parameter when generating the migration scripts with thevmscript /HWgenerateP2V command.

Deploying the Virtual Machine on the Host OS� To improve performance, don’t put the images and the virtual hard

disks of the target on the same physical disk or in folders withcompression turned on.

� Delete or archive the job history in ADS to improve the performanceof VSMT.

� On a network with a high level of traffic, the deployment of theimage may fail because the virtual machine cannot connect to ADSafter booting into the Deployment Agent.There is an ADS hotfix, KB875533, to fix this.

Solutions Fast Track • Appendix B 377

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 377

Page 403: Virtualization With Microsoft Virtual Server 2005 (2006)

Chapter 9

Troubleshooting Virtual Server 2005 R2

� The Virtual Server Administration Web site is very sensitive to thesecurity choices you make during installation. If you choose to useconstrained delegation, make sure that you are a member of a domainwith Active Directory available. If you make the server a member of aworkgroup, turn off Integrated Windows Authentication.

� VMRC is disabled by default, so remember to turn it on.Also,remember that it sits on the same port as VNC, so be sure to changeports if you need VNC as well.

� Virtual network definition files are not dynamically updated whenyou change network adapters. If you change NICs, update yourvirtual networks.

� Disable TCP offloading on your network adapters; it can only causeyou pain.

Troubleshooting Automated Deployment Services

� DHCP and PXE are key components for the correct function ofADS. Check to make sure that your DHCP server and NetworkBoot Services (NBS) server can be seen by all of the target devicesyou are planning to migrate.

� Storage and network drivers for each target device need to beincluded in the PXE boot floppy.

� The ADS certificate is referenced by the Controller, the Agent, andthe Device. If your certificate is not installed properly or your systemclocks are not in sync, then ADS is likely to fail.

378 Appendix B • Solutions Fast Track

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 378

Page 404: Virtualization With Microsoft Virtual Server 2005 (2006)

Troubleshooting Virtual Server Migration Toolkit

� Make sure that the VM0 virtual network was created during theVSMT setup. If it’s not there, run Createvirtualnetwork.vbs.

� WMI is an important prerequisite for migration targets to haveinstalled on them. Without WMI, the VSMT cannot get enoughinformation to create the migration scripts.

� Don’t try to restart a migration job that has failed. Delete any recordof it from ADS and VSMT and then start over after you’ve fixed theproblem.

� Migrating from VMware GSX Server 3 or VMware Server 1.0 iseasy, as long as you are using the VMware SCSI driver in theC:\Program Files\Microsoft ADS\nbs\repository\User\PreSystem.

Troubleshooting the Migration Process

� Imgdeploy.exe will be the most frequent source of imaging problems,mainly stemming from network settings, NIC drivers, or diskcontroller drivers.Also, don’t be surprised if the image is corruptedduring the capture and you need to recapture it, especially on a busynetwork.

� Virtual Server uses a slightly older virtual IDE controller, which islimited to a maximum capacity of 127 GB per IDE disk. If you aretrying to transfer a server with a disk larger than 127 GB, look for analternative method to migrate it.

� The virtual SCSI disk driver is more reliable and has betterperformance than its IDE counterpart.After the migration process iscomplete, convert your virtual hard disks to SCSI from IDE to avoidstartup and performance problems.

Solutions Fast Track • Appendix B 379

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 379

Page 405: Virtualization With Microsoft Virtual Server 2005 (2006)

406_VIRTUAL_AppB.qxd 9/11/06 1:49 PM Page 380

Page 406: Virtualization With Microsoft Virtual Server 2005 (2006)

Windows ScriptFiles for VirtualServer 2005 R2

Appendix C

381

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 381

Page 407: Virtualization With Microsoft Virtual Server 2005 (2006)

Code Listings for Virtual Server 2005 R2In this appendix, we include two examples of scripts that advanced users ofVirtual Server 2005 R2 can use. Code Listing C.1 is an example of script forrunning a diagnostic query on Virtual 2005 Server R2. Code Listing C.2 isan example of script for creating disks and performing various operations onthem.

Code Listing C.1 Running a Diagnostic Query on Virtual Server 2005 R2

<?xml version="1.0" ?>

<package>

<comment>Virtual Disk Tool</comment>

<job>

<resource id = "strAbout">

VDisk, version 1.0, 2006

Matthijs ten Seldam

</resource>

<runtime>

<description>

VDisk, version 1.0, 2006

Matthijs ten Seldam

-------------------------------------------------------------------

This script enables operations related to virtual disks.

It has several switches to create all types of virtual disks

and to perform all possible operations on the disks.

See the options explanation under usage.

-------------------------------------------------------------------

Explanation

Image : The full path to the virtual hard disk image file.

NewImage: The new virtual hard disk image file to create.

Only valid with Create, Convert, MergeTo

382 Appendix C • Windows Script Files for Virtual Server 2005 R2

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 382

Page 408: Virtualization With Microsoft Virtual Server 2005 (2006)

Parent : The full path to the parent virtual hard disk file.

Only valid with Create and vhdType:D

Action : This can be one of the following:

Compact, Convert, Create, Inspect, Merge, MergeTo

vhdType : Type of virtual hard disk to create.

Can be 0:Expanding, 1:Fixed, 2:Differencing, 3:Floppy720,

5:Floppy144

Only valid with Create, MergeTo

Size : Size of virtual hard disk in MB.

Examples:

vdisk /image:c:\virtualmachines\disk1 /action:inspect

--> Inspects virtual disk and lists properties.

vdisk /image:c:\virtualmachines\disk1 /action:compact

--> Compacts Dynamically expanding virtual disk.

vdisk /image:c:\virtualmachines\disk1 /action:merge

--> Merges Differencing virtual disk with its parent.

vdisk /newimage:c:\virtualmachines\newfloppy /vhdType:3 /action:create

--> Creates a new floppy disk of size 720 KB.

vdisk /newimage:c:\virtualmachines\newfloppy /vhdType:3 /action:create

--> Creates a new floppy disk of size 1.44 MB.

vdisk /newimage:c:\virtualmachines\newdisk1 /size:500 /vhdType:0

/action:create

--> Creates a new virtual hard disk of size 500 MB and type

Dynamically Expanding

vdisk /newimage:c:\virtualmachines\newdisk1 /size:500 /vhdType:1

/action:create

--> Creates a new virtual hard disk of size 500 MB and type Fixed

Size

vdisk /newimage:c:\virtualmachines\newdisk1

/parent:c:\virtualmachines\disk1 /vhdType:2 /action:create

--> Creates a new virtual hard disk of type Differencing

-------------------------------------------------------------------

</description>

Windows Script Files for Virtual Server 2005 R2 • Appendix C 383

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 383

Page 409: Virtualization With Microsoft Virtual Server 2005 (2006)

<example>

</example>

<named name="Image" helpstring = "Virtual Disk Image File."

type="string" required ="false" ></named>

<named name="NewImage" helpstring = "Virtual Disk Image File to create."

type="string" required ="false" ></named>

<named name="Action" helpstring = "Action to perform." type="string"

required ="false" ></named>

<named name="vhdType" helpstring = "Type of Virtual Disk to create."

type="string" required ="false" ></named>

<named name="Parent" helpstring = "Parent Virtual Disk Image File."

type="string" required ="false" ></named>

<named name="Size" helpstring = "Virtual Disk Size." type="string"

required ="false" ></named>

</runtime>

<object id="objVS" progid="VirtualServer.Application" reference="true"

/>

<script language="vbscript">

<![CDATA[

'**Start Encode**

Option Explicit

Dim objVD, objTask, vhdTypes

vhdTypes = Array("Dynamically Expanding", "Fixed Size", "Differencing")

Const ParamError = "Missing or incorrect parameters!"

DetectScriptHost

Select Case wscript.arguments.count

Case 2

Select Case LCase(wscript.arguments.named("action"))

Case "inspect" Inspect()

Case "compact" Compact()

Case "merge" Merge()

End Select

384 Appendix C • Windows Script Files for Virtual Server 2005 R2

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 384

Page 410: Virtualization With Microsoft Virtual Server 2005 (2006)

Case 3

Select Case LCase(wscript.arguments.named("action"))

Case "convert" Convert()

Case "create" Create()

End Select

Case 4

Select Case LCase(wscript.arguments.named("action"))

Case "mergeto" MergeTo()

Case "convert" Convert()

Case "create" Create()

End Select

Case 5

If LCase(wscript.arguments.named("action")) = "create" then

Create()

End Select

Sub DetectScriptHost()

Dim ScriptHost

ScriptHost = WScript.FullName

ScriptHost = Lcase(Right(ScriptHost, Len(ScriptHost) -

InStrRev(ScriptHost, "\")))

if scripthost="wscript.exe" then

wscript.echo "This script must be run using Cscript host!"

wscript.quit 1

end if

End sub

Function GetParent(objVD)

wscript.echo "Parent disk : "& objVD.Parent.File

If not IsNull(objVD.Parent) then GetParent(objVD.Parent)

End Function

Sub Inspect()

On Error Resume Next

Set objVD = objVS.GetHardDisk(wscript.arguments.named("image"))

If err.number = 0 then

with objVD

Windows Script Files for Virtual Server 2005 R2 • Appendix C 385

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 385

Page 411: Virtualization With Microsoft Virtual Server 2005 (2006)

wscript.echo "ImageFile : " & .File

wscript.StdOut.Write "Disk Type : "

Select Case .Type

Case vmDiskType_Dynamic wscript.echo "Dynamically Expanding"

Case vmDiskType_FixedSize wscript.echo "Fixed Size"

Case vmDiskType_Differencing

wscript.echo "Differencing"

GetParent(objVD)

End Select

wscript.echo "Size in guest: " & .SizeInGuest & " bytes."

wscript.echo "Size on host : " & .SizeOnHost & " bytes."

End With

Else

Call Handle(err,"Inspect")

End If

On Error Goto 0

End Sub

Sub Compact()

On Error Resume Next

Set objVD = objVS.GetHardDisk(wscript.arguments.named("image"))

If err.number = 0 then

If objVD.Type = vmDiskType_Dynamic then

Set objTask = objVD.Compact

If err.number = 0 then

wscript.stdout.write "Compacting " & objVD.File & " "

While Not objTask.IsComplete

wscript.sleep 2000

wscript.stdout.write "."

Wend

wscript.echo " done."

Else

Call Handle(err,"Compact")

End If

Else

386 Appendix C • Windows Script Files for Virtual Server 2005 R2

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 386

Page 412: Virtualization With Microsoft Virtual Server 2005 (2006)

wscript.echo "Cannot compact virtual disk of type: " &

vhdTypes(objVD.Type)

End If

Else

Call Handle(err,"Compact, GetHardDisk")

End If

On Error Goto 0

End Sub

Sub Merge()

On Error Resume Next

Set objVD = objVS.GetHardDisk(wscript.arguments.named("image"))

If err.number = 0 then

If objVD.Type = vmDiskType_Differencing then

Set objTask = objVD.Merge

If err.number = 0 then

wscript.stdout.write "Merging " & objVD.File & " "

While Not objTask.IsComplete

wscript.sleep 2000

wscript.stdout.write "."

Wend

wscript.echo " done."

Else

Call Handle(err,"Merge")

End If

Else

wscript.echo "Cannot merge virtual disk of type: " &

vhdTypes(objVD.Type)

End If

Else

Call Handle(err,"Merge, GetHardDisk")

End If

On Error Goto 0

End Sub

Sub MergeTo()

Windows Script Files for Virtual Server 2005 R2 • Appendix C 387

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 387

Page 413: Virtualization With Microsoft Virtual Server 2005 (2006)

If Int(wscript.arguments.named("vhdType")) <> vmDiskType_Differencing

then

On Error Resume Next

Set objVD = objVS.GetHardDisk(wscript.arguments.named("image"))

If err.number = 0 then

If objVD.Type = vmDiskType_Differencing then

Set objTask =

objVD.MergeTo(wscript.arguments.named("newimage"),wscript.arguments.name

d("vhdType"))

If err.number = 0 then

wscript.stdout.write "Merging " & objVD.File & vbCrLf

wscript.stdout.write "To " & wscript.arguments.named

("newimage")

While Not objTask.IsComplete

wscript.sleep 20000

wscript.stdout.write "." & objTask.PercentCompleted &

"%"

Wend

wscript.echo " done."

Else

Call Handle(err,"MergeTo")

End If

Else

wscript.echo "Cannot merge virtual disk of type: " &

vhdTypes(objVD.Type)

End If

Else

Call Handle(err,"MergeTo, GetHardDisk")

End If

Else

wscript.echo "Cannot merge to a virtual disk of type: " &

wscript.arguments.named("vhdType")

End If

On Error Goto 0

End Sub

Sub Convert()

On Error Resume Next

388 Appendix C • Windows Script Files for Virtual Server 2005 R2

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 388

Page 414: Virtualization With Microsoft Virtual Server 2005 (2006)

Set objVD = objVS.GetHardDisk(wscript.arguments.named("image"))

If objVD.Type <> vmDiskType_Differencing then

If objVD.Type = vmDiskType_FixedSize then

Set objTask =

objVD.Convert(wscript.arguments.named("newimage"),vmDiskType_Dynamic)

If err.number = 0 then

wscript.stdout.write "Converting " & objVD.File & " "

While Not objTask.IsComplete

wscript.sleep 2000

wscript.stdout.write "."

Wend

wscript.echo " done."

Else

Call Handle(err,"Convert to Dynamic")

End If

End If

If objVD.Type = vmDiskType_Dynamic then

Set objTask =

objVD.Convert(wscript.arguments.named("newimage"),vmDiskType_FixedSize)

If err.number = 0 then

wscript.stdout.write "Converting " & objVD.File & " "

While Not objTask.IsComplete

wscript.sleep 2000

wscript.stdout.write "."

Wend

wscript.echo " done."

Else

Call Handle(err,"Convert to Fixed")

End If

End If

Else

wscript.echo "Cannot convert virtual disk of type: " &

vhdTypes(objVD.Type)

End If

On Error Goto 0

End Sub

Windows Script Files for Virtual Server 2005 R2 • Appendix C 389

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 389

Page 415: Virtualization With Microsoft Virtual Server 2005 (2006)

Sub create()

On Error Resume Next

Select Case Int(wscript.arguments.named("vhdType"))

'need 4 params

Case vmDiskType_Dynamic

If CheckParams(4,Array("newimage","size")) then

Set

objTask=objVS.CreateDynamicVirtualHardDisk(wscript.arguments.named("newi

mage"),wscript.arguments.named("size"))

If err.number = 0 then

wscript.stdout.write "Creating " &

wscript.arguments.named("newimage") & " "

While not objTask.IsComplete

wscript.stdout.write "."

wscript.sleep 2000

Wend

Else

Call Handle(err,"Create Dynamic")

End If

Else

wscript.echo ParamError

End If

Case vmDiskType_FixedSize

'need 4 params

If CheckParams(4,Array("newimage","size")) then

Set

objTask=objVS.CreateFixedVirtualHardDisk(wscript.arguments.named("newima

ge"),wscript.arguments.named("size"))

If err.number = 0 then

wscript.stdout.write "Creating " &

wscript.arguments.named("newimage") & " "

While not objTask.IsComplete

wscript.stdout.write "."

wscript.sleep 2000

Wend

Else

Call Handle(err,"Create Fixed Size")

390 Appendix C • Windows Script Files for Virtual Server 2005 R2

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 390

Page 416: Virtualization With Microsoft Virtual Server 2005 (2006)

End If

Else

wscript.echo ParamError

End if

Case vmDiskType_Differencing

'need 4 params

If CheckParams(4,Array("newimage","parent")) then

Set

objTask=objVS.CreateDifferencingVirtualHardDisk(wscript.arguments.named(

"newimage"),wscript.arguments.named("parent"))

If err.number = 0 then

wscript.stdout.write "Creating " &

wscript.arguments.named("newimage") & " "

While not objTask.IsComplete

wscript.stdout.write "."

wscript.sleep 2000

Wend

Else

Call Handle(err,"Create Differencing")

End If

Else

wscript.echo ParamError

End If

Case 3

If CheckParams(3,Array("newimage")) then

Call

objVS.CreateFloppyDiskImage(wscript.arguments.named("newimage"),vmFloppy

DiskImage_LowDensity)

If err.number = 0 then

wscript.echo "Created " & wscript.arguments.named

("newimage")

Else

Call Handle(err, "Create Low Density Floppy")

End If

Else

wscript.echo ParamError

End If

Windows Script Files for Virtual Server 2005 R2 • Appendix C 391

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 391

Page 417: Virtualization With Microsoft Virtual Server 2005 (2006)

Case 5

If CheckParams(3,Array("newimage")) then

Call

objVS.CreateFloppyDiskImage(wscript.arguments.named("newimage"),vmFloppy

DiskImage_HighDensity)

If err.number = 0 then

wscript.echo "Created " & wscript.arguments.named

("newimage")

Else

Call Handle(err, "Create High Density Floppy")

End If

Else

wscript.echo ParamError

End If

End Select

End Sub

Function CheckParams(minargs,arglist)

Dim Params, arg

Params = True

If wscript.arguments.count <> minargs then Params = False

For Each arg in arglist

If not wscript.arguments.named.exists(arg) then

Params = False

End If

Next

CheckParams = Params

End Function

Sub Handle(err,source)

wscript.echo "An error has occurred! in " & source

wscript.echo "Error number " & Hex(err.number) & "; " &

err.description

End Sub

]]>

392 Appendix C • Windows Script Files for Virtual Server 2005 R2

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 392

Page 418: Virtualization With Microsoft Virtual Server 2005 (2006)

</script>

</job>

</package>

Code Listing C.2 Script for Creating Virtual Disks and Running VariousOperations on Them

<?xml version="1.0" ?>

<package>

<comment>VSInfo query tool</comment>

<job>

<resource id = "strAbout">

VSInfo, version 1.0, 2006

Matthijs ten Seldam

</resource>

<runtime>

<description>

VSInfo, version 1.0, 2006

Matthijs ten Seldam

-------------------------------------------------------------------

This script queries the local Virtual Server installation for info.

It has several switches to query specific parts of Virtual Server.

See the options explanation under usage.

-------------------------------------------------------------------

</description>

<example>

Examples:

cscript vsinfo /vs --> Gives Virtual Server Configuration info.

cscript vsinfo /host --> Gives Virtual Server Host info.

cscript vsinfo /sec --> Gives Virtual Server Security info.

Windows Script Files for Virtual Server 2005 R2 • Appendix C 393

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 393

Page 419: Virtualization With Microsoft Virtual Server 2005 (2006)

cscript vsinfo /hc --> Runs Virtual Server Host check.

</example>

<named name="vs" helpstring = "Virtual Server Configuration info"

required ="false" ></named>

<named name="host" helpstring = "Virtual Server Host info" required

="false" ></named>

<named name="sec" helpstring = "Virtual Server Security info" required

="false" ></named>

<named name="hc" helpstring = "Virtual Server host check" required

="false" ></named>

</runtime>

<script language="vbscript">

<![CDATA[

Option Explicit

Dim oVS, strConfig, oHostInfo, oDriver, strPath, oSecurity, xsr,

AccessRight, oDrivers

AccessRight = Array("Allow", "Deny")

DetectScriptHost

If wscript.arguments.named.exists("hc") then

HostCheck

Else

On Error Resume Next

Set oVS = CreateObject("VirtualServer.Application")

If Err.Number <> 0 then Handle(err)

If wscript.arguments.named.exists("all") then

DisplayVSInfo

DisplayHostInfo

DisplaySecurityInfo

HostCheck

Else

If wscript.arguments.named.exists("vs") then

394 Appendix C • Windows Script Files for Virtual Server 2005 R2

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 394

Page 420: Virtualization With Microsoft Virtual Server 2005 (2006)

DisplayVSInfo

End If

If wscript.arguments.named.exists("host") then

DisplayHostInfo

End If

If wscript.arguments.named.exists("sec") then

DisplaySecurityInfo

End If

End If

End If

Sub DisplayVSInfo()

With oVS

wscript.echo "++++++++++++ Virtual Server Configuration Info

++++++++++++" & vbCrLf

wscript.echo "Name : " & .Name

wscript.echo "Version : " & .Version

wscript.echo "Product ID : " & .ProductID

wscript.echo "DefaultLocale : " &

Cstr(.DefaultLocale)

wscript.echo "VM Monitor Driver version : " &

.SupportDrivers.Item(1).Version

wscript.echo "VM Network Driver version : " &

.SupportDrivers.Item(2).Version

wscript.echo "VM Scripts enabled : " & .VMScriptsEnabled

wscript.echo "VS Scripts enabled : " & .VSScriptsEnabled

wscript.echo "VMRC enabled : " & .VMRCEnabled

wscript.echo "VMRC Encryption enabled : " &

.VMRCEncryptionEnabled

wscript.echo "VMRC Idle Timeout enabled : " &

.VMRCIdleConnectionTimeOutEnabled

wscript.echo "VMRC Idle Timeout (sec) : " &

.VMRCIdleConnectionTimeout

wscript.stdout.write "VMRC Admin address : "

If .VMRCAdminAddress = "" then

wscript.echo "Any IP address (All Unassigned)"

Else

wscript.echo .VMRCAdminAddress

Windows Script Files for Virtual Server 2005 R2 • Appendix C 395

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 395

Page 421: Virtualization With Microsoft Virtual Server 2005 (2006)

End If

wscript.echo "VMRC Admin port : " &

.VMRCAdminPortNumber

wscript.echo "Uptime (sec) : " & .Uptime

wscript.echo "Default VM Path : " &

.DefaultVMConfigurationPath

wscript.echo "Default VN Path : " &

.DefaultVNConfigurationPath

wscript.stdout.write "Search Paths : "

For Each strPath in .SearchPaths

wscript.echo strPath

wscript.stdout.write " "

Next

wscript.echo vbCrLf & "++++++++++++ Virtual Server Configuration

Info ++++++++++++" & vbCrLf

End with

End Sub

Sub DisplayHostInfo()

Set oHostInfo = oVS.HostInfo

With oHostInfo

wscript.echo "++++++++++++ Virtual Server Host Info ++++++++++++"

& vbCrLf

wscript.echo "----- OS Info -----"

wscript.echo "Host OS full name : " & .OperatingSystem

wscript.echo "Host OS major version : " & .OSMajorVersion

wscript.echo "Host OS minor version : " & .OSMinorVersion

wscript.echo "Host OS version string : " & .OSVersionString

wscript.echo "Host OS service pack : " & .OSServicePackString

&vbCrLf

wscript.echo "----- Processor(s) -----"

wscript.echo "Physical processors : " & .PhysicalProcessorCount

wscript.echo "Logical processors : " & .LogicalProcessorCount

wscript.echo "Processor version : " & .ProcessorVersionString

wscript.echo "Processor manufacturer : " &

.ProcessorManufacturerString

wscript.echo "Processor features : " &

.ProcessorFeaturesString

396 Appendix C • Windows Script Files for Virtual Server 2005 R2

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 396

Page 422: Virtualization With Microsoft Virtual Server 2005 (2006)

wscript.echo "Processor speed : " & .ProcessorSpeedString &

vbCrLf

wscript.echo "----- Memory -----"

wscript.echo "Total host memory : " & .MemoryTotalString

wscript.echo "Available host memory : " & .MemoryAvailString

&vbCrLf

wscript.echo "++++++++++++ Virtual Server Host Info ++++++++++++"

& vbCrLf

End With

End Sub

Sub DisplaySecurityInfo()

Set oSecurity = oVS.Security

With oSecurity

wscript.echo "++++++++++++ Virtual Server Security Info

++++++++++++" & vbCrLf

'wscript.echo "Group Name : " & .GroupName

'wscript.echo "Group SID : " & .GroupSID

'wscript.echo "Owner name : " & .OwnerName

'wscript.echo "Owner SID : " & .OwnerSID

For Each xsr in .AccessRights

wscript.echo

wscript.echo "Name, SID : " & xsr.Name & ", " &

xsr.SID

wscript.echo "Type : " & AccessRight(xsr.Type)

wscript.echo "Read Access : " & xsr.ReadAccess

wscript.echo "Write Access : " & xsr.WriteAccess

wscript.echo "Execute Access : " & xsr.ExecuteAccess

wscript.echo "Delete Access : " & xsr.DeleteAccess

wscript.echo "Special Access : " & xsr.SpecialAccess

wscript.echo "Read permissions : " & xsr.ReadPermissions

wscript.echo "Change permissions : " & xsr.ChangePermissions

wscript.echo "Flags : " & xsr.Flags

wscript.echo

Next

wscript.echo "++++++++++++ Virtual Server Security Info

++++++++++++" & vbCrLf

Windows Script Files for Virtual Server 2005 R2 • Appendix C 397

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 397

Page 423: Virtualization With Microsoft Virtual Server 2005 (2006)

End With

End SUb

Sub HostCheck()

Set oDrivers = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * from

Win32_BaseService")

wscript.echo "++++++++++++ Virtual Server Host Check ++++++++++++" &

vbCrLf

For Each oDriver In oDrivers

If InStr(oDriver.DisplayName, "Virtual Machine") _

or InStr(oDriver.DisplayName, "Virtual Server") then

wscript.echo "DisplayName : " & oDriver.DisplayName

wscript.echo "Name : " & oDriver.Name

wscript.echo "Type : " & oDriver.ServiceType

wscript.echo "PathName : " & oDriver.Pathname

wscript.echo "Status : " & oDriver.Status

wscript.echo "State : " & oDriver.State

wscript.echo

End If

Next

wscript.echo "++++++++++++ Virtual Server Host Check ++++++++++++" &

vbCrLf

End Sub

Sub DetectScriptHost()

Dim ScriptHost

ScriptHost = WScript.FullName

ScriptHost = Lcase(Right(ScriptHost, Len(ScriptHost) -

InStrRev(ScriptHost, "\")))

if scripthost="wscript.exe" then

wscript.echo "This script must be run using Cscript host!"

wscript.quit 1

end if

End sub

Sub Handle(err)

wscript.echo "An error has occurred!"

398 Appendix C • Windows Script Files for Virtual Server 2005 R2

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 398

Page 424: Virtualization With Microsoft Virtual Server 2005 (2006)

wscript.echo "Error number " & Hex(err.number) & "; " &

err.description

wscript.echo vbCrLf & "You could run a host check with the /hc switch

and check service status."

wscript.quit

End Sub

]]>

</script>

</job>

</package>

Windows Script Files for Virtual Server 2005 R2 • Appendix C 399

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 399

Page 425: Virtualization With Microsoft Virtual Server 2005 (2006)

406_VIRTUAL_AppC.qxd 9/11/06 2:40 PM Page 400

Page 426: Virtualization With Microsoft Virtual Server 2005 (2006)

Integrating Non-WindowsSystems with MOM2005 Using VirtualAgents

Solutions in this chapter:

■ Agentless Management of Linux and UNIXServers

■ Agent-based Management of Linux andSolaris Servers

Appendix D

401

� Summary

� Solutions Fast Track

� Frequently Asked Questions

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 401

Page 427: Virtualization With Microsoft Virtual Server 2005 (2006)

IntroductionThe degree to which you can integrate non-Windows systems into MOM 2005depends on what technique you use to manage that resource.To collect a sufficientamount of data to drive MOM’s alert system, custom providers (using the MOM 2005SDK) are needed to interact with the instrumentation exposed by the operatingsystem as well as accompanying management packs with the associated event and alertrules.Third-party software vendors have developed solutions to extend the function-ality of MOM into the non-Windows arena. In this chapter, we will look at two dif-ferent approaches to managing non-Windows resources, agentless and agent-based.

Agentless Management of Linux and UNIX ServersThe first method of managing non-Windows systems is to use Virtual Agents to col-lect state and performance data from those resources. When using Virtual Agents,there is no need to deploy any software on the managed systems. Instead, calls to thesystems to capture data or invoke an action are made using common interfaces sup-ported by the managed systems.

Overview of Virtual AgentsInfrastructure and application monitoring is shifting from an agent-based approachto an agentless one.Agentless monitoring holds the promise of cheaper and easier-to-maintain monitoring technology. Only a few technology barriers still exist thanksto emerging technologies and adoption by both operating system and applicationvendors. One company breaking those barriers by extending MOM’s managementcapabilities for heterogeneous environments is eXc Software.

eXc Software provides an extensive library of Virtual Agents that utilize acustom-developed Windows Management Instrumentation (WMI) Event Providerto deliver event and performance data to MOM. Figure D.1 shows the componentarchitecture for the eXctender WMI Event Provider. eXc Software’s WMI non-Windows Event Provider is a component DLL that runs within the WMI service.WMI is Microsoft’s implementation of a set of standards that has been established bythe Distributed Management Task Force (DMTF).Those standards make up theWeb-Based Enterprise Management (WBEM) technologies whose goal, in theory, isto unify the management of distributed computing environments and allow an ITorganization to monitor and control all the systems found within its data centers.

402 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 402

Page 428: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure D.1 The Component Architecture for the eXctender WMI EventProvider

eXc Software has taken a unique architectural approach by utilizing simple yetpowerful scripting languages to exploit the inherent capabilities of WMI.The VirtualAgents are a collection of scripts (either JScript or VBScript) that utilize COM objectsto access Linux and UNIX systems.Those objects provide the ability to establish ses-sions and communicate with the managed systems using SSH,Telnet, SNMP, or Webservices.Through the rich set of features provided by these scripts and COM objects,you can perform automation tasks on all your Linux or UNIX systems.

Virtual Agents for Linux and UNIXeXc Software has an extensive library of out-of-the-box Virtual Agents for most of thepopular Linux distribution, including Red Hat, SuSe, Mandrake, Debian, and FreeBSD.In addition, eXc Software also provides Virtual Agents for UNIX versions, such asSolaris,AIX, and HP-UX.Although each Virtual Agent is customized, or tweaked, tofunction properly with the system running that particular operating system, they all arethe same in form and function. Most of the differences in the various Virtual Agentsfor Linux and UNIX revolve around format differences from the extracted outputreturned from certain commands such as df, ps, top, and vmstat.Another difference ishow the Virtual Agent auto-discovers the system. In fact, the differences are so subtle,

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 403

DatabaseApplication

Web BrowserC/C++

Application.NET

Application

ODBCActiveXControls

Windows Management Instrumentation (WMI) COM API

MOM

SMS

CIM Repository CIM Object Manager (CIMOM)

SNMP Provider

Win32 Provider

RegistryProvider

non-WindowsProvider

SNMP Objects Win32 ObjectsRegistryObjects

Virtual AgentLogic

Data Flow

ManagedSystem

SNMP, SSH, Telnetor Web Service

COM/DCOM

COM/DCOM

ManagementInfrastructure

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 403

Page 429: Virtualization With Microsoft Virtual Server 2005 (2006)

you can easily take any of the Virtual Agents and make minor modifications to tailor itto a distribution or version not yet available from eXc.

Regardless of which Virtual Agent you are going to use, you must install the eXcSoftware’s WMI Event Provider.All of the eXc Software Virtual Agents share thissingle common base framework. Once the framework has been installed, you will beable to add any of the Virtual Agent solutions.

Anatomy of a Virtual AgentAn eXc Software Virtual Agent is a collection of files that are composed of severalscripts (both VBscript and JScript), configuration files, and text files.A Virtual Agentis installed from an MSI package and all its files are located in a single directory,commonly under the Virtual Agent Library\MOM folder where the base frameworkwas installed.Table D.1 explains each file type and its role in the Virtual Agent.

Table D.1 Virtual Agent File Type and Role

File Type or Name Role or Function

__CreateInstances.js Those files that begin with two underscores are __VirtualAgentFactory.js used to create the Virtual Agent. This invoked __Hosts.xml agent also is referred to as the Factory.__Hosts.csv__VirtualAgentJobs.wsfAll other VBS and JS files These files implement the “business logic” of the

Virtual Agent.All other XML files The XML files contain the data used by the

Virtual Agent’s business logic. This data repre-sent the tailored configuration of the VirtualAgent, including thresholds, processes that theVirtual Agent should monitor, log files to mon-itor, etc.

TXT files These files contain encrypted USERID and PASS-WORD information (optional).

Although understanding all these files and what they each do may appear com-plicated, Virtual Agents actually follow a simple workflow, as shown in Figure D.2.

The process all begins when the eXc Software WMI Event Provider is loadedafter starting the WMI service.The WMI Event Provider then starts each VirtualAgent using the following process:

404 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 404

Page 430: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure D.2 High-Level Workflow of Virtual Agent Invocation and Runtime

■ Calls the Virtual Agent’s __CreateInstances.js script.This script reads the__Hosts.xml file to identify the systems to be managed by the VirtualAgent.

■ For each host record, the __VirtualAgentFactory.js script is called.Thisscript is passed the appropriate information about each host, including theDNS host name, login information or the filename and path containing theencrypted login credentials, what port to connect with, whether to useSSH or Telnet, and whether or not to run Watchdog (a monitoring processthat is used to control CPU utilization).

■ Host information passed to the __VirtualAgentFactory.js script is popu-lated into the WMI tables, which define the host to WMI.

■ Once the WMI host object is stored, WMI will begin to execute the busi-ness logic scripts.Although the business logic scripts contain custom rou-tines for each management function, such as monitoring critical processesor collecting disk utilization statistics, common routines are shared betweeneach script rather than being loaded when each individual script is run.This is accomplished by utilizing Microsoft’s WSF environment, defined in__VirtualAgentJobs.wsf.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 405

__CreateInstances.js __Hosts.xml

__VirtualAgentFactory.js __VirtualAgentJobs.wsf

Task or Process

ContentsRead

For each Hostin __Hosts.xml

ContentsRead

Host record created in WMI tables

CommonRoutines

BusinessLogic

Invoked Host

TelnetSSHAll.js

CPUTotalsSubroutine.jsDiskUtilization.js

CriticalProcesses.js

Setup/Invocation

Runtime

Host1 – User, Passwd ,…Host 2 – User, Passwd ,…Host 3 – User, Passwd ,…Host 4 – User, Passwd ,...

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 405

Page 431: Virtualization With Microsoft Virtual Server 2005 (2006)

SNMP versus CLI-Based Virtual AgentsIt is worth noting at this point that there are two types of Virtual Agents—those thatuse SNMP for managing the non-Windows resource and those that use aCommand-Line Interface (CLI), such as SSH or Telnet, to manage resources. Eachtype of Virtual Agent is catered to a particular data set of function in the overallmanagement strategy for managing your Linux or UNIX systems.

The canned eXc Software SNMP-based Virtual Agents take advantage of thenative WMI SNMP Provider available on the MOM management server.AlthoughMIB files are not required, using them to properly interpret the SNMP message foreach OID received is recommended.

CLI-based Virtual Agents utilize an automation object that supports Telnet andSSH connections to a remote system. Using the settings configured with each hostrecord, each Virtual Agent follows a simple pattern once called from WMI via theeXc Software WMI Event Provider. Each call is passed specific parameters from theWMI tables established by the Virtual Agent factory.The typical process for eachVirtual Agent, once called, includes the following steps:

1. Connect to and log into the managed system.

2. Issue commands and get the results of the commands.

3. Log out.

4. Parse those results and process the data.

5. Create an event in WMI that will get forwarded to MOM.

By default, each of the Linux/UNIX Virtual Agents monitors and creates MOM2005 alerts for:

■ Tail’d syslog file based on user-defined search strings

■ CPU usage per process

■ Total CPU usage

■ Disk utilization

■ Process state monitoring for specific user-defined processes.This particularalert can be further configured with a correct action or response commandto run, such as to restart that particular process (see Figure D.3).

Once MOM 2005 has received the event from either an SNMP-based or CLI-based Virtual Agent, you can create specific event and alert rules to meet your moni-toring and management needs for your environment. eXc Software does not providea management pack for each Virtual Agent; instead, they have a general eXc non-

406 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 406

Page 432: Virtualization With Microsoft Virtual Server 2005 (2006)

Windows Systems management pack that contains generic rules to monitor anyevents that are raised through the WMI framework by any installed Virtual Agent.

Figure D.3 Example of MOM 2005 Alert Generated from Red Hat VirtualAgent

eXc Software provides three basic reports along with the general managementpack.The report provides an analysis of events and alerts from the WMI non-Windows Event Provider as well as a view into performance statistics captured andforwarded to MOM 2005 from the Virtual Agents, if any.

BEST PRACTICES ACCORDING TO MICROSOFT

■ eXc Software provides simple-to-use SNMP interfaces that saveyou from having to manually configure each of your SNMP-enabled Linux or UNIX servers into WMI. This is because each ofthe objects takes care of the SNMP to WMI work for you.

■ Incorporate your SNMP requirements into the eXc SoftwareVirtual Agent technology by providing MIB information to theSNMP COM object.

■ To make an even more effective management solution, though,you can combine the Telnet/SSH capabilities of CLI-based VirtualAgents with the handling of SNMP data to and from your Linuxor UNIX systems. Combined, these features give you unlimitedmonitoring and automation capabilities to seamlessly integrateyour non-Windows systems into MOM.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 407

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 407

Page 433: Virtualization With Microsoft Virtual Server 2005 (2006)

Managing a Linux/UNIX System with Virtual AgentsIn the following section, we will walk through the installation steps for a newdeployment of the eXc Software non-Windows Provider and the Virtual Agent forRed Hat as well as the basic configuration of the Virtual Agent.These steps shouldquickly get you managing your Red Hat systems with MOM 2005.

To make the installation as smooth as possible, we will assume that all eXcSoftware components are being installed on a single management server in an “all-in-one” fashion. Before beginning the installation of any eXc Software components, allsoftware requirements must be satisfied.Table D.2 shows what components need to beinstalled for a base install of Windows 2000 Server and Windows 2003 Server. If youare missing any requirements, a pop-up will be displayed stating so during the softwareinstallation process.Also, if you have any previous versions (prior to September 2005)of eXc Software’s components, you must uninstall those before proceeding.

Table D.2 Software Requirements for Microsoft Windows 2000 Server andWindows Server 2003

Windows Server Version Requirement

Windows 2000 Server Microsoft .NET Framework 1.1Windows Script Host 5.6Microsoft Access 2000 or later* Connection Manager Components* Network Monitor Tools* Simple Network Management ProtocolWindows Management InstrumentationSNMP ProviderMicrosoft MSXML 2.0 or laterInternet Explorer 6.0 or later

Windows Server 2003 Microsoft Access 2000 or later* Network Monitor Tools* Simple Network Management Protocol* WMI SNMP Provider* WMI Windows Installer ProviderWindows MSXML 4.0 or later

Note: “*” denotes that the component is installed through the Add/RemoveWindows Components section of the Add/Remove Programs control panelapplet.

408 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 408

Page 434: Virtualization With Microsoft Virtual Server 2005 (2006)

Once the prerequisites are installed, you can perform the basic installation stepsas follows:

1. Download the eXc Software Base Framework (or WMI non-WindowsEvent Provider) and the Red Hat Virtual Agent fromwww.excsoftware.com.

2. Install the eXc Software WMI non-Windows Event Provider using theeXc_nonWindows_WMI_Provider.msi Windows Installer package.

3. Select the installation folder. If you change the installation path from thedefault folder, you will have to make further modifications after the installa-tion.You must select Everyone or you will not be able to launch any ofthe Virtual Agents you install (see Figure D.4).

Figure D.4 eXc Software WMI non-Windows Event Provider Install Wizard

4. Install the Red Hat Virtual Agent that you downloaded using theeXc_MOM_Linux_RedHat_Virtual_Agent.msi Windows Installer package.Remember that if you changed the default install path for the event provider,you’ll need to adjust the path for the Virtual Agent install folder as well.Youmust select Everyone, just as you did with the event provider install.

Importing the eXc Software Management Pack and ReportsOnce all the components have been installed, you must integrate eXc Software’sEvent Provider with MOM 2005 as well as configure the Red Hat Virtual Agent.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 409

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 409

Page 435: Virtualization With Microsoft Virtual Server 2005 (2006)

Carefully perform the following post-installation steps, being sure not to skip anystep to ensure proper configuration of your Virtual Agent.

1. Using the MOM 2005 Administrator Console, highlight ManagementPacks then right-click and select Import/Export Management Pack tolaunch the Management Pack Import/Export Wizard.

2. On the Welcome page, click Next.

3. Select Import Management Packs and/or reports and click Next.

4. Set the appropriate directory path where you installed the WMI non-Windows Provider for MOM. By default this path is c:\Program Files\eXcSoftware\WMI Provider\nonWindows\MOM\.

5. Select Import Management Packs only and click Next.

6. Select the Management Pack for MOM 2005. Be sure to select the AKMfile for MOM 2005.

7. Since this is a new deployment of the Management Pack, select Replaceexisting Management Pack and uncheck Backup existingManagement Pack under Import Options (see Figure D.5). Click Next.

Figure D.5 Management Pack Import Wizard and eXc Software AKM Files

8. Click Finish to begin the import process and monitor the import status.Once the import process is complete, close the import window.

9. From the Select a Folder and Choose Import Type page, set the folder pathto the ..\nonWindows\MOM\Reports folder.

410 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 410

Page 436: Virtualization With Microsoft Virtual Server 2005 (2006)

10. Select the Import Management Packs and/or reports radio buttonand click Next.

11. Select Import reports only and click Next.

12. Select the eXc Software non-Windows Reporst.xml file to import.

13. Uncheck Always warn me about insecure connections (see Figure D.6).

Figure D.6 Importing the eXc Software Report Definition

14. Click Next to begin the import process and monitor the import status.

15. Once successfully imported, close the import status window.

Configuring the Non-Windows Computer Group and ProviderNow that the Management Pack and Reports for eXc Software have been success-fully imported, we need to configure them.You must perform the following basicsteps to configure the computer group and provider created by the eXc Softwaremanagement pack.

1. From the MOM 2005 Administrator Console, expand ManagementPacks and Computer Groups.

2. Highlight eXc nonWindows Systems, then right-click and selectProperties.

3. Click the Search for Computers tab.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 411

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 411

Page 437: Virtualization With Microsoft Virtual Server 2005 (2006)

4. Select Do not search for computers and click Apply (see Figure D.7).

Figure D.7 Search Configuration for eXc Non-Windows Systems ComputerGroup

5. Click the Included Computers tab.

6. Click Add to open the Add Computer window.

7. Expand the domain where the MOM 2005 management server with theeXc Software components resides.

8. Click on the name of the management server and then click OK.

9. You should see the MOM management server now listed on the IncludedComputers tab. Click Apply then click OK (see Figure D.8).

Figure D.8 Configuring Management Server as eXc Single Point of Reference

412 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 412

Page 438: Virtualization With Microsoft Virtual Server 2005 (2006)

10. On the left pane of the MOM 2005 Administrator Console, expandManagement Packs and click Providers.

11. Locate the WMI Events provider named eXc_nonWindows_WMI_Provider inthe right pane.

12. Double-click eXc_nonWindows_WMI_Provider to open the Propertieswindow.

13. Be sure that Namespace is set to \\.\root\cimv2. Click OK.

Configuring the Non-Windows TasksIf you changed the default installation path for the eXc Software provider, you mustalter the path reflected in the tasks created by the eXc Software management pack asexplained in the following steps. If you did not change the installation folder fromthe default path, you do not need to complete these steps.

1. On the left pane of the MOM 2005 Administrator Console, expand Tasksand highlight eXc non-Windows Systems.

2. On the right-pane, double-click Issue nonWindows Command to openthe Properties window.

3. Click the Details tab.

4. Adjust the Task command line and Start in parameters to reflect the cor-rect drive and folder path (see Figure D.9).

Figure D.9 Adjusting Parameters for Issue Non-Windows Command Task

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 413

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 413

Page 439: Virtualization With Microsoft Virtual Server 2005 (2006)

5. Click OK.

6. On the right pane, double-click SSH to open the Properties window.

7. Click the Details tab.

8. Adjust the Task command line to reflect the correct drive and folder path(see Figure D.10). By default, this path points to the PuTTY SSH clientincluded with the eXc Software installation. If you prefer, you can installanother SSH client and reference the path to its executable here instead.

Figure D.10 Adjusting Parameters for SSH Task

Configuring SecurityThe eXc Software components rely on execution of responses on the managementserver where you installed the software. However, by default, MOM 2005 does notallow custom responses to be executed on management servers, only on manage-ment agents.You must adjust the global security settings for MOM 2005 to allowthe framework components to function properly on the management server.Thefollowing steps demonstrate the changes to the global settings needed.

1. On the left pane of the MOM 2005 Administrator Console, expandAdministration and highlight Global Settings.

2. Double-click Security in the right pane.

3. Uncheck Disable execution of custom responses on ManagementServers (see Figure D.11).

414 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 414

Page 440: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure D.11 Enabling Custom Responses on Management Servers

4. Click OK.

Completing the InstallationTo complete the configuration, you must commit the changes that you have made inthe previous steps.To accomplish this:

1. Right-click on Management Packs in the left pane.

2. Select Commit Configuration Change.

3. Close the pop-up message.

4. Close the MOM 2005 Administrator Console.

Configuring the Virtual AgentAt this point, the MOM 2005 integration is complete and the eXc Software baseframework has been configured.The next step is to configure the Red Hat VirtualAgent using the eXc Software Configuration Tool/GUI.The following steps outlinethe tasks that must be performed to configure the basic functionality of the Red HatVirtual Agent.

1. Run the eXc Software Configuration Tool/GUI. It can be launched fromStart \Programs\eXc Software\WMI Providers\nonWindows\Configuration Tool.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 415

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 415

Page 441: Virtualization With Microsoft Virtual Server 2005 (2006)

2. Expand System Center and MOM.You’ll see the LinuxRedHat VirtualAgent listed (along with any other Virtual Agents that may have beeninstalled as well).

3. Expand and highlight LinuxRedHat.You will find four sample targets onthe right pane already listed, denoted with the naming convention#LinuxRedHat (see Figure D.12).

Figure D.12 Initial Settings for the Red Hat Virtual Agent

4. Select the __Hosts tab.

5. Check the checkbox in the Clone/Remove column for the last threesamples and click Remove.

6. In the remaining row, enter the host name (not the FQDN) in the DNSName column.

7. Enter the login credentials the Virtual Agent should use.You can leave thedefault values for the Login Prompt and Password Prompt.Those valueare to assist the TelnetAutomation object (discussed later) in recognizing thelines with login and password prompts. If you are concerned about havingthis information display in clear text, you can also browse to and select anencrypted text file with that information.

8. Enter the port the Virtual Agent should use to connect Red Hat systemand whether the connection should be secure or not.These settings willdepend on whether the Virtual Agent will use Telnet (Port set to 23 andSecure Connection unchecked) or SSH (Port set to 22 and SecureConnection checked).

416 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 416

Page 442: Virtualization With Microsoft Virtual Server 2005 (2006)

9. Leave the remaining columns with their default values.

10. Click Save.

11. Test the configuration by right-clicking the Host and selecting TestConnection (see Figure D.13).

Figure D.13 Results from a Successful Connection Test

12. Select the CriticalProcesses tab.

13. By default there are two sample processes to monitor. Modify the ProcessName, Display Name, and Restart Command columns to reflect theprocesses that you want to monitor (see Figure D.14).

14. Click Save.

Figure D.14 Setting up Critical Processes with Corrective Action

15. The next two tabs are used to configure syslog monitoring on the Red Hatsystem. Click the Logs tab.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 417

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 417

Page 443: Virtualization With Microsoft Virtual Server 2005 (2006)

16. Modify the File Name path, if necessary, to reflect the correct path of thesyslog file. By default, the Red Hat syslog is located at /var/log/messages.

17. Click Save.

18. Click the syslog tab.

19. Configure the syslog alerting parameters.The primary field is Log mes-sage to trigger on. When the string that you enter here is encountered inthe syslog, an alert will be generated in MOM 2005 at the Severity levelyou set here as long as the Generate Alert field is checked and the row isnot disabled (see Figure D.15).Additionally, you can run a particular com-mand on the Red Hat system when the alert is generated.

20. Click Save.

Figure D.15 Alert Configuration for SYSLOG

21. Click the Threshold Values tab.

22. Set the value for each utilization performance counter listed. When thethreshold is passed, an alert will be generated in MOM.

23. Click Save.

24. Click on the __VirtualAgentJobs tab.

25. This tab shows all the jobs that are run by the VirtualAgent, includingwhich scripts are executed with each job.The jobs that you may want tocustomize are ALL and LOGS. By default, they are both set to run every600 seconds, or every 10 minutes.Adjust this value to suit your monitoringneeds. In addition, you can define whether the script’s window is hidden,

418 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 418

Page 444: Virtualization With Microsoft Virtual Server 2005 (2006)

minimized, maximized, or displayed in a normal size each time the scriptsrun (see Figure D.16).

Figure D.16 Job Definition for Virtual Agents

26. Click Save.

With all the components now fully installed and the configuration complete, youmust reload the Windows Management Instrumentation and restart MOM 2005 onthe management server. Simply use the Services administrative tools and restart theWMI and MOM services.The eXc Software is ready to start monitoring your RedHat system.To begin the monitoring processes, use the eXc Software ConfigurationTool, expand the left pane until you see your Red Hat system’s name, and thenright-click on it and select Start.The icon next to the name should turn green indi-cating that the Virtual Agent is now monitoring that system. Several jobs will alsobegin to run in command shell windows once the Virtual Agent starts up.

Customizing the Virtual AgentGetting more out of the Virtual Agents or creating your own Virtual Agent is notdifficult if you have a good understanding of COM objects and one of the manyscripting languages supported by Microsoft’s operating systems. Once you decidewhether you want to use SNMP or CLI commands to manage your non-Windowssystem, you can get started with the many samples and templates that eXc Softwareprovides in the product and on their Web site.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 419

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 419

Page 445: Virtualization With Microsoft Virtual Server 2005 (2006)

SNMP-Based Virtual Agent CustomizationSNMP-based Virtual Agents are composed of a suite of objects that handle standardSNMP Get and Set commands to the managed system, all the SNMP to WMI pro-cessing including MIB parsing, and creating SNMP traps and forwarding them on tothe configured trap destination or network management system.Those objects arelisted in Table D.3.

Table D.3 eXc Software SNMP COM Objects

COM Objects ProgID and Description Members

TrapCatcher TrapCatcher.TrapCatcherInterface InitializeThis COM object receives SNMP V1 GetTrap2and V2 Traps.

TrapThrower TrapThrower.TrapThrowerInterface InitializeThis COM object throws SNMP V1 Add SNMPFieldand V2 Traps. toTrap

ThrowSNMPTrap2GetterSetter SNMPGetterSetter. Initialize

SNMPGetterSetterInterf GetThis COM object gets and sets SetSNMP OIDs from an SNMP-capable device.

CollectionObject CollectionObject. InsertTheCollectionObject ClearThis COM object is a container Item(collection) of SNMPFieldItem Countobjects (SNMP OIDs). Remove

SNMPFieldItem SNMPFieldItem. SNMPNameSNMPFieldItemInterface SNMPOIDThis COM object exposes properties SNMPTypeof an SNMP OID. SNMPValue

Your SNMP Virtual Agent can interact with MOM 2005 just like any otherVirtual Agent.You can call the WMI Event Provider for non-Windows SendEventmethod (SendEvent gets wrapped by the Virtual Agent common library routineThrowAlert) to have the SNMP data processed by MOM and perform a response,such as generating an alert, sending a notification via e-mail or pager, or run a pro-gram.You can also invoke the methods in the MOM WMI classes included with theMOM 2005 SDK, such as the MSFT_Computer_Class.

420 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 420

Page 446: Virtualization With Microsoft Virtual Server 2005 (2006)

The following example includes a script that catches SNMP traps and uses theeXc Software SNMP COM object TrapCatcher. In this example, the TrapCatcherobject is passed the MIB for Intel network adapters, which is passed to theTrapCatcher object.The script runs in an infinite loop, waiting for a trap to bereceived. Once one is picked up, the script writes out the name and value of foreach property exposed by the MIB.

Code Sample of SNMP TrapCatcher Object

var l_strReadSNMP = "public";

var l_strMibDir = "C:\\ mibs";

var l_strMib = "intelnic";

var strName_in = "Server01";

var l_objTrapCatcher = newActiveXObject("TrapCatcher.trapCatcherInterface");

l_objTrapCatcher.Initialize(strName_in, l_strReadSNMP, l_strMibDir,l_strMib);

for (i=0;i>-1;i++)

{

WScript.Echo("Collecting SNMP Traps for " + strName_in + "; counter=" +i);

var l_objTrap = l_objTrapCatcher.GetTrap();

if ("undefined" != typeof l_objTrap)

{

var l_Enumerator = new Enumerator(l_objTrap);

var l_intPropertyCounter = 0;

for (;!l_Enumerator.atEnd();l_Enumerator.moveNext())

{

var l_objSNMPField = l_Enumerator.item();

var l_strName = l_objSNMPField.SNMPName;

var l_strOID = l_objSNMPField.SNMPOID;

var l_strType = l_objSNMPField.SNMPType;

var l_strValue = l_objSNMPField.SNMPValue;

WScript.Echo(l_strOID + "(" + l_strName + ") = " +

l_strValue + " of type " + l_strType;

}

l_Enumerator = null;

}

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 421

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 421

Page 447: Virtualization With Microsoft Virtual Server 2005 (2006)

CLI-Based Virtual Agent CustomizationTo work with your Linux or UNIX systems using CLI protocols, such as Telnet andSSH, you instantiate a COM object provided by eXc Software object within yourown script code.This object, called the TelnetAutomation object, provides a group ofmethods and properties to connect to a managed device or system, login and logoff,key commands, collect the results, and check connection and command status, aslisted in Table D.4.

Table D.4 List of the APIs for the TelnetAutomation Interface

Members Description

AutoStart This method will call methodsPopulateProperties, connect, and login for you.

Clear This method will clear the screen buffer. Notethat any bookmarks you have will becomeinvalid.

Connect This method is used to establish the Telnet orSSH connection to the host specified in prop-erty stringHostName.

connectCheck This method will check if a Telnet or SSH con-nection to the host specified in propertystringHostName can be made. This method isused by the Auto-discovery utility but could beused by any program.

getDataBufferLength This method returns the current number oflines in the data buffer.

getData This method will return lines of data from thetelnet or SSH session screen buffer, starting atline longFrom_in to the current last line of theTelnet or SSH session. The Telnet or SSH screenbuffer is converted into one big string startingat longFrom_in to the bottom.

getDataAsSafeArray This method will return lines of data from theTelnet or SSH session screen buffer, starting atline longFrom_in to the current last line of theTelnet session in the form of an unmanagedsafe-array.

422 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

Continued

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 422

Page 448: Virtualization With Microsoft Virtual Server 2005 (2006)

Table D.4 continued List of the APIs for the TelnetAutomation Interface

Members Description

getOneLineOfData This method will return one line of data fromthe Telnet or SSH session screen buffer at theline specified by longFrom_in. If longFrom_in isgreater than the last current line, thengetOneLineOfData will wait forlongWaitTimeInMilliseconds_in millisecondsand then return back to the caller with a zerolength string. This method is particularly usefulif, for example, the caller is “tailing” on a fileand the caller does not know when the nextline will be displayed.

Key This method will send keystrokes to the Telnetor SSH session. You do not need to specify acarriage return as the key method will do it foryou automatically.

Login This method will login to the Telnet or SSHconnection of the host specified in propertystringHostName Be sure that you have 1) setthe stringUserName property, 2) set thestringPassword property, 3) have successfullycalled the connect method before you call thelogin method.

Logout This method will logout of the Telnet or SSHconnection of the host specified in propertystringHostName. You should have alreadycalled method login before you call the logoffmethod.

PopulateProperties This method will populate the following prop-erties: stringHostName, stringLoginPrompt,stringUserName, stringPasswordPrompt,stringPassword, stringHostPort,boolSecureConnection, and boolIsPingablefrom the WMI Event Provider for non-Windows.

respondTo This method will reply to an input prompt bylooking for the string stringRequestString_infrom the telnet or SSH session starting at linelongFrom_in and when it is found, it will key inthe string stringReplyString_in. This methodwill look for the string stringRequestString_in

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 423

Continued

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 423

Page 449: Virtualization With Microsoft Virtual Server 2005 (2006)

Table D.4 continued List of the APIs for the TelnetAutomation Interface

Members Description

for longWaitTimeInMilliseconds_in millisecondsand if does not find stringstringRequestString_in withinlongWaitTimeInMilliseconds_in milliseconds, itwill return an error to the caller.

boolArePropertiesPopulated This flag indicates whether the WMI EventProvider for non-Windows populated the prop-erties successfully or not.

boolIsConnectedToHost This flag indicates whether you are connectedto the host. This field should be checked afteryou issue the connect method.

boolIsLoggedInToHost This flag indicates whether you are logged into the Telnet host. This field should be checkedafter you issue the login method.

boolIsPingable This flag indicates whether you want theTelnetAutomation object to perform a ping testbefore it attempts to login.

boolSecureConnection This flag indicates whether you are connectedto the host via Telnet (value is false) or SSH(value is true).

boolWaitForKeyCommand This flag indicates whether the key commands ToComplete will wait for all of the output to be

displayed/collected (which is indicated by thelast displayed/collected output line being thecommand prompt) before returning controlback to the caller.

stringCommandPrompt This method will get or set the current com-mand prompt. Note that by default, the loginprocess will initially set this property for you.

stringHostName The DNS Host Name or IP Address of the non-Windows system the Telnet or SSH session willconnect to.

stringHostPort The port the Telnet or SSH session will connectto.

stringLoginPrompt The login prompt string of the Telnet or SSHsession.

424 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

Continued

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 424

Page 450: Virtualization With Microsoft Virtual Server 2005 (2006)

Table D.4 continued List of the APIs for the TelnetAutomation Interface

Members Description

stringPassword The password used to login to the Telnet orSSH session of the non-Windows system ordevice. For security reasons, you can encryptthe password into a file and then set thestringPassword as the name of the file prefixedby “file:”.

stringPasswordPrompt The password prompt string of the Telnet orSSH session.

stringTerminalType This field allows you to negotiate a terminaltype with the Telnet server. The default isvt100. If you are working with an older Telnetserver, specify a zero length string. Doing sowill force the TelnetAutomation object tobypass terminal type negotiation.

stringUserName The username used to login to the Telnet orSSH session of the non-Windows system ordevice. For security reasons, you can encryptthe username into a file and then set thestringUserName as the name of the file pre-fixed by “file:”.

You can create custom scripts or Virtual Agents to monitor Linux and UNIX sys-tems with the eXc Software CLI-based COM objects by following a basic pattern:

■ Connect and login to the host

■ Execute a command on the remote host and grab the results

■ Process the results

■ Create WMI event to be processed by MOM 2005

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 425

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 425

Page 451: Virtualization With Microsoft Virtual Server 2005 (2006)

Shortcuts…

Tweaking the Virtual Agent with Your Own CodeWithin the __VirtualAgentFactory.js script you can modify which business logicscripts (i.e., Virtual Agents) get associated with the WMI host object. By editing__VirtualAgentFactory.js and __VirtualAgentJobs.wsf, you can implement yourcustom Virtual Agent code and make calls using CLI or SNMP protocols.

In the WSF file, you can add additional scripts to the ALL job to be run withall the other scripts at the set interval. For example, if you had a script to mon-itor I/O rate of a particular fiber-channel HBA named FCHBAUtilization.js, youwould add the following in the job with the ID of ALL:

<script language="JScript" src="../../FCHBAUtilization.js">

</script>

Each time the Virtual Agent runs the job ALL, the FCHBAUtilization scriptwill run along with the CPU and Disk utilization scripts, among others.

On the other hand, if you have created your own complete SNMP or CLI-based Virtual Agent and want to perform specific processing outside of thedefault processing, call your custom Virtual Agent from inside__VirtualAgentFactory.js.

For more detailed information regarding customizing your eXc Softwaresolution, go to www.excsoftware.com.

Although the APIs provide a wide range of things you can do programmaticallyto handle just about every automatable condition on your Linux and UNIX servers,the pattern stated earlier will be used in just about all your custom scripts.The fol-lowing code demonstrates some of the basic routines that you will need to perform.

The very first step is to instantiate the TelnetAutomation object so you can callthe methods needed to communicate with the remote managed system. Here is anexample of how to instantiate the TelnetAutomation object:

var g_objTelnetAutomation = newActiveXObject("NamespaceTelnetAutomation.ClassTelnetAutomation");

var g_objWMI = null;

Once you have instantiated the object, you are ready to start calling its methods,such as Autostart. Remember that Autostart is an efficient way to populate the nec-essary properties with the values for the host (read from the __Hosts.csv file),connect, and login.

426 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 426

Page 452: Virtualization With Microsoft Virtual Server 2005 (2006)

var l_objArgs = WScript.Arguments;

g_objTelnetAutomation.AutoStart(l_objArgs(0), WScript.FullName, true, true);

g_objWMIInstance = GetObject("winmgmts://./root/cimv2:" +

eXc_nonWindows_OperatingSystem.Name='" + l_objArguments(0) + "'");

Once you have successfully connected and logged in to the host (via AutoStart),you will be able to start passing commands and capturing the results.The followingis an example of using the TelnetAutomation object to invoke a command and grabthe results.

var l_ulongCommandLine1 = g_objTelnetAutomation.key("df -h");

var l_stringData1 = g_objTelnetAutomation.getData(l_ulongCommandLine1);

With the command’s output in a standard string variable, you can parse orextract the data and apply business logic to process the results.The end goal is tocreate WMI events that will get forwarded to MOM 2005 so they can be processedby event rules that you have created in your custom management packs.

var l_objArgs = WScript.Arguments;

var l_Date = new Date();

l_strAction = "ADD";

l_strUUID = "0";

l_strSeverity = "3";

l_strSource =l_objArgs(0);

l_strGeneratedBy = "eXc Virtual Agent " + WScript.ScriptFullName;

l_strTarget_Type = "nonWindows";

l_strStart_Date_Time = l_Date.toUTCString();

l_strState = "NEW";

l_strAssigned_To = "UNIX Administrators";

l_strLast_Update = "";

l_strETA = "";

l_strDescr = l_stringData1;

l_strNotes = "";

g_objWMI.SendEvent(l_strAction, l_strUUID, l_strSev, l_strSrc,

l_strGeneratedBy, l_strTarget_Type, l_strStart_Date_Time, l_strState,

l_strAssigned_To, l_strLast_Update, l_strETA, l_strDescr, l_strNotes);

Figure D.17 shows the CLI interaction with a Linux host.The Virtual Agentcalls the business logic routines in intervals previously established, and the variousbusiness logic scripts run inside one or more command shell windows. In this partic-ular example, the vmstat 1 5 command is being run to gather performance counter

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 427

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 427

Page 453: Virtualization With Microsoft Virtual Server 2005 (2006)

statistics, df is run to gather disk usage statistics, and ps –ef | grep ‘ntpd’ is beingrun to determine if a critical process is currently running or not.The output, orresults, is being stored in string variables for additional processing later.

Figure D.17 CLI Commands Being Run against Linux Host

The eXc Software non-Windows Event Provider and base framework delivers ahighly extensible way to monitor your Linux and UNIX systems. Using a smart col-lection of COM objects that support both SNMP and CLI-based interaction withnon-Windows systems, you can easily provide advanced management and integrationwith MOM 2005.

SOME INDEPENDENT ADVICE

If you are planning on establishing a framework for managing your non-Windows operating systems, you can get an even higher return on yourinvestment by managing your hardware and applications, even forWindows systems.

eXc Software offers Virtual Agents for popular hardware manage-ment platforms, such as Dell Open Manage, HP Insight Manager, andIBM Director. You can also monitor IBM eServer BladeCenters directlythrough the management module components of the BladeCenterchassis. eXc Software can also manage popular applications such as BEAWeblogic, IBM Websphere, Oracle, Lotus Domino, Blackberry EnterpriseServer, and the Citrix product line, among many others.

428 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 428

Page 454: Virtualization With Microsoft Virtual Server 2005 (2006)

Finally complete your management portfolio for MOM with VirtualAgents for storage arrays, such as those from EMC, Hitachi, and HPStorageWorks as well as devices from McData, QLogic, and Brocade.

Of course, eXc’s extensible Virtual Agent architecture allows you tocreate Virtual Agents to manage just about anything you have in yourinfrastructure that supports Telnet/SSH with a little custom development.

Agent-Based Management of Linux and UNIX ServersAnother method to manage non-Windows systems is to use an alternate networkmanagement system that can feed data into MOM.These types of network manage-ment systems, or NMS, employ agents that reside on each managed system to pro-vide advanced data collection and perform responsive actions on the host systems. Inthis section, we will take a look at an NMS that is dependent on MOM for datastorage and further intelligence in its management strategy.

The Jalasoft Xian 2005 Network Manager Server is a comprehensive systemsmanagement solution set designed to extend the knowledge-based monitoring andmanagement capabilities of Microsoft Operations Manager to the other critical com-ponents of your computing infrastructure.Although this NMS can be used tomanage many different types of systems, network devices, and other infrastructurecomponents, we will be focusing on its ability to manage Linux and UNIX systemsand how it integrates with MOM 2005.

Overview of Xian 2005 Network ManagerNMS solutions like the Xian 2005 Network Manager are not just MOM manage-ment packs or add-ons.The unique combination of MOM with Xian allows you tomanage your non-Windows infrastructure components from the MOMManagement Console. Xian is a complete management system that takes advantageof the Microsoft Connector Framework (MCF) to communicate with and providefeedback to MOM 2005.

Xian 2005 Network Manager is comprised of several components that caneither be colocated on a single server, such as a MOM 2005 management server, ordistributed across various systems to increased scalability and performance.Thosecomponents are:

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 429

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 429

Page 455: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Xian Network Manager Server (NMS) The Xian Network ManagerServer is a Windows service that can monitor systems using the SNMPprotocol or using the Xian Agent. SNMP access is provided and will sup-port every derivative of the Linux and UNIX operating system base; how-ever, agents are currently available only for Solaris and Linux distributionsthat support RPM packages. For each supported device type, a specificXian plug-in, also referred to as a Smart Management Pack, is required. Forexample, to monitor a Solaris server, the Xian plug-in for Solaris isrequired.These plug-ins include a set of rules specifically designed to mon-itor the network device.

■ Xian Database The Xian Database stores all persistent informationrequired by the application, that is, information related to plug-ins, ruletemplates, monitored devices, active rules, alerts, counters and more.

■ Xian Data Server The Xian Data Server is a Windows service that maybe installed on a computer with all other Xian components, or on a dif-ferent computer as needed. It is used to provide read/write access to theXian Database requested by the Xian Network Manager Server, XianNetwork Scan Server, Xian Web Service, and the Xian Console.

■ Xian Connector for MOM 2005 The Xian Connector for MicrosoftOperations Manager 2005 is a Windows service created to allow the migra-tion of information about monitored devices from the Xian Data Server tothe MOM 2005 Connector Framework. Data that is migrated includes thealerts and performance data generated in Xian rules.

■ Xian Network Scan Server (NSS) The Xian Network Scan Server(NSS) may be installed on a computer with all other Xian components, oron a different computer as needed, and usually no more than one instanceof this component is required for most environments.

■ Xian Web Service The Xian Web Service provides connection between aXian Data Server and one or more Jalasoft Xian Consoles using HTTP pro-tocol, default port 80. It exposes a standards-based mechanism that providesconnectivity between the Xian Console (web service consumer) and theXian Data Server. No credential is required to access to this description file.

■ Jalasoft Smart Management Packs (SMP) The Jalasoft SmartManagement Packs (SMPs) are provided as AKM files in the Xian NetworkManager distribution folder and must be installed before any other Xiancomponent. Each SMP is individually licensed as are the devices managedby the SMP.

430 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 430

Page 456: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Xian License Manager The Xian License Manager allows the user toadd all required licenses to be used.

■ Xian Console The Xian Console serves as the heart of the NetworkManager.The Xian Console is a fully locatable user interface used tomanage all rules being executed by the Xian Network Manager Server, sys-tems being monitored, systems found with the Xian Network Scan Server,policy templates, licenses, and more.

All information generated by Xian active rules about monitored systems, itsalerts, and performance data are sent to the Xian Connector for MicrosoftOperations Manager 2005.The Xian Connector sends that information to theMicrosoft Connector Framework (MFC 2005) and to the Data Access Server (DAS),then finally the information is available in the MOM Operator Console through theJalasoft’s SMPs.The Xian Console relies on the Xian Data Server to provide accessto data in the Xian Database.

Several Xian Consoles may be connected to a single Xian Data Service using theTCP protocol, default port 8181, or to a single Xian Web Service using the HTTPprotocol, default port 80. When the Xian Console is using the HTTP protocol, itbecomes a consumer of the web service provided by the Xian Web Service component.The Xian Console is used to easily manage the following elements inside the Xianenvironment:

■ Devices

■ Active Rules

■ Policy Templates

■ Alerts

■ Licenses

Figure D.18 shows a sample of Xian Network Manager console.As shown, theXian NMS is capable of monitoring and managing a wide variety of resources. Forour purposes, though, we will be focusing on the Smart Agents, rules, and policytemplates for Linux and Solaris.

Single Machine versus Advanced InstallationDuring the installation process, you will be prompted to select between two installa-tion types. Once is a single-machine installation, where all the Xian server-side com-ponents will be installed on a single server.The other is an advanced installation,where you can choose more advanced setup options, including the distribution ofthe Xian components across various machines.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 431

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 431

Page 457: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure D.18 Xian Console with Focus on Linux Management

Before you can choose which installation type is right for you and your environ-ment, you will need to understand the limitations of Xian Network Manager.Thoselimitations are outlined in Table D.5.

Table D.5 Sizing Limitations for Xian Network Manager

Xian Component Limitation

Xian Network Manager Server A single installation without any other (NMS) components installed on the same server can

monitor up to 50 devices/systems. Installedwith another component, the NMS should becalculated to support only 30 devices/sys-tems.

Xian Data Server A single installation without any other (DS) components, the DS can support up to 5

NMSes. This means that it can support atmost 250 devices/systems. To scale beyond 5NMSes, you will need to deploy additionalDSes.

Xian Network Scan Server This component requires a high amount of (NSS) network traffic to discover manageable

resources. As a result, if it is installed on thesame server as any other component, it mayreduce that component’s total capacity, as isthe case with the Xian NMS and DS.

432 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

Continued

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 432

Page 458: Virtualization With Microsoft Virtual Server 2005 (2006)

Table D.5 Sizing Limitations for Xian Network Manager

Xian Component Limitation

Xian Web Service This component may be installed on anothersystem. Since it requires IIS 6.0 with ASP.NETenabled, there may be a conflict with yourorganization’s security policy and runningsome of the other Xian components on thesame servers as IIS.

Select the Advanced setup type to:

■ Install one or more Xian components in the local machine

■ Customize the configuration of the components to be installed.

There are some factors that you must consider, such as component placement,compatibility, and security, when planning for your Xian Network Manager installa-tion; however, the product is robust and capable of sustaining a high load.This setuptype is intended for fine tuning and for distributed deployments of Xian compo-nents in medium and large environments. Distributed environments provide Xianwith a high scalability in its monitoring capabilities, every Xian Network ManagerServer (NMS) installed in a dedicated machine is able to monitor up to 50 networkdevices; the Xian Data Server installed in a dedicated machine is able to support upto 5 NMSes.

However, you will have to decide if you are going to install all the components,except for the database, on the same server (easiest and most simple deployment) orif you’re going to distribute the components with the advanced setup. Figure D.19shows an example of a scalable and common distributed installation. Notice that thisconfiguration is capable of supporting 130 managed systems.To support additionalsystems, you would add other Xian NMSes and possibly another DS, if needed.

Select the Single Machine setup type to install all Xian components on a localmachine, and to optionally install the Xian database on a different computer.Thissetup type is intended for small environments or testing purposes.The SingleMachine setup type installation includes the Xian Network Scan feature, which scansa network segment for supported network devices and adds them to the Xian envi-ronment. If the user selects the Xian Network Scan feature to be used in the instal-lation process, the installer will ask the user for a network segment, a list of validSNMP community strings, and a valid basic license.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 433

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 433

Page 459: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure D.19 Example of a Scalable and Common Distributed Installation

SOME INDEPENDENT ADVICE

Special attention always should be paid to licensing when deploying anysoftware product. In the case of Xian Network Manager, there are manymoving pieces, all individually licensed. To make sure that you under-stand the cost implications of your design, let’s consider a sampledeployment of Xian NMS that will manage 150 Linux servers, 50 Solarisservers, 100 Cisco switches, routers, and firewalls, and 10 F5 Big IP Layer7 switches.

In this example, we have determined that we can share the sameSQL Server 2000 installation that hosts our MOM 2005 databases. Oneof our Xian NMS nodes will also function as a Xian NSS, supporting 50managed devices. The remaining NMS nodes are standalone, each sup-porting 100 managed devices. The Xian DS will be a standalone node.Finally, the Xian Connector and Web Service will be colocated on ourMOM management server with the DAS role. This configuration is similarto the one shown in Figure D.19, with additional NMS nodes to supportthe number of devices and systems to be monitored.

For our scenario, we will need the following licenses:■ One Xian Network Manager Bundle (MOM 2005 Edition) – This

includes the licenses for a single Xian NMS (with a monitoringcapacity of up to 50 devices), NSS, DS (with a capacity of 5 NMSconnections), and a Xian Connector. This bundle is a require-ment for any other license.

434 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

Xian Connector

for MOM 2005

MOM 2005 Connector Framework

NMS

NMS

NMSNSS

Xian DB

DS

MOM

50

50

30

`

Xian Consoles

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 434

Page 460: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Three additional Xian NMS licenses■ 150 Xian Linux Agents (MOM 2005 Edition)■ 50 Xian Solaris Agents (MOM 2005 Edition)■ One Smart Management Pack Bundle for Cisco Devices■ One Smart Management Pack for F5 Big IP■ One Smart Management Pack for Linux■ One Smart Management Pack for Solaris■ 100 Device Licenses for Cisco Devices – The prices varies

depending on device type (switch, router, firewall, etc.)■ 10 Device Licenses for F5 Big IP

The choice of a single-machine install or an advanced, distributed install is amatter of scale. If you will be monitoring only a small number of systems, you willneed only one system to house the application. Once you’ve outgrown that firstinstallation, you only need to add additional dedicated NMS nodes. However, if youknow that your organization has a hundred or more Linux or UNIX systems tomanage, you should choose a more distributed install, as shown in Figure D.19.

Managing a Linux/UNIX Systems with an Agent-based Network ManagerIn the following section, we will walk through the installation steps for a newdeployment of the Jalasoft Xian Network Manager. We will configure Xian to mon-itor a Red Hat system with the Smart Management Pack (SMP) for Linux.Thesesteps should quickly get you managing your Red Hat systems with MOM 2005.

We will review the steps to install Xian Network Manager on a single machineas well as a more distributed deployment. Before beginning the installation of anyeXc Software components, all software requirements must be satisfied.Table D.6shows what items need to be installed as a prerequisite for each component.

Table D.6 Software Requirements for Jalasoft Xian Network Manager

Windows Server Version Requirement

Xian Network Manager Server Microsoft Windows 2000 SP4, Windows2003Microsoft .NET Framework 1.1 or laterMDAC 2.6 or laterSNMP connectivity to all devices to bemonitored

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 435

Continued

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 435

Page 461: Virtualization With Microsoft Virtual Server 2005 (2006)

Table D.6 continued Software Requirements for Jalasoft Xian NetworkManager

Windows Server Version Requirement

Connectivity via TCP port 8181 to a XianData Server

Xian Database Microsoft Windows 2000 SP4, Windows2003Microsoft SQL Server 2000 SP3 or laterAdministrative privileges to createdatabases

Xian Data Server Microsoft Windows 2000 SP4, Windows2003Microsoft .NET Framework 1.1 or laterMDAC 2.8 or laterConnectivity to the Xian DatabaseConnectivity via TCP port 9595 to a XianConnector

Xian Connector for MOM 2005 Microsoft Windows 2000 SP4, Windows2003Microsoft .NET Framework 1.1 or laterMDAC 2.8 or laterConnectivity via TCP port 8181 to a XianDatabaseMOM 2005 Framework ConnectorMOM 2005 Data Access Server (DAS)

Xian Network Scan Server Microsoft Windows 2000 SP4, Windows2003SNMP connectivity to all devices to bemonitoredMicrosoft .NET Framework 1.1 or laterMDAC 2.6 or laterConnectivity via TCP 8181 to Xian DataServer

Xian Console Microsoft Windows 2000 SP4, Windows2003Microsoft .NET Framework 1.1 or laterMDAC 2.6 or laterConnectivity via TCP port 8181 to a XianData Server

436 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

Continued

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 436

Page 462: Virtualization With Microsoft Virtual Server 2005 (2006)

Table D.6 continued Software Requirements for Jalasoft Xian NetworkManager

Windows Server Version Requirement

Xian Web Service Microsoft XP, 2000, or 2003IIS Web ServerMicrosoft .NET Framework 1.1 or higherMDAC 2.6 or laterConnectivity via TCP port 8181 to a XianData Server

Xian Reports for MOM 2005 Microsoft Windows 2000 SP4, Windows2003Microsoft SQL Server Reporting ServicesMOM 2005 ReportingAdmin privileges toSystemCenterReporting DB

Once the prerequisites are installed, you can perform the installation steps.Youcan download the latest version of the Xian Network Manager fromwww.jalasoft.com.At the time of publishing this book, the latest version was Xian2005 Network Manager SP2.

Installation of Xian Network ManagerAfter you have downloaded the installation package and run the installer, you will bepresented with the option to pick the setup type – either Single Machine orAdvanced.This walk-through assumes that you will by choosing the Advanced setupoption but installing all components on the same management system.The assumptionis also being made that this system will also be a MOM 2005 Management Serverwith the DAS role. If you are not planning on distributing the Xian Network Managercomponents, you can still follow these steps for a distributed installation. Some compo-nents may not be available to install if the target machine does not fulfill the installa-tion requirements.To install Xian Network Manager, use the following steps:

1. The first step in the wizard is to pick your components. Since we areinstalling all the components, we will leave them all selected (see FigureD.20). However, if you want to distribute the components, you should leaveonly the components to be installed selected and deselect the others.

2. Click Next.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 437

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 437

Page 463: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure D.20 Xian 2005 Network Manager Customer Setup

3. On the Xian database information page, enter the server name (andinstance, if relevant) and the database name to be created for NetworkManager.Also, select the authentication mechanism. If you choose Use NTAuthentication, the account used to run the Xian Network ManagerService will need to have dbo access to the database. If you choose UseSQL Server Authentication, you will have to specify a SQL login thathas database creator rights on the SQL Server.

4. Click Next.

5. Configure the Xian Data Server by setting the Xian Data Server Port(8181 is the default value).This port will listen for requests from the XianConsole, Network Manager Servers, Network Scan Servers, Web Services,and the Xian Connector.

6. Select Connect to repository using current configuration (see FigureD.21). If you are installing a standalone data server, you would configureconnectivity to another existing repository.

7. Click Next.

8. Configure the NMS component by selecting Connect to local DataServer (see Figure D.22). If your data server is on another system, be sureto configure connectivity to it by entering the IP address as well as the portthe data server is configured to listen on.

438 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 438

Page 464: Virtualization With Microsoft Virtual Server 2005 (2006)

Figure D.21 Xian Data Server Configuration

Figure D.22 Configure Network Manager Server (NMS)

9. Click Next.

10. Configure the Web Service by choosing Connect to local Data Server.

11. Click Next.

12. Configure the NSS component by selecting Connect to local DataServer.

13. Click Next.

14. Configure the Connector for MOM 2005 by selecting Connect to localData Server.

15. Enter the port number the Connector will use to listen for requests fromthe Xian Data Server. By default, this port number 9595.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 439

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 439

Page 465: Virtualization With Microsoft Virtual Server 2005 (2006)

16. Enter the URL of the Microsoft Connector Framework hosted on aMOM 2005 DAS. If the DAS is installed locally on the server, the defaultURL is http://localhost:1271/ConnectorServiceV2.asmx for the MCFLocation (see Figure D.23).

Figure D.23 Configure Xian Connector for MOM 2005

17. Click Next.

18. Configure the System Center Reporting database account, including theauthentication method, server name and instance, database name, and user-name and password if SQL Server Authentication is selected.

19. Click Next.

20. Configure the Xian Console by selecting Connect to local Data Serverand Connect to local Web Service. If those components are hosted onanother server, enter the appropriate IP address for TCP or HTTP as wellas the Port that the component is listening on (see Figure D.24).

Figure D.24 Configure Xian Console

440 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 440

Page 466: Virtualization With Microsoft Virtual Server 2005 (2006)

21. Click Next.

22. Enter the Domain\User Name and Password for the service accountused to run the Xian services.The username for the services must haveadministrator access rights on the management server. It must also have LogOn As A Service privileges.

23. Click Next.

24. Click Install.

25. Click Finish.

BEST PRACTICES ACCORDING TO MICROSOFT

■ Plan...plan...plan. Be sure to put in enough time planning upfront to avoid any complications later on. It will delay yourdeployment timeline to have to rearchitect on the fly, or youmay not be able to exploit the full potential of the product ifyour solution is undersized.

■ Make the most out of each license you purchase. When plan-ning, factor in the type of hardware that you will be runningeach component on. Although we discussed 50 as the numberof systems that a Xian Network Manager Server can support,you may be able to support much more depending on the typeof processors, quantity of processors, and the amount ofmemory your NMS has. For example, a 4-way dual-core AMDOpteron server with 4 GB of RAM will be able to monitor moresystems that a 2-way Intel XEON with 1GB of RAM and Hyper-threading disabled. However, the maximum monitoring capacityfor a single NMS is 200 systems/devices.

■ Share resources. Considering today’s hardware, colocating sys-tems management components is possible without causingthem to fight for resources. Be sure to install components (someif not all) on one of your MOM 2005 Management Servers toget the most utilization from your existing hardware investment.

■ Never install the database component with the other Xiancomponents. Although it’s possible, do not install the produc-tion Xian database on the same server as any other Xian compo-nent. Doing so will significantly reduce the capacity of thatcomponent. Consider placing the Xian database on the sameserver as your OnePoint and/or your SystemCenterReportingdatabase if appropriately sized.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 441

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 441

Page 467: Virtualization With Microsoft Virtual Server 2005 (2006)

Configuration of Xian Network ManagerNow that the Xian 2005 Network Manager SP2 components have been completelyinstalled, you should import the Smart Management Packs (SMPs) and Reports intoyour MOM 2005 configuration. SMPs provide the intelligence to organize, process,and analyze the information gathered by Xian into the views, computer groups, andreporting capabilities of MOM. SMPs are device-aware and tailored to the moni-toring and management requirements of each type of device and vendor product.Views provided for each supported device include:

■ Alerts and notifications

■ Performance.

■ Performance data

■ Computer

■ Computer attributes

■ Topology

■ State

Xian 2005 Network Manager comes with its own SMP to manage the healthand performance of the Jalasoft Xian Network Manager environment. SMPs alsoprovide a large set of reports created to incorporate historical and trend analysiscapabilities, based on performance data collected by the most relevant Xian moni-toring rules.

To install the Jalasoft Smart Management Packs and reports using the MicrosoftOperations Manager Administrator Console, execute the following steps:

1. In the Navigation pane, click Management Packs.

2. In the Detail pane, click Import/Export Management Packs to openthe Management Pack Import/Export Wizard.

3. Follow the instructions in the Management Pack Import/Export Wizard.

4. When asked, select all Smart Management Packs and reports to import.

Installing the Xian UNIX Agent for Linux and SolarisAlthough Xian Network Manager can monitor and manage devices and systemswith the SNMP protocol, effective management for Linux and Solaris systems is bestachieved using the Xian Agent.The Xian UNIX Agent is able to load various dif-ferent shared objects (so) at run-time and publish information about the status of theserver or applications via Web Services, as shown in Figure D.25.

442 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 442

Page 468: Virtualization With Microsoft Virtual Server 2005 (2006)

The basic shared object is the UNIX so.This so, depending on the OS version,will have different names. For example for the Linux OS, the shared object is lib-jsrhu.so.The UNIX so must be present at all times; other sos may be loaded at thesame time, later, or not at all.

Each loaded so will allow the Xian UNIX Agent to publish, via Web services,information about the particular OS or Application it was design to monitor.Thecorresponding plug-in in Xian will be able to request the Xian UNIX Agent dis-covery information or the status of any discovered node in that server.

Figure D.25 Xian UNIX Agent for Linux

The Xian UNIX Agent for Linux comes as an RPF file, XianServer-x.x.x.x.-n.rpm, where x refers to the build number and n is the version.To install the agent,you need to be logged in as root and run the following command: rpm -ivhXianServer-x.x.x.x.-n.rpm. For Solaris systems, the UNIX Agent for Solariscomes as a TAR file, XianServer-x.x.x.x-n.tar.gz.

After the installation, you have the option of fine tuning the Xian Server config-uration file, xianserver.conf.A sample of the configuration file is as follows:

# Log settings

%loglevel 10

%logname /var/log/xianserver

%logsize 8388608

# Web Services settings

%port 8182

%queue 100

#Enter Server information below (as you wish to appear in MOM 2005)

%Contact MIS Department

%Location Corporate Data Center – Rack 2B

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 443

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 443

Page 469: Virtualization With Microsoft Virtual Server 2005 (2006)

Shortcuts…

Avoid Overmonitoring Your SystemsMonitoring your critical infrastructure components is an important component ofmanaging an enterprise infrastructure. However, it is possible to over-monitoryour servers. Excessive monitoring is usually the result of too many monitoringprocesses running on your systems, consuming valuable resources that yourapplications need. Many times, the various agents that are installed on yourservers are collecting the same data (in particular performance counters andevents) and possibly each attempting to remedy the same condition or issue.Among the various agents that may already exist on your Linux or UNIX servers,you may be running the following:

■ HP Insight Agents (Foundation Agent, NIC Agent, and Storage Agent)■ IBM Director Agent■ Dell OpenManage Agents■ IBM Tivoli Agent■ BMC Patrol Agent for Linux or UNIX

If you already have one or more of these processes running, you should con-sider using an agentless approach to get performance and event data into MOM.Both Xian NMS and eXc Software have the ability to use SNMP to manage *NIXservers without relying on an agent process on the managed host.

Xian Rules and Policy ManagementXian rules are the basic monitoring element used to monitor known devices orobjects included in those devices.These rules monitor devices or their includedobjects, requesting information about internal counters or status of the monitoreddevice. Every Xian rule may generate alerts, which are sent to the MOM 2005 envi-ronment as MOM alerts. Monitoring rules may generate performance counters,which provide information about the monitored device over time; these counters aresent to the MOM 2005 environment as MOM performance data.

Out of the box, the Linux agent monitors network interfaces focusing on errorsand discarded packets, memory, file systems, and CPU load.The active rules arebased on templates that ship with the product.You can add or remove rules as well

444 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 444

Page 470: Virtualization With Microsoft Virtual Server 2005 (2006)

as create new rules from your own custom templates. Figure D.26 lists the rules thatare active after install for Linux systems.

Figure D.26 Active Rules for Linux

Jalasoft Xian Network Manager provides an easy-to-use Policy TemplateManagement solution expressly designed to deploy predefined sets of monitoringrules into the Xian environment with almost no effort.

Policy templates are preconfigured groups of rules designed to easily apply alarge group of rules to one or more supported devices and start to monitor themimmediately. Within each policy template, rules are grouped together and alertthresholds defined.Those alerts are forwarded onto MOM 2005 by the XianConnector. Xian 2005 Network Manager provides basic policy templates for everyprovided plug-in, custom policy templates may be created to satisfy user monitoringneeds. Both, basic, and custom policy templates may be applied to devices located bynetwork scan tasks automatically.

To create your own template, follow these basic steps:

1. In the Policy Template window, right-click the Smart Agent to which thepolicy will apply.

2. Next to Name, click the [...] button to change the name of the policytemplate.

3. Next to Description, click the [...] button to change the description ofthe policy template.

4. On the right pane you will find all the rules available from the SmartAgent.To add a rule to the policy template, click Add to start the Rulesconfiguration wizard.

5. Highlight the rule you want to add and click Next.

6. Check Alert when value is over threshold and set the appropriatethreshold for the monitored rule. Click Next.

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 445

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 445

Page 471: Virtualization With Microsoft Virtual Server 2005 (2006)

7. Configure the severity for the alert notification forwarded to MOM 2005.Click Next.

8. Establish the interval that the Smart Agent will poll for data. Click Next.

9. Check Collect performance data on each rule execution to enableperformance data storage in MOM. If this is not checked, the performancedata for the specific counter will be used only to evaluate alerts and notretained.

10. Click Finish.

11. Repeat steps 1 through 10 for each additional rule to be added to thepolicy (see Figure D.27).

12. Click OK to save the policy template.

Figure D.27 Policy Template Properties

Once defined, the group of rules defined in the policy can be applied to anyparticular Linux or Solaris server or groups of servers. Data collection immediatelybegins as performance data (if enabled) and alerts are forwarded to MOM and avail-able for your review in the MOM 2005 Administrator Console.

Although not as extensible as eXc Software’s agentless solution, the XianNetwork Manager offers robust monitoring of Linux and UNIX systems in an easy-to-manage package.

446 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 446

Page 472: Virtualization With Microsoft Virtual Server 2005 (2006)

SummaryYour Linux and UNIX systems can now take advantage of the advanced manage-ability and reporting capabilities that Microsoft Operations Manager 2005 alreadyprovides to Windows Server System technologies.Among the points covered in thischapter, we discuss the following topics:

■ Design an agentless solution to monitor and manage Linux and UNIX systems

■ Install the eXc Software WMI non-Windows Event Provider and baseframework

■ Install and configure eXc Software Virtual Agents

■ Customize SNMP and CLI-based Virtual Agents

■ Design an agent-based solution to monitor and manage Linux and UNIXsystems

■ Install the Jalasoft Xian 2005 Network Manager

■ Install the Xian UNIX Agent for Linux and Solaris

■ Configure rules and policy templates to manage your Linux and Solarisservers.

Microsoft Operations Manager 2005 can be used to manage more than justWindows Server systems.Thanks to solutions from third-party vendors, it is possibleto develop and deploy advanced management packs with rules to handle events andalerts. Depending on your management strategy, you can employ both agentless andagent-based technologies to interact with and gather data from your Linux andUNIX systems.

Agentless solutions are growing in popularity and have changed the managementparadigm that organizations use to monitor and control their critical infrastructureresources.They have the benefit of:

■ Rapid deployment

■ Simple architecture

■ Intelligent COM objects that integrate with WMI

■ Support for both SNMP and CLI protocols

In comparison, agent-based solutions follow the traditional management modelconsisting of server components that communicate with lightweight agents deployedon each management node.These solutions are often:

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 447

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 447

Page 473: Virtualization With Microsoft Virtual Server 2005 (2006)

■ Very scalable

■ Designed specifically for the operating system being managed

■ Facilitate complex data collection options and responses

Solutions Fast Track

Agentless Management of Linux and UNIX Servers

� eXc Software’s solution uses a WMI non-Windows Event Provider thatfacilitates the collection of performance and event data into MOM 2005.

� Virtual Agents are a combination of scripts and jobs that are used to set upand invoke the management routines that interact with Linux and UNIXsystems.

� eXc Software Virtual Agents are configured using the eXc SoftwareConfiguration Utility/GUI. With this tool, you can configure the hostsmonitored by the Virtual Agent, processes to be monitored, performancethresholds, syslog settings, and the Virtual Agent job settings.

� eXc Software’s base framework provides an extensible platform to developcustom solutions using both SNMP and CLI-based protocols.

� The SNMP COM objects can be used to perform catch or generateSNMP traps as well as perform standard GET and SET commands againstany SNMP-enabled system.The CLI COM object,TelnetAutomation, canbe used to connect to managed hosts via Telnet or SSH, run command, andrecord the results or output from the commands.

Agent-Based Management of Linux and Solaris Servers

� Jalasoft’s Xian 2005 Network Manager Server (NMS) that is comprised ofmultiple components that can scale to support any size infrastructure.

� Xian 2005 supports the Red Hat and SuSE Linux distributions and theSun Solaris operating system.

� The Xian NMS uses the Microsoft Connector Framework (MCF) tointegrate with MOM 2005.

448 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 448

Page 474: Virtualization With Microsoft Virtual Server 2005 (2006)

� Although not as extensible as eXc’s solution, Xian 2005 offers a UNIXAgent for both Linux and Solaris that tightly integrates the agent’sfunctionality into the host operating system.

� Jalasoft’s Smart Management Packs extend MOM 2005’s capabilities tomonitor Linux and Solaris servers.These management packs containcomputer groups and processing rules, with filters, performance counters,alerts, a ready-to-use knowledge base for monitoring and managing thesupporting operating systems.

Q: My organization uses several Linux distributions that are not listed on eXcSoftware’s site. How can I take advantage of eXc’s management framework?

A: There are too many Linux distributions to have customized Virtual Agentsfor each one. However, all Virtual Agents are the same in design.You candownload any Linux Virtual Agent, such as the Virtual Agent for Red Hat orSuSE, and make the necessary changes to scripts and configuration files tomake it work on your particular distribution(s).

Q: What scripting languages can I use to develop my own custom Virtual Agent?

A: You can use any scripting language supported by Windows Script Host 5.6.Since WSH exposes an OCX control that allows external scripting enginesto hook into the host using ActiveX, just about every major scripting lan-guage is supported.The popular choices are VBScript, JScript, Javascript,REXX, Perl, and Python. However, only VBScript and JScript are native toMicrosoft’s operating systems.

Q: How can I integrate the hardware monitoring provided by my server hard-ware manufacturer into eXc’s framework?

A: eXc Software provides several Virtual Agents for most of the major servers,including HP ProLiants, Dell PowerEdge, and IBM xSeries.They take advan-tage of the “business logic” already integrated into the hardware-monitoring

Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents • Appendix D 449

Frequently Asked Questions

The following Frequently Asked Questions, answered by the authors of this book,are designed to both measure your understanding of the concepts presented in this chapter and to assist you with real-life implementation of these concepts. Tohave your questions about this chapter answered by the author, browse towww.syngress.com/solutions and click on the “Ask the Author” form.

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 449

Page 475: Virtualization With Microsoft Virtual Server 2005 (2006)

agents. In addition, you can utilize native SNMP support and direct traps toyour eXc Software management server.

Q: What happens if MOM 2005 becomes unavailable?

A: With the eXc Software solution, all functionality is wrapped in a componentmodel that is an internal part of MOM 2005.The WMI non-WindowsEvent Provider and the corresponding management pack are responsible forinvoking the “factory” that runs the collection and monitoring jobs. In theevent that MOM 2005 is unavailable, the Virtual Agents will not automati-cally run their jobs. Even if you run the jobs manually, you will not be ableto store any data since the MOM DAS would be offline. In contrast, Xian2005 wraps its functionality in a management system that is external toMOM 2005. Data forwarded to MOM 2005 uses the connector framework.Xian 2005 also uses its own database separate from the MOM databases. Iffor any reason the MOM 2005 Connector Framework is not available, thenall data received by the Xian Connector from the Xian Data Server will becached into temporary tables named ConnectorDeviceCache,ConnectorAlertCache, and ConnectorPerformanceDataCache in the Xian database.After the MOM 2005 Connector Framework is available, all cached informa-tion in the Xian Connector is transferred to the MOM environment.

Q: I need to make sure that critical performance data is monitored out-of-the-box without much customization of the product. What are the componentsmonitored by each solution?

A: Out of the box, each of the products monitors several critical componentswithout much customization. eXc Software’s Virtual Agent solution monitorsand creates alerts for CPU usage per process, total CPU usage, disk utiliza-tion, syslog files, and process states. Jalasoft’s SMP for Linux and Solaris moni-tors CPU load, system uptime, system usage, file system free space, file systemusage, interface traffic, syslogs, and free memory.

Q: What reports do the management packs for each product provide?

A: eXc Software provides reporting of the eXc solution including alert andevent analysis as well as performance reports reflecting CPU and disk utiliza-tion. Xian 2005 SMPs provide a wide range of reports, including summaryand detail view of alerts, CPU load, file system, memory, interface traffic, andsystem usage.

450 Appendix D • Integrating Non-Windows Systems with MOM 2005 Using Virtual Agents

406_VIRTUAL_AppD.qxd 9/11/06 1:29 PM Page 450

Page 476: Virtualization With Microsoft Virtual Server 2005 (2006)

451

IndexAaccess permissions, setting on VMRC, 35–37, 43accessing

object properties, methods, 258Virtual Server using scripts, 256–261

accountschanging for ADS installation, 291user. See user accounts

Active Directory, 241, 328adapter, network, 117Add Hardware Wizard, 125–128adding

hardware drivers in boot OS, 223, 232hardware to virtual server, 75–78, 105, 107network adapters, 68SCSI adapters, 64–66Virtual Machine Additions, 91–92

addresses, network, and host-client isolation, 132–133administrative agent,ADS, 219–222, 232administrative Web page, using, 49–74ADS (Automated Deployment Services)

adding hardware drivers in boot OS, 223components, requirements, 200–204installing, 204–214installing administrative agent, 219–222integration, troubleshooting, 345introduction to, 198–200, 231–232post-installation configuration, 214–219preparing virtualization environment, 288–292troubleshooting, 338–343, 352

ADS Management snap-in, 313applications, testing on virtual machines, 14attaching

CD/DVD drives, 159scripts to Virtual Server events, 275–282

authentication, 325–326Automated Deployment Services. See ADS

Bbalancing workloads of virtual machines, 21binding physical network adapter to virtual networks,

141–147, 154bindings and Loopback adapter configuration, 124BIOS system clock, 342bootable CD for starting build process, 81

Ccapturing

CD/DVD drives, 159images, troubleshooting, 346–347physical machines, 293–310physical server disks, 305–310

CD/DVD drivesattaching, capturing, 159–161configuring, 48–49, 63–64, 80–81

central virtual server management site, configuring,237–247

certificates,ADS service, 290–291, 343

chaining virtual hard disks, 186–187changing

virtual machine names, 54–55virtual network binding, 142–145virtual network settings, 333–334

clientsADS requirements, 202–203isolating from host, 132–133, 155

clustering virtual machines, 66COM API, Virtual Server, 247–256COM ports, 49

configuring host server’s, 77configuring virtual machine’s, 72–73

compactingdifferencing virtual hard disks, 195virtual hard disks, 170–179

compression, NTFS, 183–184configuration files for virtual machines, 56–57configuring

ADS, post-installation, 214–219central virtual server management site, 237–247DHCP relay agent, 339–339DHCP servers, 148–150host-to-guest networking, 129–132Loopback adapter, 124–128SCSI adapters, 64–66Virtual Machine Additions, 89–91virtual machine hard disks, 61–62virtual machines, 53–74virtual machine floppy disk drives, 71–72virtual machines for scripts, 68–70virtual networks, 114

connectingto different virtual networks, 156multiple virtual networks, 152–153to Virtual Server COM object, 254–256to virtual servers, 34

connectionsisolating between host and client, 132–133using ICS, 133–138

convertingphysical to virtual machines, 8virtual hard disks, 177–179, 194

CPU (central processing unit)and NTFS compression, 183–184setting virtual machine resource allocation, 39–41

creatingdifferencing virtual hard disks, 181–186DMZs (demilitarized zones), 124dynamically expanding virtual hard disks, 170migration environment, 340–341migration scripts, 301–305virtual floppy disks, 163, 165virtual hard disks, 51–52, 106virtual machines, 49–53virtual machines on Virtual Server host, 310–313,

310–313virtual machines using scripts, 261–266virtual machines with non-Windows OS, 93–96virtual networks, 139–141, 154virtual servers, 47–74, 107

Cscript host, 255–256

406_VIRTUAL_Index.qxd 9/11/06 1:32 PM Page 451

Page 477: Virtualization With Microsoft Virtual Server 2005 (2006)

452 Index

Ddemilitarized zones (DMZs), 104, 124deploying

See also ADSvirtual machines on host OS, 310–313, 317Virtual Server scenarios, 320–326

Deployment Agent,ADS, 223DHCP (Dynamic Host Configuration Protocol)

configuring virtual network for, 120–121and preparing virtualization environment, 288

DHCP relay agent, configuring, 339DHCP servers

providing additional network information, 155using virtual server network services, 147–151

differencing virtual hard diskscompacting, 195creating, using, 46, 180–186, 194vs. undo disks, 190

disablingDHCP servers, 148floppy disk drives, 164TCP Segmentation Offload (TSO), 336–337

disaster recovery, virtualization and, 6–7disk controllers, and guest machines, 338DMZs (demilitarized zones)

creating, 124on Linux, 104

documenting virtual machines, 56domain controllers, 353domains, troubleshooting, 321downloading

sample management scripts, 285Virtual Server software, 22VMware SCSI driver, 345

driverscreating migration environment, 340–341Network Driver Interface Specification (NDIS), 337supported by Virtual Server, 294–295troubleshooting, 353VMware SCSI, 345

Dynamic Host Configuration Protocol. See DHCPDynamic System Initiative (DSI), 2dynamically expanding virtual hard disks, 168–170

Eenabling

DHCP servers, 148scripting on virtual machine level, 277TCP offloading, 354

error messagesaccess denied, 329HTTP 500, 327–329Imgdeploy.exe, 346–347and migration process, 318

Ethernet MAC address, configuring virtual machine’s, 68events

that trigger virtual machine scripts (table), 70Virtual Server, attaching scripts to, 275–282

external network, connecting virtual machines to, 52External Network, viewing, 114–118

Ffile sharing

configuring, 129–132turning off, 137–138

file systems, NTFS compression, 183–184filenames for virtual machines, 47–48files. See specific file, file typefirewall, Internet Connection Firewall (ICF), 124fixed-size virtual hard disks, 178–180floppy disks, 49

configuring virtual machine’s, 161–166configuring virtual machine’s drive, 71–72

formatting virtual disks, 87–88

GGatherHW.exe, 297–298, 344GuestOS property, 268Guests Only network, 267

Hhard disks

configuring virtual machine’s, 61–62creating virtual, 51–52installing virtual, 46–47partitioning, 225–226virtual. See virtual hard disks

hardwareadding to virtual server, 75–78drivers, adding in boot OS, 223, 232physical machine inventory, 297–298validating source server, 299–301for Virtual Server 2005, 9–10virtual (table), 78–79virtualization, 3

help desk for Virtual PC, 13high availability, 65host servers

ADS requirements, 202building, 75–78managing using administration Web site, 237–247maximum virtual machines on, 110running OS on, 13

host-to-guest networking, configuring, 129–132hosts

creating virtual machines on Virtual Server, 310–313isolating from client, 132–133, 155OS, deploying virtual machines on, 310–313scripting, 255

HTTP 500 error, 327–329hyper-threading, 44

IICS, using to connect virtual machines, 133–135IDE virtual hard disks, 160, 167–168, 195, 347IDS (Image Distribution Service) and ADS, 201IIS (Internet Information Server)

and Virtual Server, 285Virtual Server pre-installation, 22, 29and Windows Server Virtualization, 236

Image Distribution Service (IDS) and ADS, 201image files, 64, 356imaging problems, troubleshooting, 346–347, 353–354Imgdeploy.exe, 346–347infrastructure, virtual, 103–104installing

ADS administrative agent, 219–222ADS (Automated Deployment Services), 204–214ADS server, 288Loopback adapter, 124–128

406_VIRTUAL_Index.qxd 9/11/06 1:32 PM Page 452

Page 478: Virtualization With Microsoft Virtual Server 2005 (2006)

Index 453

non-Windows OS in virtual machines, 92–104, 93–96Virtual Machine Additions, 58–59, 89–92, 108Virtual Server 2005 R2, 22–28, 42Virtual Server 2005 R2 in multiserver environment,

29–34Virtual Server on Windows Server 2003, Windows

XP Professional, 236–237Virtual Server Web Application, 25VSMT and ADS agent, 289–292VSMT (Virtual Server Migration Toolkit), 227–230,

233Windows OS in virtual machines, 78–88

“internal network”connecting virtual machines to, 52using, 122–123, 154using Loopback adapter, 124–128in virtual networks, 152

Internal Network, viewing, 114–118internal virtual networks, using, 155Internet Connection Firewall (ICF), 124Internet Connection Sharing (ICS), 124ipconfig command, 268iSCSI storage, 167–168ISO files, 337isolating host and client, 132–133IVMVirtualServer interface, 252

KKCD (Kerberos Constrained Delegation), 238, 241Kerberos Constrained Delegation (KCD), 238, 241Kerberos Delegation and Windows Server 2003, 238

Llicensing

Virtual Server 2005, 24, 233, 357–358Virtual Server 2005 R2 in multiserver environment,

30VSMT (Virtual Server Migration Toolkit), 228

linked virtual disks, 47Linux

installing and configuring Virtual Machine Additions,96–103

installing OS, 92–93and Virtual Server 2005 R2, 17

logon errors, 320–326Loopback adapter

described, 68installing and configuring, 124–128using, 145, 152

LPT ports, 49configuring host server’s, 77configuring virtual machine’s, 73–74

LsaLogonUser() failed! message, 320–326

MMAC addresses and physical servers, 307managing

virtual machines, 35virtual machines with ADS, 203–204virtual machines with Virtual Server Administration

Web site, 28virtual networks, 113–114Virtual Server hosts using administration Web site,

237–247virtual servers, 28, 236

memoryallocating to virtual machines, 44configuring virtual machine’s, 60for host server, 76IDE disk limit, 347needed for virtual machine creation, 312overallocating, 337virtual machine configuration, 56–57virtual machine requirements, 48

merging virtual hard disks, 187–190methods in scripts, 258Microsoft. See specific productsMicrosoft Dynamic System Initiative (DSI), 2Microsoft Operations Manager (MOM), 2Microsoft Virtual Disk Pre-Compactor, 171–177Microsoft Virtual PC 2004 vs. Virtual Server 2005,

10–14Microsoft Virtual Server SDK, 249–251migrating

See also migration, virtualizationVirtual PC to Virtual Server 2005, 17

migration creating scripts, 301–305process, troubleshooting, 345–350, 352–353troubleshooting scripts, 318

Migration Toolkit for Virtual Server 2005, 7MMC (Microsoft Management Console) snap-in, 241monitoring

memory usage, 337virtual machines using scripts, 271

moving bootable OS disk from IDE to SCSI, 195multiple virtual networks, connecting, 152–153multiprocessor (SMP) virtual machines, 17

Nnames, changing virtual machine, 54–55NAT (Network Address Translation) and Loopback

adapter configuration, 124NBS (Network Boot Service), 200–201network adapters

adding, configuring for virtual machines, 66–68configuring virtual machines, 52–53, 139–141installing, 127–128physical, binding to virtual networks, 141–147, 154troubleshooting, 334, 337using multiple, 144–145

Network Address Translation (NAT), 124Network Boot Service (NBS), 200–201Network Driver Interface Specification (NDIS) driver,

337network drivers, 341network interface cards. See NICsNetwork Setup Wizard, 133–138network team adapter sets, 156networking, configuring host-to-guest, 129–132network interface cards. See NICsnetworks

“internal,” See “internal network”virtual. See virtual networksvirtual local area. See VLANswide area. See WANs

NICs (network interface cards)configuring host server’s, 77disabling TSO, 336–337and External Network, 115–116internal or external configuration, 121troubleshooting changes to, 332–335

406_VIRTUAL_Index.qxd 9/11/06 1:32 PM Page 453

Page 479: Virtualization With Microsoft Virtual Server 2005 (2006)

454 Index

and virtual networks, 114NTFS compression, 183–184

Oobjects, accessing properties and methods using scripts,

258operating systems (OSs)

adding hardware drivers in boot, 223deploying virtual machines on host, 310–313, 317installing non-Windows OS in virtual machines,

92–104, 108–109installing Windows, 78–88loading from Virtual Server R2 Administration Web

page, 79–88moving bootable disk from IDE to SCSI, 195retrieving guest information using scripts, 268–271supported by Migration Toolkit for Virtual Server

2005, 7synchronization between host’s and guest’s, 58Virtual PC support matrix (table), 11

OSs. See operating systems

PP2V (physical-to-virtual) processes, 7parentheses () in VBScript, 262partitioning disks with ADS, 225–226Pascal notation, 253paths, setting virtual machine location and search, 37–39performance

troubleshooting Virtual Server issues, 336–338Virtual Server 2005 issues, 357–358virtual servers, key areas, 20–21

permissionsconfiguring virtual machines under user accounts,

277–278setting VMRC, 35–37, 43

physical machinescapturing, 293–310, 316–317virtualization. See virtualization

planningADS server, 289creating migration environment, 340–341for new virtual servers, 21–22

PlateSpin PowerRecon, PowerConvert, 8–9ports

changing VMRC, 330–331COM, LPT, 49, 72–73

Posey, Brien M., 355, 360PowerRecon, PowerConvert tools, 8–9pre-compacting virtual hard disks, 171–177printer sharing, 137–138privileges

See also permissionsconfiguring virtual machines under user accounts,

277–278processors for host server, 75production data centers, 4–6production servers and Virtual Server 2005 R2, 17properties

DHCP settings, 120–121floppy drive, 161–166network adapter, 66–68viewing virtual network, 116–118virtual machines, 36, 37–39, 312virtual machine’s disk, 190Virtual Server, listing, setting, 256–261

Virtual Server objects, 253PXE boot, 305, 308PXE Service

and ADS, 200–201and planning ADS server, 289troubleshooting, 338–343

RRAID (Redundant Array of Inexpensive Disks)

storing virtual hard disks, 191using for host server, 76–77

read-only attribute, 166recoverability and virtualization, 5Redundant Array of Inexpensive Disks. See RAIDreinstalling virtual servers, 354Remote Installation Services (RIS), 289, 306remote management

Virtual Machine Remote Control. See VMRCand Virtual Server 2005 R2, 12

removable virtual disksadding, configuring, 158–166, 192–193types of, 158

removingbindings, 124Virtual Machine Additions, 91–92virtual networks, 156, 334–335

resourcesaccess denied errors, 329balancing workloads, 21setting allocation of virtual machines, 39–41, 43and virtual network, 112and virtual networks, 152

RIS (Remote Installation Services), 234, 289, 306

SSAN (Storage Area Network)

configuring, 65–66and virtualization, 6

scriptsaccessing virtual servers using, 256–261attaching to Virtual Server events, 275–282configuring virtual machine for, 68–70creating migration, 301–305creating virtual machines using, 261–266creating virtual networks using, 267–268managing Virtual Server using COM API, 247–256retrieving guest information using, 268–271setting up scripting environment, 255troubleshooting, 344troubleshooting migration, 318Virtual Server 2005 support, 12

SCSI adaptersadding, configuring, 64–66troubleshooting, 347–350using in Windows OS, 85–86

SCSI drivers, VMware, 345SCSI storage

architecture, 167–168attaching virtual disks, 195

securityand virtual machine connections, 133and Virtual Server 2005 R2, 12, 359

Sequence Editor, using, 223–227, 232servers

ADS, 288–292DHCP, 147–151, 155

406_VIRTUAL_Index.qxd 9/11/06 1:32 PM Page 454

Page 480: Virtualization With Microsoft Virtual Server 2005 (2006)

Index 455

host. See host serversMicrosoft Virtual Server 2005. See Virtual Server

2005migration and data capture, 305–310physical machine inventory, 297–298production, test, and development data centers, 4–6validating source server hardware, 299–301virtual. See virtual servers

setspn command-line tool, 243–244setting up Virtual Server Administration Web site, 28–34settings

troubleshooting Virtual Server, 331–335virtual network, 118–120

setup.exe, 23start-up scripts, 68–70starting virtual machines, 83–87Storage Area Network (SAN), use with Virtual Server

2005, 6, 65–66storage drivers, 342storage systems

for host server, 76–77virtual hard disks. See virtual hard disks

storing virtual hard disks, 191subnet masks and host-client isolation, 132–133synchronization between host and guest OS, 58system requirements for Virtual Server 2005 R2, 20–21

Ttask sequencing with ADS, 200TCP/IP (Transmission Control Protocol/Internet

Protocol) and network adapter configuration,131

TCP offloading, 354TCP Segmentation Offload (TSO), 336–337test and development data centers, 5–6testing applications on virtual machines, 14tools

See also specific toolsetspn command-line, 243–244virtualization, 7–9, 15–16VSMT (Virtual Server Migration Toolkit), 227–230

training for Virtual Server 2005, 13–14troubleshooting

ADS (Automated Deployment Services), 338–343,352

crashed virtual machines, 44imaging problems, 353–354migration, 318migration process, 345–350, 352–353PXE Service, 338–343Virtual Server 2005 R2, 320–338, 351Virtual Server settings, 331–335VSMT (Virtual Server Migration Toolkit), 343–345

trunking, VLAN, 121TSO (TCP Segmentation Offload), 336–337turning off file and printer sharing, 137–138

Uundo disks vs. differencing disks, 190uninstalling virtual servers, 354USB ports, configuring host server’s, 77–78user accounts, configuring virtual machines under,

277–278

VV2P (virtual-to-physical) and PlateSpin PowerConvert, 8validating source server hardware, 299–301VBScript

managing Virtual Server using COM API, 247–256parentheses in, 262

.vhd files, 10viewing virtual networks, 114–118, 334Virtual Disk Pre-Compactor, 171–177virtual disks

formatting, 87–88introduction to, 158removable, 158–166

virtual floppy disks, creating, 163, 165virtual hard disks

chaining, merging, 186–190compacting, 170–179configuring virtual machine’s, 61–62converting, 177–178, 179–180, 194creating, 106differencing virtual hard disks, 180–186dynamically expanding, 168–170introduction to, 46–47, 51–52, 166, 193storage architecture, 167–168storing, 191

Virtual IDE (Integrated Drive Electronics), 167virtual infrastructure, 103–104virtual LANs (VLANs), 121Virtual Machine Additions

installing, 58–59, 89–92, 108for Linux, installing, 96–103

Virtual Machine State Diagram, 272virtual machines

capturing physical machines, 293–310changing states of, 272–275changing using scripts, 271–275configuring removable media drives, 158–166creating, 49–53creating on Virtual Server host, 310–313creating using scripts, 261–266disk controllers, and guest machines, 338enabling scripting on, 277installing non-Windows OS in, 92–104installing Virtual Machine Additions, 89–92installing Windows OS, 78–88isolating guest, 132–133managing, 35names, changing, 54–55scripts. See scriptsstarting, 83–87testing application on, 14

virtual network notes, 119virtual networks

binding to physical network adapter to, 141–147creating, 139–141, 154, 292–293creating using scripts, 267–268and DHCP, 147–151internal or external configuration, 152, 155introduction to, 112–120, 153managing, 113–114maximum allowed on server, 156properties, 116–120troubleshooting, 332–335viewing, 114–118

Virtual PCmigrating to Virtual Server 2005, 17vs. Virtual Server 2005 R2, 11–13

406_VIRTUAL_Index.qxd 9/11/06 1:32 PM Page 455

Page 481: Virtualization With Microsoft Virtual Server 2005 (2006)

456 Index

virtual SCSI (Small Computer Systems Interface), 167Virtual Server

attaching scripts to events, 275–282central virtual server management site, configuring,

237–247drivers supported, unsupported, 294–295managing, 236scripts, sample, 285Virtual Server COM API, using, 247–256

Virtual Server 2005See also Virtual Server 2005 R2and DSI, 2licensing issues, 357–358migrating Virtual PC to, 17Migration Toolkit, 7performance issues, 357–358pros and cons of using, 355–360vs. Virtual PC 2004, 10–14vs. Virtual Server 2005 R2, 14

Virtual Server 2005 R2configuring VMRC, 39–41described, 12installing, 22–28installing in multiserver environment, 29–34OSs supported, 109troubleshooting, 320–338, 351

Virtual Server Administration Web page, 79–88,139–141, 153

Virtual Server Administration Web sitecreating virtual machines using, 261–262managing Virtual Server hosts using, 237–247managing virtual servers with, 28setting up, 26, 28–34, 42–43troubleshooting, 320–329

Virtual Server COM API, using, 247–256Virtual Server Programmer’s Guide, 286Virtual Server Web Application, installing, 25virtual servers

accessing using scripts, 256–261adding hardware to, 75–78connectingcreating, 47–74, 107introduction to, 46–47maximum limits of, 156physical sizing, 20–22setting default location, search paths, 37–41and TCP offloading, 354uninstalling, reinstalling, 354

virtualizationcapturing physical machines, 293–310, 316–317creating, deploying virtual machines on host, 310–315described, advantages of technology, 3–6, 15and disaster recovery, 6–7and DSI, 2environment, preparing, 288–293, 316hardware, 9–10tools described, 7–9, 15–16

VLAN trunking, 121VLANs (virtual local area networks), virtual network

configuration, 121.vmc files, 10VMPatch tool, 299–301VMRC (Virtual Machine Remote Console)

setting permissions for, 35–37

troubleshooting, 329–331VMware, 345.vnc files, 117, 332, 335VSHostNet switch, 293VSMT (Virtual Server Migration Toolkit)

creating virtual networks using, 292–293installing on Virtual Server host, 289–292installing on virtualization server, 227–230, 233troubleshooting, 343–345

vssrvs service, 243

WWANS (wide area networks), virtual network

configuration, 121Web sites

Virtual Server Administration. See Virtual ServerAdministration Web site

VMware, 345while loops, 263–264wide area networks. See WANsWindows Firewall, 26, 32Windows Management Instrumentation (WMI), 298Windows NT Server, 357Windows OS, using SCSI in, 85–86Windows Performance Monitor, 337Windows Server 2003

domain functional levels, Kerberos constraineddelegation, 238

Enterprise Edition, 233installing Virtual Server on, 236–237licensing issues, 357–358

Windows Server Virtualization, 236Windows XP Professional, installing Virtual Server on,

236–237WinImage, creating virtual floppy disks with, 163WINS servers, configuring, 150WMI (Windows Management Instrumentation), 12, 298workstations, deploying with ADS, 233Wscript host, 255

XXML files, 297–298

YYaST and Linux installations, 103

406_VIRTUAL_Index.qxd 9/11/06 1:32 PM Page 456