logo资料库

vmware vi and vSphere sdk 经典教程 英文版.pdf

第1页 / 共647页
第2页 / 共647页
第3页 / 共647页
第4页 / 共647页
第5页 / 共647页
第6页 / 共647页
第7页 / 共647页
第8页 / 共647页
资料共647页,剩余部分请下载后查看
TABLE OF CONTENTS
PREFACE
CHAPTER 1: VMWARE INFRASTRUCTURE OVERVIEW
Introducing OS Virtualization
What Virtualization Is
History of Virtualization
Benefits
Solutions
VMware Products
VMware Infrastructure
ESX Server
VirtualCenter Server
VI Client
VMware Management APIs
VI SDK
CIM APIs
VIX API
GuestSDK
VMware VMCI
Legacy APIs
Other APIs
CHAPTER 2: VI SDK BASICS
Overview of the VI SDK
What Is Included in VI SDK 2.5?
Object Model
Unified Interface with Different Support
Managed Objects
Inheritance Hierarchy
Inventory Hierarchy
Properties
Methods
Synchronous versus Asynchronous Methods
ManagedObjectReference
Data Objects
Property Path Notation
Enumeration Types
Fault Types
Using Tools to Become Familiar with Object Model
VI Client
Web Access
Managed Object Browser (MOB)
Web-Based Datastore Browser
Using the API Reference
VMware Online Communities and Conferences
CHAPTER 3: HELLO VI
Setting Up the Environment
Setting Up the VMware Infrastructure
Installing a Java JDK
Downloading the VI SDK, AXIS, and the VI Java API
Setting Up the Eclipse IDE
Creating Your First Application
Debugging VI SDK Applications
Using Logs
Monitoring SOAP Messages with HTTP
Common Bugs
CHAPTER 4: USING PROPERTYCOLLECTOR AND SEARCHINDEX
PropertyCollector
Getting Properties from a Single Managed Object
Getting Properties of Multiple Managed Objects
Monitoring Changes Using PropertyFilter
SearchIndex
When to Use Which
CHAPTER 5: INTRODUCING VI JAVA API
Challenges with the VI SDK
Lack of Managed Object Types
Confusing Method Signatures
Extra Long Code for Its Purpose
Design Objectives
Architecture Overview
Layered Structure
Object Hierarchy
Yet Another Hello VM
How to Use the VI Java API
Typical Application Flow
Switching Between the API and Web Services
Getting Help
Key Managed Object Types
ManagedObject
ServerConnection
ServiceInstance
ExtensibleManagedObject
ManagedEntity
Utility Classes
MorUtil
InventoryNavigator
Other Classes
High-Performance Web Services Engine
Motivation
Architecture
CHAPTER 6: MANAGING INVENTORY
Inventory Hierarchical Structure
Managed Entities
ManagedEntity
Folder
Datacenter
Basic Inventory Operations
Adding a Folder or a Datacenter
Deleting an Existing Entity
Renaming an Existing Entity
Moving Existing Entities
Managing Custom Fields
Using Views
ViewManager
View and ManagedObjectView
ContainerView
InventoryView
ListView
Sample Code
CHAPTER 7: MANAGING HOST SYSTEMS
HostSystem Managed Object
Retrieving Information
Host Capabilities
Runtime Information
Configuration
Hardware Information
Quick Summary
Power Management
Querying the Memory Requirement for Virtual Machines
Managing Connections
Configuring the Host
Configuring Auto Start/Stop of Virtual Machines
Managing the Time of the Host
Configuring the Booting Device
Configure the Diagnostic Partition
Configuring the CPU Scheduler
Managing Firmware
Managing the Health Status
Managing the Host Memory
Patch Management
CHAPTER 8: MANAGING VIRTUAL MACHINES, SNAPSHOTS, AND VMOTION
Virtual Machine
Files of a Virtual Machine
VirtualMachine Managed Object
Retrieving Information
Virtual Machine Capabilities
Virtual Machine Configuration
Runtime Information
Guest Operating System Information
Quick Summary
Virtual Machine File Layout
Resource Allocation
Reconfiguring Virtual Machine
Power Operations
Managing the Virtual Machine Life Cycle
Creating a New Virtual Machine
Registering a Virtual Machine
Cloning a Virtual Machine
Destroying a Virtual Machine
Converting To/From Templates
Upgrading a Virtual Machine
Unregistering a Virtual Machine
Managing the Guest Operating System
Upgrading VMware Tools
Customizing the Guest OS
Managing the Customization Spec
Managing Virtual Machine Snapshots
Snapshot Hierarchy
Creating, Restoring, and Removing Snapshots
VirtualMachineSnapshot Managed Object
Migrating Live Virtual Machines (VMotion)
Storage VMotion
CHAPTER 9: MANAGING CLUSTERS AND RESOURCE POOLS
Managing Resources with ResourcePool
Virtual Resource Management Basics
ResourcePool Managed Object
DRS and HA Clustering
High Availability
Distributed Resource Scheduler
ComputeResource Managed Object
ClusterComputeResource Managed Object
Managing Clusters
Creating a New Cluster
Adding Hosts to a Cluster
Reconfiguring a Cluster
Removing a Host from a Cluster
Removing a Cluster
Interacting with the DRS Cluster
Querying the Environment for Virtual Machines
CHAPTER 10: MANAGING NETWORKING
Key Concepts
Virtual Switch
Port Group
Virtual NIC
HostNetworkSystem Managed Object
Properties
Overview of Methods
Managing Virtual Network Components
Adding a Virtual Switch
Adding a New Port Group to a Virtual Switch
Adding a Virtual NIC (VNIC)
Managing Service Console Networking
Configuring the Host Networking
Changing the IP Routing Configuration
Changing the DNS Configuration
Changing the Network Configuration
Defining the Host Network Policy
Network Managed Object
Managing SNMP with HostSnmpSystem
Managing the Firewall with HostFirewallSystem
Managing Network Services with HostServiceSystem
Configuring VMotion Network Using HostVMotionSystem
CHAPTER 11: MANAGING STORAGE AND DATASTORES
Key Concepts
SCSI
SAN
iSCSI
HBA
VMFS
NAS
HostStorageSystem Managed Object
HostStorageDeviceInfo
HostFileSystemVolumeInfo
Discovering HBAs
Managing iSCSI
Manipulating Discovery List
Configuring iSCSI
Managing Disk Partitioning
Managing the VMFS File System
Managing Storage Multipath
Managing Datastores Using HostDatastoreSystem
Creating a New Datastore
Extending a VMFS Datastore
Removing an Existing Datastore
Managing the Swap Datastore
Configuring the Datastore Principal
Datastore Managed Object
Search Datastore with HostDatastoreBrowser
Managing Datastores with FileManager
Managing Virtual Disks with VirtualDiskManager
CHAPTER 12: EVENTS AND ALARMS
Event Data Object
EventManager Managed Object
Retrieving Historical Events with EventHistoryCollector
HistoryCollector Managed Object
EventHistoryCollector Managed Object
Alarm Managed Object
Triggering Conditions
Follow-Up Actions
Reconfiguring an Alarm
Removing an Alarm
AlarmManager Managed Object
Creating a New Alarm
Finding Existing Alarms
Getting Alarm State
CHAPTER 13: PERFORMANCE MONITORING
Basic Terminologies
Performance Counter
Performance Metric
Intervals
Real-Time versus Historical Performance Statistics
PerformanceManager Managed Object
Querying Performance Metadata
Querying Performance Statistics
Using the queryPerf Method
Using the queryPerfComposite Method
Monitoring Performance in Real Time
Configuring Historical Intervals
CHAPTER 14: TASK AND SCHEDULED TASK
Task Managed Object
Monitoring a Task
Canceling a Task
Fixing Task Timeout
TaskManager Managed Object
Retrieving Historical Tasks with TaskHistoryCollector
ScheduledTask Managed Object
ScheduledTaskManager Managed Object
Specifying Task Schedule
Specifying an Action
CHAPTER 15: USER AND LICENSE ADMINISTRATION
Security Model
Privileges
Roles
Permissions
AuthorizationManager Managed Object
Managing Roles
Managing Permissions
Querying Permissions
Looking Up Users with UserDirectory
Managing ESX Users with HostLocalAccountManager
Managing Sessions Using SessionManager
License Management
CHAPTER 16: EXTENDING VI CLIENT
VMware Infrastructure Extensibility Story
ExtensionManager Managed Object
How a VI Client Plug-In Works
Understanding Extension Configuration
Registering and Managing Your Plug-In
Developing Your Backend Web Application
Parsing Information from the VI Client
Connecting Back to the VirtualCenter
Security Discussion
CHAPTER 17: SCRIPTING THE VI SDK WITH JYTHON, PERL, AND POWERSHELL
Scripting with Jython
What Is Needed?
HelloVM.py
Further Discussion
VI Perl Toolkit
Installing VI Perl Toolkit
HelloVM.pl
Application Flow Using VI Perl
Perl View Objects for Managed Entities
Using Data Objects
Working with Non-Entity View Objects
Further Reading
VI Toolkit (for Windows)
Installing VI Toolkit (for Windows)
Common Cmdlets
Cmdlet Pipeline
Running the Cmdlets in a Script File
Web Service Access Cmdlets
Further Reading
CHAPTER 18: ADVANCED TOPICS
Managing Global Settings with OptionManager
Collecting Logs Using DiagnosticManager
Sharing Sessions Among Different Applications
Getting the Session ID
Using Session ID
Further Discussion
Using Single Sign-On from the VI SDK to CIM
Downloading and Uploading Files Using HTTP Access
Multithreading with the VI SDK
Versioning
Namespace
Compatibility
API Deprecation
Following Best Practices for Performance and Scalability
Considering Internationalization
APPENDIX A: THE MANAGED OBJECT TYPES
APPENDIX B: THE PERFORMANCE COUNTERS
APPENDIX C: CMDLETS IN THE VI TOOLKIT (FOR WINDOWS)
APPENDIX D: UNIFIED MODELING LANGUAGE
Class Diagram
Visibility
Inheritance/Generalization
Association
Object Diagram
Modeling XML
APPENDIX E: VI SDK WEB SERVICES
SOAP
Two WSDL Files
Stub Code Generation
From Managed Object to WSDL to Generated Stub
APPENDIX F: WHAT IS NEW IN VSPHERE 4 SDK?
Changes of Existing APIs
Profile Management
Distribute Virtual Switch
Host Management
OVF Support
VirtualApp Support
New Compatibility Checkers
Licensing Change
Localization Support
Resource Planning
Migrating Your Existing Applications
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X-Y-Z
ptg5934432From the Library of Lee Bogdanoff
V M W A R E ® V I A N D V S P H E R E S D K ptg5934432From the Library of Lee BogdanoffDownload at WoweBook.Com
This page intentionally left blank ptg5934432From the Library of Lee BogdanoffDownload at WoweBook.Com
V M W A R E ® V I A N D V S P H E R E S D K M A N A G I N G T H E V M W A R E I N F R A S T R U C T U R E A N D V S P H E R E STEVE JIN Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Cape Town • Sydney • Tokyo • Singapore • Mexico City ptg5934432From the Library of Lee BogdanoffDownload at WoweBook.Com
Editor-in-Chief Karen Gettman Acquisitions Editor Jessica Goldstein Development Editor Sheri Cain Managing Editor Kristy Hart Project Editor Jovana San Nicolas- Shirley Copy Editor Karen A. Gill Indexer Erika Millen Proofreader Williams Woods Publishing Services Publishing Coordinator Chuti Prasertsith Jake McFarland The author works for VMware as a senior member of the technical staff. The opinions expressed here are the author's personal opinions. Content published here was not read or approved in advance by VMware and does not necessarily reflect the views and opinions of VMware. This is the author's book—not a VMware book. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The author and publisher have taken care in the preparation of this book but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact U.S. Corporate and Government Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside the United States, please contact International Sales international@pearson.com Visit us on the Web: informit.com/ph The Library of Congress Cataloging-in-Publication data is on file. Copyright © 2010 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to: Compositor Romny French Cover Designer Pearson Education, Inc. Rights and Contracts Department 501 Boylston Street, Suite 900 Boston, MA 02116 Fax (617) 671-3447 The VMware VI SDK is Copyright © 2008 VMware, Inc. All Rights Reserved. The VI Java APIs are open-source software and are governed by the BSD license. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ISBN-13: 978-0-137-15363-3 ISBN-10: 0-137-15363-5 Text printed in the United States on recycled paper at R.R. Donnelly in Crawfordsville, Indiana. First printing September 2009 ptg5934432From the Library of Lee BogdanoffDownload at WoweBook.Com
To Maggie and Melody ptg5934432From the Library of Lee BogdanoffDownload at WoweBook.Com
This page intentionally left blank ptg5934432From the Library of Lee BogdanoffDownload at WoweBook.Com
Table of Contents PREFACE XIX CHAPTER 2: VI SDK BASICS 16 CHAPTER 1: VMWARE INFRASTRUCTURE OVERVIEW 1 Introducing OS Virtualization 1 What Virtualization Is 1 History of Virtualization 3 Benefits 5 Solutions 7 VMware Products 8 VMware Infrastructure 9 ESX Server 10 VirtualCenter Server 12 VI Client 12 VMware Management APIs 12 VI SDK 13 CIM APIs 14 VIX API 14 GuestSDK 14 VMware VMCI 15 Legacy APIs 15 Other APIs 15 Overview of the VI SDK 16 What Is Included in VI SDK 2.5? 17 Object Model 17 Unified Interface with Different Support 18 Managed Objects 19 Inheritance Hierarchy 19 Inventory Hierarchy 21 Properties 21 Methods 24 Synchronous versus Asynchronous Methods 26 30 ManagedObjectReference 27 Data Objects Property Path Notation 33 Enumeration Types 34 Fault Types Using Tools to Become Familiar 35 with Object Model 37 VI Client 38 Web Access Managed Object Browser (MOB) 42 vii 41 ptg5934432From the Library of Lee BogdanoffDownload at WoweBook.Com
分享到:
收藏