S DK 40 Programming Guide
S DK 40 Programming Guide
S DK 40 Programming Guide
EN-000145-00
You can find the most up-to-date technical documentation on the VMware Web site at: http://www.vmware.com/support/ The VMware Web site also provides the latest product updates. If you have comments about this documentation, submit your feedback to: docfeedback@vmware.com
2009 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents. VMware, the VMware boxes logo and design, Virtual SMP, and VMotion are registered trademarks or trademarks of VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies.
VMware, Inc.
Contents
AboutThisBook
1 IntroductiontotheVirtualDatacenter 11
VirtualizationandVMwarevSphereComponents 11 SummaryofNewFeaturesforDevelopersUsingtheSDK 12 NewManagedEntities 13 SupportforPreviousAPIsinvSphere4.0 13 InteroperabilityofSDK2.5ClientsandvSphere4.0Servers 13 ClientLibrariesandExistingSDK2.5ClientApplications 14 ModifyingVISDK2.5basedClientApplicationstousevSphereAPI4.0Features 14
2 vSphereObjectModel 15
UsingtheVMwarevSphereClienttoExploretheObjectModel 15 UsingtheManagedObjectBrowsertoExploretheObjectModel 16 AccessingtheMOB 17 NavigatingtheObjectModelintheMOB 17 UnderstandingtheServiceContentDataObject 18 UnderstandingtheObjectModelasDataStructures 21 UnderstandingtheUnifiedModelingLanguageUsedinthisGuide 21 TheManagedObjectTypeasDataStructureandServiceInterface 22 ServiceInstanceManagedObjectasStartingPointtoOtherServiceInterfaces 23 ReferencestoManagedObjects 24
3 UnderstandingtheInventory 25
OverviewofManagedEntities 25 UnderstandingContainerObjectsandtheInventory 26 FolderasContainer 27 InventoryObjectsandPrivileges 28 FolderasFactory 30 vCenterServerandUnmanagedESX/ESXiHostInventories 30
4 OverviewofUserModelsandServerAccessControlConcepts 33
IntroductiontoAuthenticationandAuthorization 33 UnderstandingSystemPrivileges 34 PrivilegesDefinedinthevSphereAPIReference 34 HTTPBasedFileAccessandPrivileges 34 OverviewofESX/ESXiUserModel 35 UsingHostLocalAccountManagerManagedObject 35 OverviewofvCenterServerUserModel 36 EnablingSingleSignonSupportandIntegrationwithMicrosoftActiveDirectory 37 ObtainingInformationaboutUsersandGroupsfromUserDirectory 37 AuthenticatingUsersthroughSessionManager 39 OverviewoftheAuthorizationManager 39 UsingRolestoConsolidateSetsofPrivileges 40 ModifyingSampleRolestoCreateNewRoles 42
VMware, Inc.
5 vSphereAPIProgrammingModel 45
APIasaWebService 45 APIDefinedinWSDLFile 45 ClientApplicationCharacteristics 46 AsynchronousClientServerApplicationStyle 46 DistributedObjectOrientedApplicationStyle 46 ObtainingManagedObjectReferences 49 DoNotStoreManagedObjectReferenceValues 49 WorkingwithDataStructuresinClientApplicationCode 49 AccessingPropertyValues 49 AccessingtheAPIontheWebService 50 UsingthevSphereAPIReference 51 IdentifyingDeprecatedItemsinthevSphereAPIReference 51 IdentifyingVersionInformationinthevSphereAPIReference 51 MappingtheWSDLtotheClientsideProxyCode 51 ObtainingValuesfromNestedProperties 52 MappingXMLDatatypestoJavaandC#Datatypes 53 EscapeCharacterUsedinNameandPathProperties 53 InvokingOperationsthroughtheMOB 53 PassingPrimitiveDatatypestoOperationsthroughtheMOB 54 PassingArraysofPrimitivestoOperationsthroughtheMOB 54 PassingComplexStructurestoOperationsthroughtheMOB 54
6 ClientApplicationPattern 59
MinimalClientApplicationPattern 59 ConnectingtotheWebService 59 ObtainingaSessionTokenandCreatingaConnectionObject 59 LoggingIntotheServer 60 ClosetheServerConnection 60 OverviewofaJavaSampleApplication 61 SavingandReusingaWebServerSessionTokenorCookie 63 SupportingMultipleAPIVersions 63 IdentifyingtheAPIVersionSupportedbytheServer 64 HelperClassesforSampleApplications 64 JavaHelperClasses 65 C#HelperClasses 65
7 AutomatingClientApplicationLogin 67
IntroductiontotheCredentialStore 67 OverviewoftheCredentialStoreBackingFile 68 CredentialStoreBackingFileStructure 68 UsingSamplestoUnderstandtheCredentialStore 69 SecurityBestPracticesandtheCredentialStore 69 UsingthePrincipleofLeastPrivilegewiththeCredentialStore 69 UsingtheCredentialStoreAdminTool 70 UsingAuthorizationManagertoLimitAccess 70 CreatingNewUserAccounts 70 ApplyingPermissiontoanEntity 71
VMware, Inc.
Contents
8 ObtainingReferencestoObjectsandPropertyValuesfromtheServer 73
SampleCodeReference 73 IntroductiontothePropertyCollector 74 PropertyCollectorOperations 74 UnderstandingthePropertyFilterSpec 75 TraversalSpecDataObjectandRecursion 76 RetrievePropertiesOperation 76 CreateFilterandUpdateOperations 77 KeepingClientDatainSynchwithServerObjects 78 PropertyCollectorPerformance 79 ImprovingCollectionPerformancebyUsingtheViewManagerandView Objects 79 UsingtheSearchIndextoObtainManagedObjectReferences 80
9 OverviewoftheTaskInfrastructure 83
SampleCodeReference 83 UnderstandingTaskManagerandTaskManagedObjects 84 UnderstandingtheTaskInfoDataObject 85 MonitoringTaskInfoProperties 88 CancellingaTask 88 UsingtheTaskManagertoObtainInformationaboutTasks 88 ObtainingInformationaboutRecentTasksUsingaPropertyCollector 89 OperationsThatReturnTaskManagedObjects 90 IntroductiontotheEventDataObject 92
10 WorkingwithVirtualMachines 93
SampleCodeReference 93 CreatingVirtualMachines 93 OverviewofVirtualMachineOperations 94 OverviewofSnapshots 97 CreatingSnapshots 97 RevertingtoSnapshots 97
11 ManagingStorage 99
SampleCodeReference 99 OverviewofPhysicalandVirtualStorageConcepts 99 RequirementsforStorage 100 OverviewofInternetSCSIStorage 101 IntroductiontoManagedObjectsthatSupportStorage 101 IntroductiontotheHostStorageSystemManagedObject 102 IntroductiontotheHostDatastoreSystemManagedObject 106 ObtainingInformationaboutConfiguredStorage 107 CreatingNewDatastores 108 ModifyingDatastoreConfiguration 110
12 MonitoringPerformance 111
SampleCodeReference 111 IntroductiontoPerformanceManager 112 OverviewofCounterGroupsandthePerfCounterInfoDataObject SamplingPeriodsandIntervals 114 ObtainingStatistics 115 112
VMware, Inc.
13 UsingvCenterServerforVirtualMachineOperations 119
SampleCodeReference 120 OverviewoftheVirtualMachineManagedObjectType 120 UsingTemplatestoDeployStandardVirtualMachines 124 CreatingTemplates 124 RevertingaTemplatetoItsActiveVirtualMachineStatus 125 MigratingVirtualMachinesUsingVMotion 125 CheckingtheValidityofaMigrationInAdvance 126 UsingtheMigrateVM_TaskOperation 126 MovingStorageDynamicallyUsingStorageVMotion 127
14 EventandTaskManagementUsingvCenterServer 129
SampleCodeReference 129 UnderstandingEventManagerandtheEventDataObject 129 EventManagerManagedObject 130 EventDataObjects 130 FormattingEventMessageContent 131 CreatingCustomEvents 132 ObtainingInformationaboutEventsUsingaHistoryCollector 133 OverviewofHistoryCollectorManagedObjects 133 NewObjectsAppendedtoaHistoryCollector 135 DeletingaHistoryCollector 135
15 UsingtheAlarmInfrastructure 137
SampleCodeReference 137 OverviewofAlarmManagerandAlarmManagedObjects 137 ObtainingaListofAlarms 138 DefininganAlarm 138 OverviewoftheAlarmSpecDataObject 139 OverviewoftheAlarmExpressionDataObject 139 OverviewoftheAlarmActionDataObject 141 DeletingorDisablinganAlarm 142
16 SchedulingvCenterServerOperations 143
SampleCodeReference 143 ScheduledTaskManagerManagedObject 143 RetrievingScheduledTasksforaSpecificManagedEntity 144 CreatingaScheduledTaskObject 144 DefiningtheScheduleforthevCenterServerOperation 145 DefiningtheActions 146 SchedulingRecurringOperations 146 DeletingaScheduledTask 148
A ManagedObjectPrivilegesReference 149
PrivilegesRequiredtoInvokeOperations 149 PrivilegesRequiredtoReadProperties 156 PrivilegesDefinedfortheAdministratorRole 158
VMware, Inc.
Contents
B DiagnosticsandTroubleshooting 161
BestPracticesforTroubleshooting 161 OverviewofConfigurationFilesandLogFiles 162 ESXLogFile 163 VirtualMachineLogFiles 163 vCenterServerLogFiles 164 ModifyingtheLogLeveltoObtainDetailedInformation 164 LogLevelSettings 165 SettingtheLogLevelonESXSystems 165 GeneratingLogs 166 SettingtheLogLevelonvCenterServerSystem 167 UnderstandingandUsingtheDiagnosticManager 167 UsingtheMOBtoExploretheDiagnosticManager 169 GeneratingDiagnosticBundles 171
C DeployingClientApplications 173
UnderstandingtheClientApplicationDeploymentModel 173 CredentialStoreAdministrationToolforNonInteractiveClients 173 GuidelinesforUsingtheCredentialStoreAdminTool 173 CredentialStoreAdminToolandtheBackingFile 174
Index 177
VMware, Inc.
VMware, Inc.
Revision History
Thisguideisrevisedwitheachreleaseoftheproductorwhennecessary.Arevisedversioncancontainminor ormajorchanges.Table 1summarizesthesignificantchangesineachversionofthisguide. Table 1. Revision History
Revision 20090507 Description FirstversionofthevSphereWebServicesSDK4.0ProgrammingGuide.
Intended Audience
ThisbookisintendedforanyonewhoneedstodevelopapplicationsusingtheVMwarevSphereWebServices SDK.vSphereWebServicesSDKdeveloperstypicallyincludesoftwaredeveloperscreatingclientapplications usingJavaorC#(intheMicrosoft.NETenvironment)targetingVMwarevSphere.
Document Feedback
VMwarewelcomesyoursuggestionsforimprovingourdocumentation.Sendyourfeedbackto docfeedback@vmware.com.
VMware, Inc.
Support Offerings
TofindouthowVMwaresupportofferingscanhelpmeetyourbusinessneeds,goto http://www.vmware.com/support/services.
10
VMware, Inc.
VMware, Inc.
11
WithitsVMwarevSphereproductsuite,VMwarevirtualizesalllayersofanITinfrastructure,fromnetworks, storage,laptopanddesktopcomputers,toserverhardware,operatingsystems,andapplications. VMwarevSphereincludesESX/ESXi,vCenterServer,andseveraladditionalserverproductsfordistributed resourcemanagement(DRS),disasterrecovery,andhighavailability(HA)(Figure 11). ESX/ESXiprovidesthefoundationhypervisorcapableofsupportingmultiplevirtualmachinesandother virtualcomponents,suchasstorageandnetworks. vCenterServerisadatabasebackedWindowsservicethatprovidescentralmanagementformultiple ESX/ESXisystems. IfyouarenewtoVMwarevSphereornewtotheVMwarevSphereWebServicesSDK,seeoneoftheseguides formorebackgroundinformationaboutvSphere: IntroductiontoVMwarevSphere vSphereBasicSystemAdministration ESXConfigurationGuideandESXiConfigurationGuide vSphereResourceManagementGuide FormoreinformationaboutESX/ESXiandvCenterServer,seetheVMwarevSpheredocumentationpageon theVMwarewebsite.
12
VMware, Inc.
TheVirtualApp,DistributedVirtualSwitch,andDistributedVirtualPortgrouparenewmanaged entitieswithmanyassociateddataobjects,faulttypes,andenumerationstosupportthem.SeethevSphereAPI Referencefordetails. Virtualized Application Services AVirtualizedApplicationService(VirtualApp)isacontainerforoneormorevirtualmachines.AVirtualApp allowsanapplicationtobemanagedasaunit,includingpoweroperations,cloneanddeployoperations, resourceallocation,andmonitoring.vCenterServersupportscreating,running,importing,andexporting virtualizedapplicationsasfilesusingtheindustrystandardOpenVirtualizationFormat(OVF)1.0.
Modifying VI SDK 2.5-based Client Applications to use vSphere API 4.0 Features
TomodifyanSDK2.5clientapplicationtoincorporatenewAPI4.0functionality,youmustusetheclient libraries(vim25.jar)fromtheVMwareWebServicesSDK4.0package. Inaddition,youmustcheckyourexistingcodeforoperationsanddataobjectsthatmightcontainnew parametersandpropertiesinvSphereAPI4.0.Manyofthedataobjectsavailableinpreviousversionsofthe APIhavenewpropertiesinvSphereAPI4.0.Forexample,theEventdataobjecthasseveralnewpropertiesto supportmanagedobjectreferencestonewmanagedentitiesassociatedwithanEvent,suchasthe DistributedVirtualSwitch. Inaddition,manyoperationshavenewparametersinthisrelease.Forexample,theoperationslistedin Table 11wereavailableinVIAPI2.5andhavenewparametersinvSphereAPI4.0. Table 1-1. Operations with New Parameters in vSphere API 4.0
Operation addHost_Task addStandaloneHost_Task createTask extendVirtualDisk_Task findByUuid Operation queryVmfsDatastoreExtendOptions relocateVM_Task revertToCurrentSnapshot_Task revertToSnapshot_Task updateInternetScsiAuthenticationProperties
IfyourexistingVISDK2.5basedclientapplicationusesanyoftheoperationslistedinthetable,youmust modifythecodetopassnullforthe4.0specificparameter,asshowninthecodesnippetinTable 12. Table 1-2. Example of Modified Code for New Parameter
Original Code ...revertToSnapshot_Task(snapmor,null) Modified Code ...revertToSnapshot_Task(snapmor,null,null)
SeethevSphereAPIReferenceforcompleteinformationabouttheseoperations.
14
VMware, Inc.
AswithphysicalITinfrastructurecomponents,virtualinfrastructurecomponentsmustbeprovisioned, deployed,monitored,andmanaged.TheVMwarevSphereobjectmodelisacomprehensivesetofrobust serversidecompositeobjectsthatprovidesthecompletemanagementcapabilities. Theobjectmodelincludesserviceinterfacesformanaging,monitoring,configuring,obtaininginformation, andcontrollinglifecycleoperationsassociatedwithvirtualinfrastructure,andobjecttypesthatinstantiatethe virtualcomponentsontheserveratruntime. Externalclientapplicationsaccessthismanagementframework,theVMwarevSphereobjectmodel,through thevSphereAPI,whichisavailablethroughtheWebserviceonESX,ESXi,andvCenterServersystems.Client applications,boththirdpartyandVMwareclientapplicationssuchasVMwarevSphereClient,usethe vSphereAPItoperformalllifecycle,management,andmonitoringoperations. UnderstandingthevSpheremanagementobjectmodeliskeytousingtheVMwarevSphereAPIforsuccessful clientapplicationdevelopmentandintegration.Thechapterincludesthesetopics: UsingtheVMwarevSphereClienttoExploretheObjectModelonpage 15 UsingtheManagedObjectBrowsertoExploretheObjectModelonpage 16 UnderstandingtheObjectModelasDataStructuresonpage 21
Figure 21andFigure 22highlightsomeofthedifferencesbetweenvCenterServerandESX/ESXi.Figure 21 showshowtheinventoryofanESX/ESXisystemdisplays,intheleftpane. Intermsofmanagementservices,vCenterServerprovidesadditionalservicecapabilitiesandadministrative functions.Forexample,vCenterServersupportsScheduledTasks,Events,andMaps(notetheseiconsinthe menubarofFigure 22),whileESXorESXidoesnot(seethemenubaroftheESXinstanceshownin Figure 22). Figure 2-2. vSphere Client Connected to a vCenter Server System
16
VMware, Inc.
Youllbenotifiedthattheobjectbrowserrequiresausernameandpassword,withapromptrequiringa usernameandpassword. 3 Entertheuseraccountandpasswordfortheserversystem.Typically,thisisroot/<password>forthe ESX/ESXisystem,andAdministrator/<password>forvCenterServersystem. SomepreliminarywarningmessagesregardingtheauthorityoftheSSLcertificate,suchasWebsite Certified by an Unknown Authoritymightdisplayassumingthatthedefaultservercertificate providedbyVMwarehasnotbeenreplaced.Thespecificmessagetextvariesbywebbrowser. DisregardsuchwarningsandcontinuetologintotheMOB,aslongasVMwareisthecertificateauthority. IMPORTANTIftheESX/ESXiorvCenterServersystemhasbeenconfiguredtosupportregularHTTP (nonSSL)connections,apromptforusernameandpassworddoesnotdisplay,nordoany SSLcertificaterelatedwarnings. UnlikewiththevSphereClient,theMOBrevealstheunderlyingstructuresoftheVMwarevSphere managementobjectmodel,whichcanbeveryusefultodeveloperstryingtounderstandtheobjectmodel. UsedinconjunctionwiththevSphereAPIReference,theMOBcanhelpyougainafairlycomplete understandingofthemodel.
VMware, Inc.
17
content
ServiceContentdataobject
serverClock
xsd:dateTime
YoucanusetheMOBtodirectlyexaminetherelationshipsamongobjectsbylookingatthepropertiesandtheir valuesandthenclickingthelink,ifoneisavailable,inthevaluecolumnofthepage.Forexample,tofindout moreaboutServiceContent,clickonthecontentlinktodisplaytheServiceContentdataobjectinstance (Figure 24). FromtheServiceContentpage,youcanclickonthelinksintheValuecolumntodisplaythecontentsofthe associatedobjects.Forexample,clickontheaboutlinktodisplaythecurrentvalueoftheaboutproperty, whichdisplaysthecontentoftheAboutInfodataobjectforthisserver.However,mostobjectscontainmany otherobjectsandnestedobjects. AccesstotheinventorybeginsfromtherootFolderpropertyofServiceContent.(Theinventoryiscovered inmoredetailinChapter 3,UnderstandingtheInventory,onpage 25.)
18
VMware, Inc.
Figure 24showsapartialServiceContentdataobjectdisplayedintheMOBofavCenterServer4.0system. Figure 2-4. ServiceContent Data Object Contains References to Instances of Managed Objects
Table 22summarizestheServiceContentpropertynamesandvaluesforanexampleESXandvCenter Serversystem,sidebyside,asdisplayedintheMOB.TheexamplevalueslistedinTable 22aretheinstance namesfortheobjects.ThepropertiesthatdisplayanUnsetvalueindicatethatthemanagedobjecttypeisnot availableontheserver. Forexample,thepropertyforaccountManagerwhichhasareferencetoasingleton HostLocalAccountManagerobjectonESXsystemshasnovalueonvCenterServersystems,becausevCenter ServerusesWindowsuseraccountmanagementfacilities(suchasActiveDirectory). Conversely,thepropertyforalarmManageronESXisunset,becausealarmsarenotsupportedonan unmanagedhost.TheAlarminfrastructureismanagedbyvCenterServer.Manyothermanagedobjecttypes requirevCenterServer,includingthese: ClusterProfileManager DistributedVirtualSwitchManager ExtensionManager HostProfileManager HostSnmpSystem IpPoolManager LocalizationManager OvfManager ProfileComplianceManager ScheduledTaskManager VirtualMachineCompatibilityChecker VirtualMachineProvisioningChecker
VMware, Inc.
19
eventManager extensionManager fileManager hostProfileManager ipPoolManager licenseManager localizationManager ovfManager perfManager propertyCollector rootFolder scheduledTaskManager searchIndex sessionManager
haeventmgr Unset hanfcfilemanager Unset Unset halicensemanager Unset Unset haperfmgr hapropertycollector hafolderroot Unset hasearchindex hasessionmgr
EventManager ExtensionManager FileManager HostProfileManager IpPoolManager LicenseManager LocalizationManager OvfManager PerfMgr propertyCollector groupd1 ScheduledTaskManager SearchIndex SessionManager
20
VMware, Inc.
Table 2-2. ServiceContent Property Names, Return Types, and Values (Continued)
Example values Property name setting snmpSystem taskManager userDirectory viewManager virtualDiskManager vmCompatibilityChecker Type ManagedObjectReference: OptionManager ManagedObjectReference: HostSnmpSystem ManagedObjectReference: TaskManager ManagedObjectReference: UserDirectory ManagedObjectReference: ViewManager ManagedObjectReference: VirtualDiskManager ManagedObjectReference: VirtualMachineCompatibilit yChecker ManagedObjectReference: VirtualMachineProvisioning Checker ESX HostAgentSettings Unset hataskmgr hauserdirectory ViewManager havdiskmanager Unset vCenter Server VpxSettings SnmpSystem TaskManager UserDirectory ViewManager VirtualDiskManager CompatChecker
vmProvisioningChecker
Unset
ProvChecker
VMware, Inc.
21
NOTEThefiguresshowninthisguidehighlightvariouscharacteristicsoftheobjectmodelusingUML diagrams.Forthesakeofsimplicity,thesediagramsdonotincludecompletedetails.Forexample,alldata objecttypesextendtheDynamicDatadataobject.However,thebasepropertiesofDynamicDataarerarely relevantforthetopic,sothatobjectrelationshipistypicallynotshown. Inadditiontoclassdiagrams,thisguidealsoincludesseveralinstancediagrams,especiallyinthosesections thatdiscussnavigatingtheinventory,whichisbestexplainedinthecontextofactualobjectinstances.Many detailsareleftoutoftheinstancediagramsaswell. Thisguideusesthesetermsandabbreviationsinfiguresandtext. MOR.Managedobjectreference.Anopaquedataobjectthatisusedasaremotereferencetomanaged objects.Managedobjectreferencesarealsocalledreferencesintext,andmo_reforMoRefincodesamples. MOR>ManagedObjectType.Amanagedobjectreferenceidentifiesaspecificinstanceofaspecifictypeof managedobject,onaVMwarevSphereserver.TheabbreviationMOR>ManagedObjectspecifiesthetype ofmanagedobjectinstancetowhichagivenMORrefers.Thisnotationisusedthroughoutthisguideto replacethewordstoa,asinMORtoaVirtualMachine,orMORtoaHostDatastoreSystem.
22
VMware, Inc.
VMware, Inc.
23
Figure 2-7. The ServiceInstance Managed Object Type and Some of Its Properties
24
VMware, Inc.
ThevSphereinventorycontainsvirtualassets,includingdatacenters,hosts,virtualmachines,virtual applications,storage,networks,andsoon.AdministratorscanviewtheinventoryusingthevSphereClient. ThevSphereClientobtainsinformationaboutalltheobjectsintheinventoryofaserverandrendersthe informationintheGUI. Developerswhowanttocreateclientapplicationsmustunderstandthecomponentsthatmakeupthe inventory.Youmustunderstandtherelationshipofoneobjecttoanotherintheinventory,withrespecttothe theparentchildrelationshipsamonginventoryobjectsandthepermissionsmodel,amongotherdetails. This chaptercoversthebasics.Itincludesthesetopics: OverviewofManagedEntitiesonpage 25 UnderstandingContainerObjectsandtheInventoryonpage 26 InventoryObjectsandPrivilegesonpage 28 vCenterServerandUnmanagedESX/ESXiHostInventoriesonpage 30
TheManagedEntitymanagedobjecttypeisanabstracttype.Itincludesseveralpropertiesandoperationsthat areinheritedbyeachsubtype.
VMware, Inc.
25
Forexample,thename,effectiveRole,permission,andparentaresomeofthepropertiesdefinedinthe ManagedEntitybasetypethatareinheritedbyeachsubtype.Lifecycleoperationsfortheobject,suchas destroyinganobjectinstance,arealsopartoftheManagedEntitybasetype. Figure 3-2. Datacenter and Folder Managed Object Types Extend ManagedEntity
InadditiontothepropertiesandoperationsinheritedfromManagedEntity,eachsubtypehasitsown propertiesandspecialpurposeoperationsthatmodelitsexpectedbehavior.Forexample,aHostSystem managedobjecthasanEnterMaintenanceMode_Taskoperation.Theothermanagedentitiesdonot. Instancesofspecificmanagedentitiesarecreatedbyadministratorsusingvarioustools,includingvSphere Client.Somemanagedentitiesarecreatedwhentheserversoftwareisfirstinstalled.Forexample,a HostSystemmanagedentityexistsintheinventoryofanewlyinstalledESX/ESXisystem.Itisnotexplicitly created.TheHostSystemmanagedentitycontainsthephysicalcharacteristicsofanESX/ESXihostsystem. ThedataobjectsthatmakeupthepropertiesofaHostSystemmanagedentitycontainthespecificproperties oftheunderlyinghardwareanditscapabilities.Forexample,thevaluesofthecapabilitypropertyof HostSystemaresetduringinstallation,basedonthespecificsofthehardwareonwhichESX/ESXiisinstalled. AllotherentitiesinaninventoryareexplicitlycreatedusingthevSphereClientorotherclienttools,orby usingtheAPI.Theentitiesthatcancompriseanyspecificinventoryareconstrainedbythephysicalresources ofthehardwareandtherulesofcontainment,ownership,andotherpropertiesofthemanagedentitytypes andsubtypes.
26
VMware, Inc.
Folder as Container
TheFoldermanagedobjecttypeisthechiefcontainerobjectinaninventory.Containmentisconceptual,not literal,andreliesontheparentchildrelationshipamongtheobjectsasdefinedincertainpropertiesofactual instances.Specifically,everymanagedentityhasaparentpropertythatcanbeusedtoidentifyitsrelative positionintheinventoryhierarchy.Inaddition,theFoldermanagedobjecttypehasachildEntityproperty thatidentifiesobjectscontainedbythespecificfolderinstance. Figure 33showsaninstancediagramhighlightingthechildEntityandfolderpropertiesthatdefinethe defaultobjectsintheinventoryofanunmanagedESX/ESXisystem.Theinventorybeginsfromthe rootFolderpropertyoftheServiceContentdataobject.TherootFolderistherootnodeoftheinventory. IthasachildEntitythatconsistsofamanagedobjectreferencetoaDatacentermanagedobject. Figure 3-3. Instance Diagram of Root Folders in an Inventory
VMware, Inc.
27
Forexample,everyDatacenterobjectinaninventoryisguaranteedtohavefourspecificFolderobjects associatedwithit,oneeachfordatastores,networks,hosts,andvirtualmachines.ThefoldersforDatastore objectsandNetworkobjectsarenewasofvSphereAPI4.0.Thesefoldersareassociatedwiththe datastoreFolderandthenetworkFolderpropertiesofaDatacentermanagedobject(seealsoFigure 32 onpage 26). TheinventoryhierarchyshowninFigure 34,ParentChildAssociationsAmongInventoryObjects,on page 27includestherootfolderobject,aFolderobjectnamedha-root-folderhasachildEntitythatisa referencetoaDatacenter.TheVirtualMachineinstancewhoseIDis32isthechildEntityoftheFolder identifiedasha-folder-vm. Variousothernodesinthehierarchyarecalledrootnodesfortheirtypeofobject.Forexample,the ha-folder-datastore,ha-folder-host,ha-folder-network,andha-folder-vmareconsideredtheroot foldersforthetypeofentitiesthateachcontains.
SomeprivilegesarespecifictoobjectsonvCenterServerorESX/ESXionly.Forexample,theAlarm.Create privilegeisassociatedwithAlarmManager,whichistheserviceinterfaceforcreatingandmanagingalarms thatisavailablethroughvCenterServersystemsonly. Completeinformationaboutrequiredprivilegesfortheoperationsofamanagedentityisavailableinthe vSphereAPIReference. ToviewanypropertyofamanagedentitytypicallyrequirestheSystem.Viewprivilegeontherootfolderof theinventoryandtheSystem.Read privilegeonthespecificFolderandVirtualMachineobjects. Forexample,creatingavirtualmachinerequiresthattheprincipalassociatedwiththesessionhavethe followingprivileges: TheVirtualMachine.Inventory.Createprivilegeonthefolderinwhichtocreatethevirtualmachine TheResource.AssignVMToPoolprivilegeontheresourcepoolfromwhichthevirtualmachineobtains itsallocationofCPUandmemoryresources.
28
VMware, Inc.
ToreadtheperfCounterpropertyofthePerformanceManagermanagedobject,ausermusthavethe System.View privilegeontherootfolder. Achildentitytypicallyinheritsthepermissionsofitsparent.Ifyousetthepermissiononaparentobjectand setitspropagatepropertytotrue,thechildentitiesaccruethesamepermissionsettingastheparent.However, youcansetapermissiondirectlyonachildentitythatisdifferentthanitsparent. TheAuthorizationManagerserviceinterfaceprovidesoperationsforqueryingandsettingpermissions.See Chapter 4,OverviewofUserModelsandServerAccessControlConcepts,onpage 33formoreinformation aboutAuthorizationManager. Figure 3-5. A ManagedEntity Has One or More Permission Objects
ThePermissiondataobjectappliestothechildEntityassociatedwiththemanagedentitywhenthe propagatepropertyofPermissionissettotrue. Soforexample,inFigure 36thehafolderrootobjecthastwopermissionobjectsinthearraythatmakesup itspermissionproperty.Bothpermissionobjectshavetheirpropagateflagsettotrue.ThechildEntityof ha-folder-rootisha-datacenter,soha-datacenterinheritsthepermissionsofha-folder-root. AssigningpermissionstotheDatacenternodeandsettingthePermissionobjectspropagateflagsettotrue effectivelygrantspermissionattheDatacenterlevelandallchildentitiesthathaveaspecificDatacenter objectastheirparent. Figure 3-6. Inventory and Permissions
VMware, Inc.
29
Folder as Factory
TheFoldermanagedentityisafactoryobject.Itprovidesoperationsforcreatinginstancesofothermanaged entities,includingthefollowingtypes: Datacenters Distributedvirtualswitches Virtualmachines Clusters Folders ForanunmanagedESX/ESXisystem,theFoldermanagedentitydoesnotsupportcreatingadditionalFolder objectsorDatacenterobjects.
Datacenter
Multipleinstances supported.
Datastore DistributedVirtualSwitch
30
VMware, Inc.
Table 3-2. Comparison of Unmanaged ESX/ESXi and vCenter Server Inventories (Continued)
ManagedEntity Subtype Folder Description Containerobjectusedtoorganizevirtual machinesandhostsinaninventory. ESX/ESXi Inventory Exactlyoneonly. Cannotbe destroyed. Transparent. Exactlyoneonly. Multipleinstances supported. Multipleinstances supported. None. vCenter Server Inventory Multipleinstances supported.
Abstractionforasinglephysical machine. Abstractionforaphysicaloravirtual network(VLAN). Abstractionforphysicalresourcesthat canpartitionedintosmallerunitsforuse byvirtualmachines. Containerobjectforoneormorevirtual machinesandassociatedobjects packagedusingopenvirtualformat (OVF)1.0. Abstractionforavirtualmachine.
VirtualApp
VirtualMachine
Multipleinstances supported.
Multipleinstances supported.
VMware, Inc.
31
32
VMware, Inc.
VMwarevSphereimplementsmechanismstoensurethatonlyvaliduserscanaccessvirtualinfrastructure components.TheusermodelforESX/ESXisystemsisdifferentthantheusermodelforvCenterServer systems.Thischapterdiscussestheseusermodelsandthemanagedobjects(serviceinterfaces)thatprovide variousmechanismstosecurethesystem.Itincludesthesetopics: IntroductiontoAuthenticationandAuthorizationonpage 33 OverviewofESX/ESXiUserModelonpage 35 OverviewofvCenterServerUserModelonpage 36 ObtainingInformationaboutUsersandGroupsfromUserDirectoryonpage 37 AuthenticatingUsersthroughSessionManageronpage 39 OverviewoftheAuthorizationManageronpage 39 GrantingPrivilegesthroughPermissionsonpage 42
VMware, Inc.
33
AuthorizationManagerprotectsVMwarevSpherecomponentsfromunauthorizedaccess.Accessto componentsisrolebased:Usersandgroupsareassignedrolesthatencompasstheprivilegesneededto performoperationsonsomemanagedentities,ortoviewobjects.AuthorizationManagerhas operationsforcreatingnewroles,modifyinguserroles,settingpermissionsonentities,andhandlingall otheraspectsoftherelationshipmanagedobjectsandthepermissionsgrantedtoprincipals(users, groups)toaccessthem. UserDirectoryprovidesalookupmechanismthatreturnsuseraccountinformationto AuthorizationManagerortoanotherrequestor,suchasaclientapplication.SeeOverviewofESX/ESXi UserModelonpage 35formoreinformationabouttheUserDirectory. TheseservicesworktogethertoensurethatonlyauthenticateduserscanconnecttoESX/ESXiorvCenter Serversystems,andthattheycanaccessonlythoseobjectsfolders,virtualmachines,datacenters,virtual services,andsoonforwhichtheyhavetherequiredprivilegesandareauthorizedtouseortoview. Accessinganobjectmightmeanreadingapropertyvalue,orinvokinganoperation.Inmanycases,the privilegesrequiredtoreadapropertyvaluearelessrestrictivethantheprivilegesrequiredtoperform operations.Forexample,ausermightbeabletoseeavirtualmachineintheinventory,butmightnotbe allowedtocreateanewvirtualmachine.
34
VMware, Inc.
Becausetheobjectsbeingaccessedaredatastoreobjectsintheinventoryandtheseobjectsareassociatedwith aspecificfolderstructure,theprivilegesrequiredtoaccessthesefilesarethesameprivilegesrequiredtoobtain thesefilesusinganyothermechanism,suchasthevSphereClient. Table 4-2. Privileges Required for Datastore Objects Apply Regardless of Access Mechanism
Object associated with file Rootfolder Datacenter Portion of URL /folder ?dcPath Required privileges System.View Datastore.Browse Datastore.FileManagement Datastore &dsName Datastore.Browse Datastore.FileManagement Host /host /tmp/ Host.Config.AdvancedConfig Host.Config.SystemManagement
YoumustdefinetheHostAccountSpecdataobjectusingthecharacteristicsrequiredforthetargetsystem,as configuredbythesystemadministrator.Thesecharacteristicsincludepasswordlengthrequirements,restrict useofdictionarywords,andsoon. Inadditiontocreatinguseraccountsandgroups,HostLocalAccountManagerprovidesseveralother operations: AssignUserToGroup,whichassignsaspecifieduseraccounttoagroup. UnAssignUserFromGroup,whichremovesauserfromagroup.UseRetrieveUserGroupsfirstif necessary,toobtaingroupinformationfortheuseraccount. UpdateUser,whichallowsyoutomodifyinformation,includingpasswordanddescription,foran existinguseraccount.
VMware, Inc.
35
Table 43summarizestheAPIreferencedocumentationfortheseoperations.Forcompleteinformationabout HostLocalAccountManager,seethevSphereAPIReference. Table 4-3. HostLocalAccountManager Operations for User and Group Management
Operation AssignUserToGroup Parameter _this Type MOR > HostLocalAccountManager string Description Referencetothe HostLocalAccountManagerused tomakethecall. UserID(thegeneratednumber fromtheuserstoreofthehost system). Grouptowhichtheuseraccount (userID)isbeingadded. Referencetothe HostLocalAccountManagerused tomakethecall. Nameofuserbeingremovedfrom agroup. Groupfromwhichtoremoveuser. Referencetothe HostLocalAccountManagerused tomakethecall. Dataobjectthatcontains description,useraccountID,anda passwordfortheprincipalbeing updated.
user
string MOR > HostLocalAccountManager string string MOR > HostLocalAccountManager HostAccountSpecdataobject
user
Fordetails,seetheBasicSystemAdministrationguideintheVMwarevSpheredocumentationset.
36
VMware, Inc.
Enabling Single Sign-on Support and Integration with Microsoft Active Directory
OrganizationsthatareusingMicrosoftActiveDirectorycanleveragetheuseridentitiescontainedina Windows2003ServerdomaincontrollerorActiveDirectoryserviceacrosstheirvirtualinfrastructure,for clientsthatrunvSphereWebServicesSDKclientapplicationsfromWindowsbasedsystems. VMwarevSphereWebServicesSDKclientapplicationscanuseSSPItoauthenticatetothelocalmachineand thenestablisharemoteconnection.SeethevSphereAPIReferenceformoreinformation.
UserDirectoryprovidestwooperationsforobtaininginformationaboutusersandgroups: RetrieveCertificatePrincipals,whichreturnsanarrayofCertificatePrincipaldataobjects (principalsthatuseX.509certificatesforauthenticationtotheserver,ratherthanapassword). RetrieveUserGroups,whichcanobtainalistofalluseraccountsfromthehost,andcansearchfor specificusersorgroupsbasedonspecificcriteriatofiltertheresults: Byusername Bygroupname Foranexactmatch Forforapartialstring(substring) ForvCenterServer,searchislimitedtothespecifiedWindowsdomain.Ifthedomainisomitted,thesearchis performedonlocalusersandgroups. ForESXsystems,searchreturnsallusersandgroupsfromthepasswdfile.IfthisfilecontainsNetwork InformationSystem(NIS)orNIS+usersandgroups,RetrieveUserGroupsreturnstheseaccountsaswell. IMPORTANTDonotconfigureanESXorESXisystemtouseNISorNIS+,unlessitisacceptabletohaveNIS (orNIS+)userandgroupinformationavailablethroughtheRetrieveUserGroupsAPI.
VMware, Inc.
37
Figure 43showsthesetwodifferentusermanagementmechanismsassociatedwiththeVMwarevSphere server. Figure 4-3. Managed Objects for Handling Local User Accounts
RetrieveUser Groups
belongsToGroup
string
belongsToUser
string
38
VMware, Inc.
Uponsuccessfulauthenticationoftheuseraccount,theSessionManagerreturnsaUserSessiondataobject totheclientapplication.Thesessionisassociatedwiththatspecificuseraccountforthedurationofthesession. Theclientapplicationcansavethesessionlocally,toasecurefile,andreusethesessionlatertoreconnectto theserver.YoucanalsoconfigureanESX/ESXiorvCenterServersystemtosupportlocalsessions,which enableuserswithcredentialsonthehosttologinbasedonthoseprivileges. TheSessionManagerprovidesthesecapabilities: Loginandlogout.BasicoperationstologintoESXorvCenterServer,obtainasession,andlogout.When asessionterminates,allsessionspecificobjectsaredestroyed. Impersonation.Oneusersessionadoptstheauthorizationlevelofanotherusersession.Impersonationis commoninWebbasedscenariosinwhichamiddletierapplicationfunctionsasacentralaccountthat interactswithotherbackendserversorprocesses.Windowsservicesimpersonateaclientwhenaccessing resourcesonbehalfoftheclient.SesssionManagersupportsimpersonationthroughits ImpersonateUseroperation. Delegation.AclientapplicationexecutingonbehalfofalocalusercaninvoketheAcquireLocalTicket operationofSessionManagertoobtainaonetimeusernameandpasswordforloggingonwithout enteringasubsequentpassword.Delegationisusefulforhostbasedutilitiesthatruninthelocalconsole. Iftheuseraccountassociatedwiththesessiondoesnothaveappropriatepermissionstoperformanaction, theAuthorizationManagerreturnsaNoPermissionfaulttotheclientapplication.
VMware, Inc.
39
AuthorizationManageralsoprovidespropertiesthatcanbeusedtoobtaininformationfast.Forexample: TheprivilegeListpropertyreturnsthelistofallprivilegesdefinedonthesystem,asanarrayof AuthorizationPrivilegedataobjects.PrivilegesaredefinedbyVMware,onthevariousobjectsand propertiescontainedinthesystem.Theseprivilegesarefixedandcannotbechangedbyclient applications.SeeAppendix A,ManagedObjectPrivilegesReference,onpage 149forlistsofprivileges. TheroleListpropertyreturnslistofallcurrentlydefinedroles,includingthesystemdefinedroles,as anarrayofAuthorizationRoledataobjects. Youcanseethesepropertyvaluesforyourself,onyourESXorvCenterServersystem,bynavigatingtoyour theAuthorizationManagerusingtheMOBonyoursystem.SeeUsingtheManagedObjectBrowserto ExploretheObjectModelonpage 16formoreinformation.
40
VMware, Inc.
Anonymous NoAccess
4 5
ReadOnly
View Userroles (predefined samples) VirtualMachine Administrator Datacenter Administrator VirtualMachine Provider VirtualMachinePower User VirtualMachineUser ResourcePool Administrator VMwareConsolidated BackupUtility
3 1 2 3 4 5 6 7
Table 47listsseveralAuthorizationManageroperationsavailableformanagingroles. Table 4-7. AuthorizationManager Operations for Creating, Updating, and Deleting Roles
Operation AddAuthorizationRole Parameter _this Type MOR > AuthorizationManager Description Managedobjectreferencetothe serversAuthorizationManager obtainedthrough ServiceInstance. Nameforthenewrole. Listofprivilegestoassigntotherole intheformat: <group>[.<group>].privilege
name privIds
string string[]
VMware, Inc.
41
Table 4-7. AuthorizationManager Operations for Creating, Updating, and Deleting Roles (Continued)
Operation UpdateAuthorizationRole Parameter _this Type MOR > AuthorizationManager Description Managedobjectreferencetothe serversAuthorizationManager obtainedthrough ServiceInstance. Integerthatidentifiestheroletobe modified. Newnamefortherole. Stringarrayofprivilegestoassignto therole. Managedobjectreferencetothe AuthorizationManagerobtained fromtheServiceInstanceofthe server. Integerthatidentifiestherole.The roleIdisgeneratedby AddAuthorizationRolewhena newroleisdefined. Settotruetoensuretherolecannot beremovedifitisbeingused.
roleId
int
failIfUsed
boolean
42
VMware, Inc.
Tocompletelyreplaceexistingpermissionswithanewsetofpermissions,usetheResetEntityPermissions operation. Table 4-8. AuthorizationManager Operations for Setting, Changing, and Removing permissions
Operation SetEntityPermissions, ResetEntityPermissions Parameter _this Type MOR > AuthorizationManager Description Managedobjectreferencetothe servers(ServiceInstance) AuthorizationManager. Managedentityforwhichyouwant tograntordenyaccess. ArrayofPermissionobjectsthat defineaccessrulesfortheentity. Passinganemptyarrayremovesall permissionsfromtheentity.
entity
permission
VMware, Inc.
43
Table 4-8. AuthorizationManager Operations for Setting, Changing, and Removing permissions (Continued)
Operation RemoveEntityPermission Parameter _this entity Type MOR > AuthorizationManager MOR > ManagedEntity [HostSystem, Folder, ComputeResource...] Description Deletethepermissionfromanentity forspecifiedprincipal(user,group). Managedobjectreferencethat identifiesthemanagedentityfrom whichtodisassociateaPermission. UsetherootFoldermanagedobject referenceifthePermissionis associatedwithamanagedobjectthat isnotamanagedentity. Usethespecificmanagedentity subclasstype(Folder,Datacenter, andsoon)forPermissionbeing removedisassociatedwitha managedentity. user isGroup string boolean Principal(user,group)forwhichthe permissionsweredefined. Specifiesthattheuservalueisagroup (true)orasingleuser(false).
Permissionscannotbesetdirectlyonchildreninacomplexentity.Forcomplexentities,setpermissionsonthe parententityandsetthepropagateflagtotruetoapplypermissionstoitschildentities.
Permissionsareappliedtotheassociatedobjectsthatmakeuptheinventoryitem,fromthecontainingobject toeachofitschildentities.
44
VMware, Inc.
TheVMwarevSpheremanagementobjectmodelprovidesaserversideframeworkforprovisioning, instrumenting,managing,andmonitoringVMwarevSpherecomponents,suchasvirtualmachines,host systems,andvirtualizedapplications.ProgrammaticaccesstotheVMwarevSphereobjectmodeland managementframeworkfromaclientapplicationisthroughthevSphereAPI.Thischapterincludesthese topics: APIasaWebServiceonpage 45 ClientApplicationCharacteristicsonpage 46 AccessingtheAPIontheWebServiceonpage 50 UsingthevSphereAPIReferenceonpage 51 MappingtheWSDLtotheClientsideProxyCodeonpage 51 InvokingOperationsthroughtheMOBonpage 53
VMware, Inc.
45
Table 51listsallpossiblevalidstringsforthevaluepropertyofManagedObjectReference. Table 5-1. Valid Values for ManagedObjectReference Type Property
Type Property Alarm AlarmManager AuthorizationManager ClusterComputeResource ClusterProfile Refers to Alarmmanagedobject AlarmManagermanagedobject AuthorizationManagermanagedobject ClusterComputeResourcemanagedobject ClusterProfilemanagedobject
46
VMware, Inc.
Refers to ClusterProfileManagermanagedobject ComputeResourcemanagedobject ContainerViewmanagedobject CustomFieldsManagermanagedobject CustomizationSpecManagermanagedobject Datacentermanagedobject Datastoremanagedobject DiagnosticManagermanagedobject DistributedVirtualPortgroupmanagedobject DistributedVirtualSwitchmanagedobject DistributedVirtualSwitchManagermanagedobject EnvironmentBrowsermanagedobject EventHistoryCollectormanagedobject EventManagermanagedobject ExtensibleManagedObjectmanagedobject ExtensionManagermanagedobject FileManagermanagedobject Foldermanagedobject HistoryCollectormanagedobject HostAutoStartManagermanagedobject HostBootDeviceSystemmanagedobject HostCpuSchedulerSystemmanagedobject HostDatastoreBrowsermanagedobject HostDatastoreSystemmanagedobject HostDateTimeSystemmanagedobject HostDiagnosticSystemmanagedobject HostFirewallSystemmanagedobject HostFirmwareSystemmanagedobject HostHealthStatusSystemmanagedobject HostKernelModuleSystemmanagedobject HostLocalAccountManagermanagedobject HostMemorySystemmanagedobject HostNetworkSystemmanagedobject HostPatchManagermanagedobject HostPciPassthruSystemmanagedobject HostProfilemanagedobject HostProfileManagermanagedobject HostServiceSystemmanagedobject HostSnmpSystemmanagedobject HostStorageSystemmanagedobject HostSystemmanagedobject
47
Refers to HostVirtualNicManagermanagedobject HostVMotionSystemmanagedobject HttpNfcLeasemanagedobject InventoryViewmanagedobject IpPoolManagermanagedobject LicenseAssignmentManagermanagedobject LicenseManagermanagedobject ListViewmanagedobject LocalizationManagermanagedobject ManagedEntitymanagedobject ManagedObjectViewmanagedobject Networkmanagedobject OptionManagermanagedobject OvfManagermanagedobject PerformanceManagermanagedobject Profilemanagedobject ProfileComplianceManagermanagedobject ProfileManagermanagedobject PropertyCollectormanagedobject PropertyFiltermanagedobject ResourcePlanningManagermanagedobject ResourcePoolmanagedobject ScheduledTaskmanagedobject ScheduledTaskManagermanagedobject SearchIndexmanagedobject ServiceInstancemanagedobject SessionManagermanagedobject Taskmanagedobject TaskHistoryCollectormanagedobject TaskManagermanagedobject UserDirectorymanagedobject Viewmanagedobject ViewManagermanagedobject VirtualAppmanagedobject VirtualDiskManagermanagedobject VirtualizationManagermanagedobject VirtualMachinemanagedobject VirtualMachineCompatibilityCheckermanagedobject VirtualMachineProvisioningCheckermanagedobject VirtualMachineSnapshotmanagedobject VmwareDistributedVirtualSwitchmanagedobject
VMware, Inc.
VMware, Inc.
49
Torefertoanestedpropertyatanydepthinyourcode,usedotnotationbetweenthevariousobjectnamesto definethepathtotheproperty,beingawaretohandlethereturntypecorrectly.Thereturntypeobtained dependsonthedatatypeattheendofthepath. Forexample,thepropertydefinedatthepathsummary.config.guestIdisastringvalue,whiletheproperty definedaspathsummary.configreturnsacompleteVirtualMachineSummarydataobject. Table 52showsseveralexamplesofhowtoaccesssomeofthenestedpropertiesoftheVirtualMachine managedobjecttypeshowninFigure 52. Table 5-2. Nested Properties and Return Datatypes
Example summary summary.config summary.config.guestID Returns VirtualMachineSummarydataobject VirtualMachineConfigSummarydataobject string
Properties Defined as Key-Based Arrays and Indexed Arrays Nestedpropertiescanalsorefertopropertiesthatarekeybasedarrays.Forexample,a.b.c["xyz"]refersto thepropertycthathasthekeyvalueofxyz.Anarraypropertyisanypropertywhosetypeisanarray.The VMwarevSpheredatastructuresincludebothindexedarraysandkeybasedarrays. Indexedarraysareaccessedbyusinganindexinteger.Indexedarraysareusedforarraysofdatatypes whosepositioninthearraydoesnotchange.Forexample,theroleListpropertyofthe AuthorizationManagermanagedobjectisanarrayofauthorizationroles.Addinganewroletothe arraydoesnotchangethepositionofexistingelementsinthearray. Keybasedarraysareusedforinformationwhosepositionissubjecttochange.Akeybasedarray(same basicconceptasaPerlhash)usesaunique,unchangingvalueasakeytoaccessanelementsvalue. Typically,thekeyisspecifiedasastring,butintegerscanalsobeused.Forexample,Eventarraysuse integersaskeys. Nestedpropertiescanalsorefertopropertiesthatarekeybasedarrays.Forexample, a.b.c["xyz"]refers tothepropertycthathasthekeyvalueofxyz. TheVMwarevSpheremanagementobjectmodeluseskeybasedarraystokeeptrackofmanagedobject references.Thecontentsofakeybasedarraypropertyareaccessedbythevalueofeitherthekeypropertyor, inthecaseofamanagedobjectreference,itsvalueproperty.Thevalueofthesefieldsisuniqueacrossallthe componentsofanarray.
50
VMware, Inc.
ThevSphereWebServicesSDKincludestheWSDLthatdefinestheAPI. IMPORTANTThevSphereWebServicesSDKshipswithJavaclientsideproxycodethathasbeengenerated usingtheAxistoolkit.IftheversionsofJavaandAxisonyourdevelopmentplatformarethesameasthose usedtogeneratethestubsshippedintheSDK,youdonothavetogenerateclientsideproxycodefromthe WSDL.SeetheDevelopersSetupGuideforinformationaboutconfiguringadevelopmentenvironmentforthe vSphereWebServicesSDK. TheVMwareclientlibrariesmustbeimportedintoclientapplications(Table 53). Table 5-3. Import Statements for Including the vSphere API Client Library
Java import com.vmware.vim25.*; C# usingVimApi;
TheAPIisdocumentedinthevSphereAPIReference,whichisincludedintheVMwarevSphereWebServices SDKpackage.
VMware, Inc.
51
Table 54showsanexampleofthemethodsignaturesasdefinedintheJavaandC#clientproxycodeforthe AfterStartupTaskSchedulerdataobjectsminuteproperty. Table 5-4. Example of Generated Accessor and Mutator Methods in Client Proxy Code
Data Object AfterStartup TaskScheduler Property minute Type xsd:int Java public int getMinute() { return minute; } public void setMinute(int minute) { this.minute = minute; } C# public int minute { set; get; }
YoucanextrapolatefromthedocumentationintheVMwarevSphereAPIReferencetoidentifygetterandsetter methodsthatareavailabletoyourclientapplication,withoutexaminingthe*.java,*.cs,orothergenerated clientsidestubstofindtheactualmethods. Forexample,giventhattheManagedObjectReferencedataobjecttypehasatypeproperty,youcansafely assumethatyoucanassignavaluetoamanagedobjectreferencebyusingsetType,passingoneofthevalid stringvaluesasaparameter.YoucanobtainthestringvaluebyusinggetType. Table 55showssomevalidstringvaluesamanagedobjectreferencedataobjectcanacceptorreturn. Table 5-5. ManagedObjectReference Data Object Default Methods and Valid String Values
Property (Datatype) type (string) Default Getter Method getType Default Setter Method setType Valid values Alarm,"AlarmManager","AuthorizationManager", "ClusterComputeResource","ComputeResource", "ContainerView","CustomFieldsManager",andsoon. See completelistofsupportedvaluesinTable 51.
Asanotherexample,theServiceContentdataobjecthasanaboutpropertythatisdefinedasaninstanceof theAboutInfodataobjecttype.ByexaminingtheAPIReference,youseethattheAboutInfodataobjecthas severalotherproperties,includingapiVersionandapiType,bothofwhicharedefinedasxsd:stringdata types.Thesedetailsprovidethefollowinginformation: Theclientstubscontaingetterandsettermethodsfortheproperties(getApiVersion,setApiVersion, getApiType,setApiType). Thedatatypethatcanbeacceptedasinputtoandreturnedbythesemethodsisastring. ThemethodscanbeinvokedoninstancesoftheServiceContentobject. SeeChapter 6,ClientApplicationPattern,onpage 59formoreinformation.
52
VMware, Inc.
VMware, Inc.
53
Figure 54showstheresultsofsubmittingthequery.ThearrayofPerfCounterInfodataobjectsandnested objects,withpopulatedvaluesfromtheserver,displaysintheWebbrowser. Figure 5-4. Example of Returned Object Displayed in the MOB
Evenifyouwanttosubmitasinglevalueforasinglearrayelement,youmustwraptheparametername aroundthevalueinthisway.
54
VMware, Inc.
Simple Content ThedataobjecttypeManagedObjectReferenceisoneofthemostcommonlyrequiredparameterstobe passedtotheserver.Forexample,theMOBfortheQueryPerfProviderSummaryoperationin PerformanceManagershowsthattheoperationrequiresasingleparameter,themanagedobjectreference(an instanceofManagedObjectReference)oftheentityforwhichyouwanttoobtainthePerfProviderSummary object. UsingthevSphereAPIReferenceforManagedObjectReferencetype,youcanobtaintheschemainformation fromtheShowWSDLtypedefinitionlinkatthebottomofthedocumentationpagefor ManagedObjectReference. Example 5-1. XML Schema Definition of ManagedObjectReference Data Object
<complexType xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="ManagedObjectReference"> <simpleContent> <extension base="xsd:string"> <attribute name="type" type="xsd:string"/> </extension> </simpleContent> </complexType>
Figure 55showstheresultofusingthedefinitionlistedinExample 51tospecifythemanagedobject referenceforatargetdatacentertotheQueryPerfProviderSummaryoperation. Figure 5-5. Using the MOB to Pass Complex Types to an Operation as a Parameter
AlthoughbothexamplessubmitaManagedObjectReferencetotheMOB,eachisspecifictotheparameter namerequiredbytheoperation(entitytypeforQueryPerfProviderSummaryoperationin PerformanceManager,foldertypefortheCloneVM_TaskoperationinVirtualMachine). Complex Content Unlikethe<simpleContent>showninExample 51,manyofthedataobjectsrequiredfortheMOBconsist ofXMLSchemaelementsdefinedas<complexContent>thatmayencompassmanyotherelements. Forexample,theCreateFilteroperationinPropertyCollectorhasaspecparameterthatmustbedefined priortoinvokingtheoperation.ThespecparameterisdefinedasaninstanceofaPropertyFilterSpec.
VMware, Inc.
55
TosubmitcomplexdatastructuressuchasthistotheMOB,startbynavigatingthevSphereAPIReference.Find thePropertyFilterSpecdataobject.FindtheShowWSDLtypedefinitionlink,andclickittodisplaythe XMLSchemadefinition(seeExample 52). Example 52showsthatthePropertyFilterSpecdataobjectisa<complexContent>elementthatextends theDynamicDataclasswithasequenceoftwoadditionalproperties(propSet,objectSet),eachofwhichhas itsowntypedefined(PropertySpecandObjectSpec,respectively). Example 5-2. XML Schema Definition of PropertyFilterSpec Data Object Type
<complexType xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="PropertyFilterSpec"> <complexContent> <extension base="vim25:DynamicData"> <sequence> <element name="propSet" type="vim25:PropertySpec" maxOccurs="unbounded"/> <element name="objectSet" type="vim25:ObjectSpec" maxOccurs="unbounded"/> </sequence> </extension> </complexContent> </complexType>
Becausebothelementsaredefinedasasequence,theymustexistintheorderlisted.Toobtainthedefinitions ofpropSetandobjectSet,youmustnavigatefurtherintothevSphereAPIReference.Example 53showsonly therelevantpartsoftheXMLSchemadefinitionforPropertySpec.TheminOccurs=0attributemeansthat theelementdoesnothavetoexist.ThemaxOccurs=unboundedattributedenotesthattheelementcanbe populatedasanarrayofanysize.(WhenminOccursisnotsetbutmaxOccursisset,thedefaultforminOccurs defaultsto1,meaningoneinstanceisrequired.) Example 5-3. XML Schema Extract for PropertySpec
<sequence> <element name="type" type="xsd:string"/> <element name="all" type="xsd:boolean" minOccurs="0"/> <element name="pathSet" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> </sequence>
56
VMware, Inc.
ExtrapolatingfromtheWSDLdefinitionsshowninExample 52,Example 53,andExample 54might produceresultssimilartothoseshowninExample 55. Example 5-5. CreateFilter Spec Property Entry
<spec> <propSet> <type>VirtualMachine</type> <all>false</all> <pathSet>config.guestFullName</pathSet> </propSet> <objectSet> <obj type=Folder>group-v4</obj> <skip>true</skip> </objectSet> </spec>
Inthisexample,the<spec> elementidentifiesthespecparameteroftheCreateFilteroperation.Theorder oftheelementtagsisasdefinedintheXMLSchemafortheproperty(Example 52).ThepathSetproperty definesthefullpathtothenesteddataobjectofinterest.InExample 55,thepathSetpropertydefinesthepath totheguestFullNamepropertyofthetargetvirtualmachine.Figure 57showstheUMLofthesenesteddata objects. Figure 5-7. Nested Data Objects
VMware, Inc.
57
AllthesedetailsarepresentedinthevSphereAPIReference.ByexaminingtheWSDLdefinition,youcan constructthestringsneededtosubmitparametersthroughtheMOB.Table 58providesabriefsummaryof thestepsinvolvedwhenyouusetheMOBandthevSphereAPIReferencetogether. Table 5-8. Comparison of Datatypes for MOB Usage
Datatype Primitive Array Complex How to Input Values for Operations Enterthevalueasplaintextregardlessofitsdatatype(int,string,boolean).Donotusequotation marksorothermarkup. Usingthenameoftheparameterasthenameoftheelement,wrapthevaluesinaseriesofopeningand closingtagsforeacharrayelement. ObtainXMLSchemaformatinformationfromthevSphereAPIReferenceforthetype(fromtheShow WSDLtypedefinitionlink). Usetheschemadefinitiontoconstructthesequenceoftagsaroundthevalue(orvalues)youwanttopass totheMOB.
58
VMware, Inc.
Example 61providesashortclientapplicationthatfollowsthisbasicpattern.
VMware, Inc.
59
Alternatively,youcanuseSetLocaleoperationoftheSessionManagertosetthelocaleinaseparatestep.
60
VMware, Inc.
VMware, Inc.
61
Connectingtoaserverandobtainingamanagedobjectreferencerequiresthatanapplicationperforma numberoftasks,illustratedinExample 61. To connect to a server and obtain a managed object reference to the ServiceInstance 1 DefinealocalproxyobjectforthevimServiceport(vimServiceLocator,VimPortType).InJava,the variabledefinitionsmightlooklikethis:
private VimServiceLocator _locator; private VimPortType _service; ... _locator = new VimServiceLocator(); _locator.setMaintainSession(true); ...
2 3
ToobtaintheServiceContentobject,the_svcRefmanagedobjectreferenceisusedintheinvocationon thelocalserviceproxyobject(_service):
_sic = _service.retrieveServiceContent(_svcRef);
Thecompiledclassisexecutedasfollows:
C:\>java MyClient pubslab01.vmware.com tooluser password
Table 62showstheoutputfromrunsofExample 61targetingESX/ESXiandvCenterServersystems. Table 6-2. Sample Runs of Simple Client Application
ESX VMware ESX 4.0.0 build-139526 API type is HostAgent API version is 4.0 vCenter Server VMware vCenter Server 4.0.0 build-139524 API type is VirtualCenter API version is 4.0
62
VMware, Inc.
VMware, Inc.
63
ThevSphereWebServicesSDKpackageincludesseveralsampleapplicationsdemonstratinghowtowork withmultipleserverversions(Table 63). Table 6-3. Sample Applications that Demonstrate Working with Multiple API Version
Java SDK\samples\Axis\java\com\vmware\samples\version displaynewproperties displaynewpropertieshost displaynewpropertiesvm getvirtualdiskfiles hostpowerops installhostpatch querymemoryoverhead recordsession apputils\version C# SDK\samples\DotNet\cs\ DisplayNewProperties DisplayNewPropertiesHost DisplayNewPropertiesVM GetVirtualDiskFiles HostPowerOps ~ QueryMemoryOverhead RecordSession AppUtil\VersionUtil.cs
64
VMware, Inc.
com.vmware.apputils.vim
ServiceUtil.java
com.vmware.apputils.version com.vmware.apputils.vim
ExtendedAppUtil.java VMUtils.java
C# Helper Classes
Table 65liststhehelperclassesavailableforC#. Table 6-5. Helper Classes for C# Sample Applications
AppUtils AppUtil.cs ClientUtil.cs OptionSpec.cs ServiceUtil.cs ServiceUtilV25.cs TrustAllCertificatePolicy.cs Functional Description Conveniencemethodsforhandlinguserinputfromcommandline.Catcheserrors (faults).Logsoutputtoconsole. Conveniencemethodsforhandlinguserinputfromcommandline.Catcheserrors (faults).Logsoutputtoconsole. Helperclassforhandlingdefaultandcustomcommandlinearguments. WrappermethodsforthevimServicemethods(thelocalproxycodemethods)for API2.0andpriorreleases. WrappermethodsforthevimServicemethods(thelocalproxycodemethods)for API4.0,API3.5U2,API3.5U1,API3.5,andotherrecentreleases. Createsaninstanceoflocalproxyforconnectingtotheserver,andobtains managedobjectreferencestoseveralneededmanaged objectsServiceInstance,ServiceContent,rootFolder. HelperclassforidentifyingAPIversion.
VersionUtil.cs
VMware, Inc.
65
66
VMware, Inc.
Clientapplicationsthatlaunchautomaticallyforunattendedoperation,suchasasoftwareagentorcronjob, requirespecialtreatmenttofacilitatethelogonprocess.Noninteractiveclientapplicationslendthemselvesto poorsecuritypractices.Forexample,administratorsmaystorepasswordsinscriptorbatchfiles,tologin automatically. Tofacilitateautomatedloginforunattendedapplications,thevSphereWebServicesSDKincludesclientside credentialstorelibrariesandtoolsforautomatingtheloginprocessinamoresecuremanner.Theclient librariesobviatetheneedforsystemadministratorstokeeppasswordsinlocalscripts.Thischaptercontains informationaboutusingcredentialstorelibraries,andaboutcreatinguseraccountstousethesetools. The chapterincludesthesetopics: IntroductiontotheCredentialStoreonpage 67 OverviewoftheCredentialStoreBackingFileonpage 68 SecurityBestPracticesandtheCredentialStoreonpage 69 UsingtheCredentialStoreAdminToolonpage 70 UsingAuthorizationManagertoLimitAccessonpage 70
VMware, Inc.
67
close()
Close()
ThecredentialstoreclientAPIsuseaplatformdependentdefaultfilelocationwhenthefilelocationisnot specifiedexplicitly.
68
VMware, Inc.
TheCreateUsersampleprintsoutasfollowsuponsuccessfulexecution:
Started Successfully created user and populated the credential store Ended CreateUser
Theconsoleshoulddisplayamessagesimilartothefollowing:
Connected Successfully VMware ESX Server 3.5.0 build-78591
VMware, Inc.
69
4 5
CAUTIONTheCreateUsersamplebreakstheprincipleofleastprivilege,bygrantingtheuseraccountthe Administratorrole(1).Neverdothisinaproductionenvironment.
70
VMware, Inc.
4 5
InvoketheAssignUserToGroupoperation,passingthemanagedobjectreferencetothe HostLocalAccountManager,theuserid,andthegroupidintheinvocation.
VMware, Inc.
71
72
VMware, Inc.
ForanyclientapplicationyoudevelopusingthevSphereAPI,youmustobtainoneormoremanagedobject referencestotheserviceinterfacesthatyouwanttouse,andtospecificobjectsintheinventorythatyouwant tomanageoruseinyourapplication.ThePropertyCollectortheserviceinterfacethatyouusetoobtain referencestomanagedobjects,toobtainvaluesofthepropertiesfrommanagedobjects,andtomonitor changesandupdateyourclientsidewithnewvaluesforserversideobjectsasneededintheapplication. This chapterincludesthesetopics: SampleCodeReferenceonpage 73 IntroductiontothePropertyCollectoronpage 74 UnderstandingthePropertyFilterSpeconpage 75 RetrievePropertiesOperationonpage 76 CreateFilterandUpdateOperationsonpage 77 PropertyCollectorPerformanceonpage 79 UsingtheSearchIndextoObtainManagedObjectReferencesonpage 80
VMware, Inc.
73
PropertyCollector Operations
TheServiceInstanceofavSphereserverprovideseachclientsessionwithitsowninstanceofthe PropertyCollector.APropertyCollectorhasasingleproperty,filter,thatisdefinedasanarrayof referencestoPropertyFiltermanagedobjects. Figure 8-1. PropertyCollector and PropertyFilter Managed Object Types
Thefilterpropertyissessionspecific.Itdoesnotexistbeyondthesession,norcanitbesharedwithanother session.Whenasessionends,theserverdestroysanyfiltersassociatedwiththesession. ThePropertyCollectorprovidesoperationsforcreatingfilterstoobtainspecificpropertiesandobjects, checkforupdatesonspecifiedobjects,andmonitorchangestopropertiesontheserver.Table 82provides summaryinformationaboutalltheoperationsavailableinaPropertyCollector. Table 8-2. PropertyCollector Operations
Operation CancelWaitForUpdates Parameter _this Type MOR >PropertyCollector Description Cancelsaninprogress WaitForUpdatesoperation.Upon successfulcancellation,thisoperation throwsaCancelledfault. ReturnsanUpdateSetdataobjectthat containsallrequestedpropertiesforthe specifiedversion. Returnsareferencetoa PropertyFiltermanagedobjectthat meetsthespecificationsdefinedinthe specparameter.
CheckForUpdates
_this version
CreateFilter
74
VMware, Inc.
Chapter 8 Obtaining References to Objects and Property Values from the Server
ThroughtheoperationslistedinTable 82, PropertyCollectorsupportstwogeneralapproachesto obtainingobjectsandpropertiesfromtheserver: Ifyoudonotneedyourclientapplicationtokeepclientstatesynchronizedwithserverstate,youusethe RetrievePropertiesoperation.Theserverinstantiatesafilter,collectsyourspecifiedobjectsand propertiesasaObjectContentdataobjectandreturnsittotheclientapplication.SeeRetrieveProperties Operationonpage 76formoreinformation. Ifyourapplicationmustkeepclientstatesynchronizedwiththeserverstate,youusetheCreateFilter operationinconjunctionwithCheckForUpdatesorWaitForUpdatesoperations.SeeKeepingClient DatainSynchwithServerObjectsonpage 78formoreinformation. BothapproachesrequireyoutocreateacomplexdatastructurecalledaPropertyFilterSpecthatdefines thepropertiesandobjectsyouwanttoretrievefromtheserver.
PropertyFilterSpecrequiresatleastoneinstanceofanObjectSpec,butthearrayofPropertySpecobjects canbeempty.YouusetheObjectSpectospecifythestartingpointintheinventorythatyouwantthefilterto useforthecollection.TheobjpropertyofObjectSpecspecifiesthetypeofobject(themanagedobjecttype name,asastring)tocollectfromtheserver. Fortheobjproperty,youuseanyofthevalidstringsdefinedforthetypepropertyofthe ManagedObjectReferencedataobject.Validstringsarethenearly60managedobjecttypes,fromAlarm throughVmwareDistributedVirtualSwitch.SeeTable 51,ValidValuesforManagedObjectReference TypeProperty,onpage 46forthelistofvalidtypestrings.
VMware, Inc.
75
RetrieveProperties Operation
TheRetrievePropertiesoperationisdesignedforonetimeoradhocuse.Itcollectsalltheobjectsand propertiesyouspecifyinoneormorePropertyFilterSpecobjects.Thefilterisnotaddedtothearraythat makesupthefilterpropertyofPropertyCollector,butisinsteadusedimmediatelybytheserverto collecttheobjectsandpropertiesspecifiedinyourPropertyFilterSpecobjects,andthendestroyedafterthe serverreturnstheresultstoyourclient. TheRetrievePropertiesoperationacceptsanarrayofPropertyFilterSpecobjectsforitsspecSet parameter.TheoperationreturnsanObjectContentdataobject(Figure 84). Figure 8-4. ObjectContent Data Object Returned by RetrieveProperties Operation
Inyourclientcode,youobtainthevaluesfromthiscompositedatastructureandprocessfurtherinyourclient applicationasneeded.
76
VMware, Inc.
Chapter 8 Obtaining References to Objects and Property Values from the Server
Example 81showsanexcerptfromtheServiceUtil.javahelperclasscontainedinthevSphereWeb ServicesSDKsamplespackage. Example 8-1. Loop that Obtains References from an ObjectContent Data Object
... ObjectContent oc = null; ManagedObjectReference mor = null; DynamicProperty[] propary = null; String propval = null; boolean found = false; for (int oci = 0; oci < ocary.length && !found; oci++) { oc = ocary[oci]; mor = oc.getObj(); propary = oc.getPropSet(); propval = null; if (type == null || typeIsA(type, mor.getType())) { if (propary.length > 0) { propval = (String)propary[0].getVal(); } found = propval != null && name.equals(propval); } } if (!found) { mor = null; } return mor; } // close for loop ...
VMware, Inc.
77
To define the data objects needed to create a filter 1 IdentifythestartingobjectforthecollectionbycreatinganObjectSpecthatspecifiesthetypeofobjectin intheobjpropertyofObjectSpec.Ifyouwantthecollectiontoincludethestartingobject,settheskip propertyofObjectSpectofalse. DefinethespecificationforthePropertySpec,orpassnullfortheselectSetparametertoretrieve completeobjects. InstantiatethePropertyFilterSpecusingthearraysofObjectSpecandPropertySpecobjectsthat specifythedetailsyouwanttogatherinthecollection. UsetheCreateFilteroperationofPropertyCollector,passingthePropertyFilterSpecwiththe referencetothePropertyCollector.WhenyouinvokeCreateFilter,youalsopassavalueforthe partialUpdateproperty: SetpartialUpdatetofalsetoobtaincompletepropertyvalues. SetpartialUpdatetotruetoobtainnestedpropertyvaluesonly. 5 ThePropertyCollectorinstantiatesthePropertyFilterandaddsittothearrayoffiltersthatmake upthefilterpropertyonthatPropertyCollectorinstance.Theoperationreturnsthemanagedobject referencetothefiltertoyourclientapplication.
2 3 4
WaitForUpdates
78
VMware, Inc.
Chapter 8 Obtaining References to Objects and Property Values from the Server
Figure 8-6. UpdateSet Data Object Returned by CheckForUpdates and WaitForUpdates Operations
PropertyCollector Performance
ThesefactorscanaffecttheperformanceofaPropertyCollectorforanygivensession: Numberofobjects Numberofproperties Densityofpropertydata(composite,nesteddataobjects) Frequencyofchangestotheobjectsandpropertiesontheserver Depthoftraversal(numberofpropertiestraversed) Inaddition,avSphereserverisaffectedbythenumberofPropertyCollectorinstancesandthenumberof filterseachissupportingacrossallsessionsontheserver. ForVirtualCenterServer2.5,foraninventoryof2,000virtualmachinessupportingabout25clientapplications simultaneously,performanceisacceptableuptoabout12moderatelycomplexfiltersmonitoringupdateson all2,000virtualmachines.Ifthefiltersincludecomplextraversalobjects,performancemightdegrade appreciablyunlessyoureducethenumberoffiltersacrossthesystem. ConsiderusingtheViewManagerandViewobjectsinconjunctionwithPropertyCollectortominimizeboth theoverheadonPropertyCollectorandtheamountofnetworktrafficforyourclientapplication. See ImprovingCollectionPerformancebyUsingtheViewManagerandView Objectsonpage 79.
VMware, Inc.
79
TheViewManagerprovidesoperationsforcreatingseveraldifferentkindsofviews.Theseviewsextendfrom theViewandManagedObjectViewbasetypes(seeFigure 87). Figure 8-7. ViewManager and View Managed Object Types and View Subtypes
YouusetheappropriatecreateoperationofViewManagertocreateaview.AsshowninFigure 87,viewtypes includeContainerView,InventoryView,andListView. Forexample,youusetheCreateContainerViewtocreateaContainerView.TheContainerViewenables youtomonitorobjectsassociatedwithanyofthecontainerobjectssupportedontheserver,includingFolder, Datacenter,ComputeResource,HostSystem,ResourcePool,andVirtualAppobjects.Youusethe CreateInventoryViewtocreateanInventoryView. TheInventoryViewprovidesoperationsforopeningandclosingfoldersonaninventory.Itsviewproperty containsanarrayofthemanagedobjectreferencestotheobjectsthatmakeuptheinventory.Aswith PropertyCollector,thelifetimeofanyViewobjectisthedurationofthesession,oruntiltheobjectis explicitlydestroyed,byinvokingitsDestroyViewoperation. AfteryoucreatetheappropriateViewobjectsforyourapplication,insteadofusingaPropertyCollector withtheentireserverstructure,youusePropertyCollectorwiththeviews.Theappropriateviewsofserver objectsenableyoutocreatemuchsimplerPropertyFilterSpecobjectstodefineyourfilters,andtheback andforthcommunicationbetweentheclientandserverismoreefficient. SeethevSphereAPIReferenceformoreinformationaboutViewManager,aboutViewmanagedobjecttypesand subtypes,andabouthowtousetheseobjectsinconjunctionwithPropertyCollector.
80
VMware, Inc.
Chapter 8 Obtaining References to Objects and Property Values from the Server
VMware, Inc.
81
SeethevSphereAPIReferenceformoreinformationabouttheseoperations.
82
VMware, Inc.
AsdiscussedinAsynchronousClientServerApplicationStyleonpage 46,manyoftheoperationsavailable throughthevSphereAPIareasynchronous.Ratherthanblockingothercallerswhileexecutingtocompletion, asynchronousoperationsreturnareferencetoaTaskmanagedobject.Operationsassociatedwithan ESX/ESXihostanditsvirtualmachinesalsogenerateoneormoreEventdataobjectsthatprovidestatus, source,andotherinformationabouttheoperation.ThischapterprovidesanoverviewoftheTaskand TaskManagermanagedobjectsasfundamentalbackgroundfortheprogrammingmodel,andanintroduction toEventdataobjects.Thechapterincludesthesetopics: SampleCodeReferenceonpage 83 UnderstandingTaskManagerandTaskManagedObjectsonpage 84 UnderstandingtheTaskInfoDataObjectonpage 85 OperationsThatReturnTaskManagedObjectsonpage 90 IntroductiontotheEventDataObjectonpage 92 NOTEInadditiontotheTaskManagerandTaskmanagedobjectsdiscussedinthischapter,vCenterServer providesaScheduledTaskManagerthatsupportsschedulingoperationsinadvance.SeeChapter 16, SchedulingvCenterServerOperations,onpage 143forinformationaboutschedulingserveroperations usingtheScheduledTaskManager.
VMware, Inc.
83
maxCollector
int
84
VMware, Inc.
Figure 91showsaUMLclassdiagramforTaskManageranditsassociatedobjects. Figure 9-1. TaskManager and Task Managed Object Types
InadditiontothepropertieslistedinTable 92,TaskManagerhasthefollowingoperations: CreateCollectorForTasksoperation.YoucanusetheCreateCollectorForTasksoperationtocreate anobjectthatcontainsallTasksfromthevCenterServerdatabasethatmeetspecificcriteria.See ObtainingInformationaboutEventsUsingaHistoryCollectoronpage 133. CreateTaskoperation. TheCreateTaskoperationisusedbyallotheroperationsavailablethroughthe API,tocreateamanagedobjectreferencetoaTaskobject.Developerscreatingextensionscanalsousethe TaskManagertocreateTaskobjectsfortheoperationssupportedbytheirextension.
Description IndicateswhethertheTaskcanbecancelled(true)ornot(false). Indicatesthattheclienthasattemptedtocancel(true)theTask. Userenteredtagthatidentifiesoperationsandtheirsideeffects. TimestampthatidentifiesthedateandtimethattheTaskcompleted. Indicatesneithersuccessnorfailure. Identifiestheoperation,includingpubliclyvisibleinternaltasks. ReturnsvaluesfromtheTaskDescriptiondataobjectmethodInfo property. Managedentitytowhichtheoperationapplies. Localespecificmanagedentitynameretainedforthe HistoryCollectordatabase. Whenstatepropertyissettofault,identifiesthefault.Otherwise, notset. EventchainIDthatleadstotheassociatedTaskobjects. UniquekeyfortheTask. Whenthestatepropertyisrunning,thispropertyidentifiesthelist ofmanagedentities(ifany)lockedbytheoperation(usingashared lock).Otherwise,notset.
VMware, Inc.
85
TheresultpropertyoftheTaskInfodataobject(listedinTable 93andshowninFigure 92)isdefinedas anyType.WhentheTaskisinstantiatedbytheserver,thevalueoftheresultpropertyisinitializedasUnset. Onlyuponsuccessfulcompletionofanoperationistheresultpropertypopulatedwiththeactualreturntype specifictotheoperation.BecausetheresultpropertyisdefinedasanyType,theresultmightbeadata object,areferencetoamanagedobject,oranyotherdatastructureasdefinedbytheoperation. Forexample,theAddHost_Task(oftheClusterComputeResourcemanagedobject)returnsaTaskobject whoseinfopropertycontainsaTaskInfodataobject.Atthestartoftheoperation,theresultpropertyis Unset.Uponsuccessfulcompletionoftheoperation,theresultpropertyofTaskInfocontainsthemanaged objectreferenceofthenewlyaddedHostSystem.IntheexampleoftheCreateVM_TaskshowninTable 94, theresultisamanagedobjectreferencetoaVirtualMachinewhosemanagedobjectidis64. SeethevSphereAPIReferencefordetailsaboutthereturntypeinstantiateduponcompletionofthespecific Taskassociatedwiththeinvokingoperation.
86
VMware, Inc.
Figure 9-2. The Result Property of a TaskInfo Data Object Can Contain Any Type
Table 94liststhevaluesobtainedfromaTaskInfodataobjectatthebeginningandtheendoftheTask instantiatedbytheCreateVM_Taskoperationforcreatinganewvirtualmachine. Table 9-4. Sample TaskInfo Values from an ESX/ESXi 4.0 System During Creation of a VirtualMachine
Sample Values Property cancelable cancelled changeTag completeTime description descriptionId dynamicProperty dynamicType entity entityName error eventChainId key locked name parentTaskKey progress queueTime reason result rootTaskKey startTime Datatype boolean boolean string dateTime LocalizableMessage string DynamicProperty[] string ManagedObjectRefere nce:Folder string MethodFault int string MOR>ManagedEntity[] string string int dateTime TaskReason anyType string dateTime Start of Task false false Unset Unset Unset "Folder.createVm" Unset Unset ha-folder-vm "vm" Unset 159740 "haTask-ha-folder-vm-vim.Folder .createVm-159740" Unset "vim.Folder.createVm" Unset 36 "2009-02-19T22:50:39.111604Z" reason Unset Unset "2009-02-19T22:50:39.111604Z" End of Task false false Unset "2009-02-19T22:53:35.015338Z" Unset "Folder.createVm" Unset Unset ha-folder-vm "vm" Unset 159740 "haTask-ha-folder-vm-vim.Folder .createVm-159740" Unset "vim.Folder.createVm" Unset 100 "2009-02-19T22:50:39.111604Z" reason 64 Unset "2009-02-19T22:50:39.111604Z"
VMware, Inc.
87
Table 9-4. Sample TaskInfo Values from an ESX/ESXi 4.0 System During Creation of a VirtualMachine (Continued)
Sample Values Property state task Datatype TaskInfoState MOR>Task Start of Task "running" haTask-ha-folder-vm-vim.Folder. createVm-159740 End of Task "success" haTask-ha-folder-vm-vim.Folder. createVm-159740
Cancelling a Task
TocancelaTaskthatisstillrunning,invoketheCancelTaskoperation,passingthemanagedobjectreference totheTaskyouwanttocancelasshowninthisexample:
my_conn.cancelTask(taskMoRef);
88
VMware, Inc.
VMware, Inc.
89
Example 92showsanexcerptofsomeofthecodethatobtainsvaluesfortheinfopropertyfromeachTask objectinthearray. Example 9-2. Displaying TaskInfoState Values for Each Task in the recentTask Array
... private void displayTasks(ObjectContent[] oContents) { for(int oci=0; oci<oContents.length; ++oci) { System.out.println("Task"); DynamicProperty[] dps = oContents[oci].getPropSet(); if(dps!=null) { String op="", name="", type="", state="", error=""; for(int dpi=0; dpi<dps.length; ++dpi) { DynamicProperty dp = dps[dpi]; if("info.entity".equals(dp.getName())) { type = ((ManagedObjectReference)dp.getVal()).getType(); } else if ("info.entityName".equals(dp.getName())) { name = ((String)dp.getVal()); } else if ("info.name".equals(dp.getName())) { op = ((String)dp.getVal()); } else if ("info.state".equals(dp.getName())) { TaskInfoState tis = (TaskInfoState)dp.getVal(); if(TaskInfoState.error.equals(tis)) { state = "-Error"; } else if(TaskInfoState.queued.equals(tis)) { state = "-Queued"; } else if(TaskInfoState.running.equals(tis)) { state = "-Running"; } else if(TaskInfoState.success.equals(tis)) { state = "-Success"; } } else if ("info.cancelled".equals(dp.getName())) { Boolean b = (Boolean)dp.getVal(); if(b != null && b.booleanValue()) { state += "-Cancelled"; } }...
Example 93showsoutputfromarunoftheprogram.SeethesourcecodelistingforTaskList.javaorfor TaskList.csinthevSphereWebServicesSDKpackagefordetails. Example 9-3. Sample Run of the TaskList Java Application
java com.vmware.samples.general.TaskList --url https://srv/sdk --username root --password ******* Started Task Operation AcquireCimServicesTicket Name srv Type HostSystem State -Success Error ====================== Ended TaskList
90
VMware, Inc.
Table 9-5. Operations that Return a Reference to a Task Managed Object (Continued)
CheckHostPatch_Task CheckMigrate_Task CheckRelocate_Task CloneVApp_Task CloneVM_Task ComplianceManagerCheckCompliance_Task CopyDatastoreFile_Task CopyVirtualDisk_Task CreateChildVM_Task CreateDVS_Task CreateScreenshot_Task CreateSecondaryVM_Task CreateSnapshot_Task CreateVirtualDisk_Task CreateVM_Task CustomizeVM_Task DefragmentVirtualDisk_Task DeleteDatastoreFile_Task DeleteVirtualDisk_Task Destroy_Task DisableSecondaryVM_Task DisconnectHost_Task DVPortgroupReconfigure_Task DVSAddPortgroups_Task DVSMerge_Task DVSMovePort_Task DVSPerformProductSpecOperation_Task DVSReconfigure_Task DVSRectifyHost_Task EagerZeroVirtualDisk_Task EnableSecondaryVM_Task EnterMaintenanceMode_Task ExitMaintenanceMode_Task ExtendVirtualDisk_Task GenerateLogBundles_Task HostProfileApply_Task InflateVirtualDisk_Task InstallHostPatch_Task InstallHostPatchV2_Task MakePrimaryVM_Task MigrateVM_Task MoveDatastoreFile_Task PowerOnMultiVM_Task PowerOnVApp_Task PowerOnVM_Task PowerUpHostFromStandBy_Task ProfileCheckCompliance_Task PromoteDisks_Task QueryHostPatch_Task QueryVMotionCompatibilityEx_Task RebootHost_Task ReconfigureCluster_Task ReconfigureComputeResource_Task ReconfigureHostForDAS_Task ReconfigurePort_Task ReconfigVM_Task ReconnectHost_Task RegisterChildVM_Task RegisterVM_Task RelocateVM_Task RemoveAllSnapshots_Task RemoveSnapshot_Task Rename_Task ResetVM_Task ResignatureUnresolvedVmfsVolume_Task RevertToCurrentSnapshot_Task RevertToSnapshot_Task ScanHostPatch_Task ScanHostPatchV2_Task SearchDatastore_Task SearchDatastoreSubFolders_Task ShrinkVirtualDisk_Task ShutdownHost_Task StageHostPatch_Task StartRecording_Task StartReplaying_Task StopRecording_Task StopReplaying_Task SuspendVM_Task TerminateFaultTolerantVM_Task TurnOffFaultToleranceForVM_Task UninstallHostPatch_Task UnregisterAndDestroy_Task unregisterVApp_Task
VMware, Inc.
91
Table 9-5. Operations that Return a Reference to a Task Managed Object (Continued)
MoveHostInto_Task MoveInto_Task MoveIntoFolder_Task MoveVirtualDisk_Task UpgradeTools_Task UpgradeVM_Task ZeroFillVirtualDisk_Task ~
FormanagedESX/ESXisystems,Eventobjectsarepersistent.ManagedESX/ESXisystemssendEventdatato thevCenterServersystemthatmanagesthem,andthevCenterServerstorestheinformationitsdatabase. ThesampleapplicationsincludedintheSDKpackageforhandlingeventscanbeusedwitheitherunmanaged ESX/ESXiorvCenterServersystems. UsingaHistoryCollector,youcanobtaininformationabouttheseobjectsastheyarebeingcollectedona specificESX/ESXisystem,orfromaspecifichistoricalperiodfromthedatabase.SeeObtainingInformation aboutEventsUsingaHistoryCollectoronpage 133. SeeUnderstandingEventManagerandtheEventDataObjectonpage 129formoreinformation.
92
VMware, Inc.
10
10
AVirtualMachineisassociatedwithbothitscontainingFolderandtheResourcePoolfromwhichit obtainsresourcesatruntime,soitacquirespermissionsfromboththeseobjects. ManycapabilitiesofvirtualmachinesrequirethatVMwareToolsisinstalledontheguestoperatingsystemof thevirtualmachine.Forexample,VMwareToolsprovidesthememorymanagementdriverthatsupports ballooning,andthenetworkingdriverthatprovidesaDNSnameforthevirtualmachine.Inaddition,some oftheAPIavailabletovirtualmachinesrequireVMwareTools.Forexample,thequiesceparameteroftheis supportedonlyifVMwareToolsisinstalledonthevirtualmachine. TheVirtualMachineAPIsupportsprogrammaticallyupgradingtheVMwareToolssoftwareonthevirtual machineguestOS. Thischapterincludesthesetopics: SampleCodeReferenceonpage 93 CreatingVirtualMachinesonpage 93 OverviewofVirtualMachineOperationsonpage 94 OverviewofSnapshotsonpage 97
VMware, Inc.
93
ThedataobjectsyoupasstotheCreateVM_TaskoftheFoldermanagedobjectincludeaninstanceofthe VirtualMachineConfigSpec.AVirtualMachineConfigSpecisacomplexdataobjectconsistingofalmost 50differentpropertiesthatmakeuptheconfigurationofthevirtualmachineyouwanttocreate.However,to createavirtualmachineonanunmanagedhostsystemyoumustprovideonlyafewpropertyvaluesfora minimalnumberofproperties,suchasthoseshowninExample 101. Example 10-1. Creating a VirtualMachineConfigSpec Data Object
ManagedObjectReference resourcePool = cb.getServiceUtil().getMoRefProp(crmor, "resourcePool"); ManagedObjectReference vmFolderMor = cb.getServiceUtil().getMoRefProp(dcmor, "vmFolder"); VirtualMachineConfigSpec vmConfigSpec = vmUtils.createVmConfigSpec(cb.get_option("vmname"), cb.get_option("datastorename"), Integer.parseInt(cb.get_option("disksize")), crmor, hostmor); vmConfigSpec.setName(cb.get_option("vmname")); vmConfigSpec.setAnnotation("VirtualMachine Annotation"); vmConfigSpec.setMemoryMB(new Long(Integer.parseInt(cb.get_option("memorysize")))); vmConfigSpec.setNumCPUs(Integer.parseInt(cb.get_option("cpucount"))); vmConfigSpec.setGuestId(cb.get_option("guestosid")); ManagedObjectReference taskmor = cb.getConnection().getService().createVM_Task( vmFolderMor, vmConfigSpec, resourcePool, hostmor);
limit
MHz
MB
expandableReservation
94
VMware, Inc.
AnswerVM CheckCustomizationSpec
CreateScreenshot_Task CreateSnapshot_Task
PowerOffVM_Task
PowerOnVM_Task
QueryUnownedFiles
RebootGuest
VMware, Inc.
95
RevertToCurrentSnapshot_Task
StandbyGuest
StartRecording_Task
UpgradeTools_Task UpgradeVM_Task
Workingwithanyvirtualmachinesfromaclientapplicationrequiresthevirtualmachinetobeconfigured properlyfornetworking.Specifically,theappropriateversionofVMwareToolsmustbeinstalledand configuredontheguestoperatingsystem(guestOS). ForeachguestOS,suchasWindows2003Server,RedHatEnterpriseServerLinux,orUbuntuLinux,VMware providesaspecificbinarycompatibleversionofVMwareTools.TheVMwareToolssoftwareprovidesmany benefits,suchasenhancingthedisplayinteractionforendusers.Italsoprovidesthevmxnetdriverneededfor thevirtualnetworkinterfacecontroller(vNIC)andvirtualmachinenetworkconfiguration.WithVMware ToolsinstalledontheguestOS,thevirtualmachineobtainsitsDNS(domainnameserver)nameandanIP addressandisthereforereachableoverthenetwork. IMPORTANTSelectingInstallVMwareTools fromthevSphereClientmenuonlydownloadstheappropriate installationpackagetothevirtualmachine.Youmustunpackthefile,runtheinstallationscriptorlaunchthe executable,andconfigureVMwareToolsontheguestoperatingsystemofthevirtualmachinetoenable networking,memorymanagement,andothercapabilitiesonthevirtualmachine.
96
VMware, Inc.
Overview of Snapshots
Asnapshotpreservesthestateanddataofavirtualmachineataspecificpointintime. Stateincludesthevirtualmachinespowerstate(poweredon,poweredoff,suspended,forexample). Dataincludesallthefilesthatmakeupthevirtualmachine,includingdisks,memory,andotherdevices, suchasvirtualnetworkinterfacecards. AVirtualMachineobjectprovidesseveraloperationsforcreatingandmanagingsnapshots.Theseoperations letyoucreatesnapshots,reverttoanysnapshotinthetree,andremovesnapshots.Youcancreateextensive snapshottreesthatyoucanusetosavevirtualmachinestateatanypointintime,andrestoreitlater,if necessary.
Creating Snapshots
Creatingasnapshotofavirtualmachinestartswithareference(instanceofManagedObjectReference)tothe targetvirtualmachine.PassthereferencetotheCreateSnapshot_Taskoperation,providinganameand description(bothstrings)forthesnapshot. TheCreateSnapshot_Taskoperationalsohastwobooleanproperties: memory,whichcanbesettotruetoincludethevirtualmachinesmemorydumpinthesnapshot. Includingmemoryinthesnapshotwilltakelonger(tocompletethesnapshotoperation)andcreatea largersnapshotfile. quiesce,whichcan(andshould)besettotruesothatthesnapshotwillincludethevirtualmachines diskdatainaconsistentstate:thispropertyquiescesthevirtualmachinesfilesystempriortoinitiating theoperation. SeethevSphereAPIReferenceformoreinformation.
Reverting to Snapshots
Afterasnapshotexistsonthesysteminatreeofsnapshots,youcanreinstatethesnapshotbyusingthe RevertToSnapshot_Taskoperation.SeethevSphereAPIReferencefordetails.
VMware, Inc.
97
98
VMware, Inc.
11
Managing Storage
11
vSphereserversrequirededicatedstoragespacefortheoperatingsystemfilesandforthecomponentsthat makeuptheinventory.Storageincludesphysical,logical,andvirtualconstructs.Thischapterincludesthese topics: SampleCodeReferenceonpage 99 OverviewofPhysicalandVirtualStorageConceptsonpage 99 IntroductiontotheHostStorageSystemManagedObjectonpage 102 IntroductiontotheHostDatastoreSystemManagedObjectonpage 106 ObtainingInformationaboutConfiguredStorageonpage 107 CreatingNewDatastoresonpage 108 ModifyingDatastoreConfigurationonpage 110
VMware, Inc.
99
Virtualmachinesusevirtualdisksfortheiroperatingsystem,applicationsoftware,andotherdatafiles. A virtualdiskisstoredasaVMDKfileinsideadatastore. Figure 111providesaconceptualoverviewofthevariousstoragearchitecturessupportedbyvSphereservers, whichinclude: Storageareanetworks(SAN).SANscanbeimplementedusingvarioustechnologies,includingFibre Channel(FC)andInternetSCSI(iSCSI). Networkattachedstorage(NAS).NASstorageusesfilebasedprotocolssuchasNFS(networkfile system),NTFS(NTfilesystem),orSMB/CIFS(Microsoftlegacyservermessageblock/commoninternet filesystem). Directattachedstorage(DAS).Alsocalledlocalstorage.Localstoragehassomelimitationswhen comparedtoSANandNASsystems. Figure 11-1. Overview of Local, NAS, and SAN Storage
NOTEFigure 111isforillustrationpurposesonly.Itisnotarecommendedconfiguration.Detailshavebeen oversimplifiedonpurpose. WhenyoucreateavirtualmachineusingthevSphereClient,awizardguidesyouthroughtheconfiguration ofallsettings,includingstorage.Bydefault,avirtualmachineiscreatedwithonevirtualharddiskandone virtualSCSIcontroller. VirtualmachinesalwaysuseavirtualSCSIadapterandcommunicateusingtheSCSIcommandsetregardless ofthetypeofphysicalstorageSCSI,iSCSI,fibrechannel,orfilesystembased.Atruntime,theguest operatingsystemrunningonthevirtualmachineissuesSCSIcommandstoitsvirtualdisks.Thevirtualization layertranslatestheSCSIcommandsintoVMFSfileoperations.
100
VMware, Inc.
Figure 112showstwodifferentapproachestoInternetSCSI(iSCSI)storagesupportedbyvSphereservers. HardwarebasediSCSIusesaniSCSIhostbusadapter(HBA),whichservesasthesource(orinitiator) ofSCSIcommands. SoftwarebasediSCSIusesahighspeednetworkinghardware,suchas1GBEthernetNICsandswitches. ESX/ESXihasitsowniSCSIinitiator,builtintotheVMkernel.Bydefault,thesoftwareiSCSI implementationintheVMkernelisdisabled.(TheisSoftwareBasedpropertyofthe HostInternetScsiHbaissettofalse. NOTEDonotuse100MBEthernetNICsforiSCSIbasedstorage:itistooslow.Use1GB(orfaster)Ethernet. Aninitiatorspropertiesincludeitsmodelname,IPaddress,iSCSIname,discoverymethods,iSCSIalias,and alistofanytargetsthatithasalreadydiscovered.
VMware, Inc.
101
ThestorageSystemproperty,whichprovidesamanagedobjectreferencetotheHostStorageSystemof theserver.HostStorageSystemprovidesoperationsassociatedwiththeconfigurationandmanagement ofthephysicalstorageimplementation.Itprovidesoperationsforcreating,configuring,andmanaging thehostsstoragesubsystem.AHostStorageSystemistheserviceinterfacetousetomakestorage availableforvirtualmachines. TheHostStorageSystemobjectprovidesanabstractionforphysicalstorageresources. The HostDatastoreSystemprovidesaccesstostorageresourcesaspresentedbythefilesystem. TheDatastoremanagedentityprovidesoperationsformountingdatastores,browsingdatastores,and obtaininginformationaboutthedatastoresassociatedwithavirtualmachine. Figure 11-3. Datastore Managed Object As a ManagedEntity
102
VMware, Inc.
AttachVmfsExtent ComputeDiskPartitionInfo
QueryStorageArrayType PolicyOptions
QueryUnresolved VmfsVolume
RemoveInternetScsi StaticTargets
VMware, Inc.
103
UpdateDiskPartitions UpdateInternetScsi AdvancedOptions UpdateInternetScsiAlias UpdateInternetScsi AuthenticationProperties UpdateInternetScsiDigest Properties UpdateInternetScsiDiscovery Properties UpdateInternetScsiIP Properties UpdateInternetScsiName UpdateScsiLunDisplayName UpdateSoftware InternetScsiEnabled UpgradeVmfs UpgradeVmLayout
IftheDiscoveryProperties.sendTargetsDiscoveryEnabledflagissettotrue,the AddInternetScsiSendTargetoperationaddssendtargetentriestothestorageadaptersdiscoverylist. Toobtainmanagedobjectreferences,createaPropertyFilterSpectoobtainHostSystemmanagedobjects andtheappropriateproperty. To enable the VMkernel to support software iSCSI 1 2 ObtainamanagedobjectreferencetothehostsystemsHostStorageSystem. InvoketheUpdateSoftwareInternetScsiEnabledoperation,passingthereferencetothe HostStorageSystemandthevaluetrue.
104
VMware, Inc.
Name EUI
IQN
iqn.yyyy-mm.com.company: san-server-name
Thispropertypathreturnsanarrayofhostbusadapters.Forexample:
hostBusAdapter["key-vim.host.BlockHba-vmhba32"] hostBusAdapter["key-vim.host.BlockHba-vmhba33"] hostBusAdapter["key-vim.host.BlockHba-vmhba34"] hostBusAdapter["key-vim.host.BlockHba-vmhba35"] hostBusAdapter["key-vim.host.BlockHba-vmhba1"] ...
2 3 4
5 6 7 8 9
VMware, Inc.
105
106
VMware, Inc.
ExtendVmfsDatastore QueryAvailableDisksForVmfs
QueryUnresolvedVmfsVolumes
QueryVmfsDatastore CreateOptions
VMware, Inc.
107
Freespacecanbeusedforaddinganextentorexpandinganexistingextent.Expandinganexistingextentis sometimesreferredtoasgrowingtheextent.
CreateNasDatastore
_this spec
MOR>HostDatastoreSystem HostNasVolumeSpec
CreateVmfsDatastore
_this spec
MOR>HostDatastoreSystem VmfsDatastoreCreateSpec
108
VMware, Inc.
TocreateaVMFSbaseddatastore,youusetheCreateVmfsDatastoreoperation.Thisoperationtakesa VmfsDatastoreCreateSpecdataobjectthatconsistsofanextent,apartition,andavmfsproperty,allof whicharecomplexdataobjects.Forexample,thevmfspropertyisdefinedasaninstanceoftheHostVmfsSpec dataobject.Table 118liststhepropertiesanddatatypesoftheHostVmfsSpecdataobject. Table 11-8. HostVmfsSpec Data Object
Property blockSizeMb Type int Description and Usage Optional.VMFSblocksize,inmegabytes(MB).Controlsmaximumfilesize. ValidblocksizevariesbyVMFSversion: VMFS31MB VMFS21,2,4,8,16,32,64,128,256MB extent HostScsiDiskParti tion PrimaryextentthatidentifiestheVMFSinvmhbaI:T:Lformat.Thedatais notguaranteedtobestableacrossreboots,sodonottrytoidentifyVMFS usingthisdata.Instead,defineauniquevolumenameonthehostanduseit torefertotheVMFS.Or,usetheVMFSUUID(whichisimmutableafteritis created). VMFSversionnumber,suchas2or3.Versionnumbercanbeoptionally changedduringanupgrade.Upgradedfilesystemscannotbedowngraded. NameoftheVMFSvolume.
majorVersion volumeName
int string
partition
int
Definingthespecificationforadatastoretakesafairnumberofcomplexdataobjects,suchasthese.Seethe vSphereAPIReferenceformoreinformation.
VMware, Inc.
109
userName password
string string
ExpandVmfsDatastore
_this
MOR>HostDatastoreSystem
datastore
MOR>Datastore
spec
VmfsDatastoreExpandSpec
ExtendVmfsDatastore
_this
datastore
spec
VmfsDatastoreExtendSpec
RemoveDatastore
_this
MOR>HostDatastoreSystem
MOR>Datastore MOR>HostDatastoreSystem
resolutionSpec
HostUnresolvedVmfs ResignatureSpec
110
VMware, Inc.
12
Monitoring Performance
12
VMwarevSphereservershavebeeninstrumentedusingacomprehensivesystemthattracksutilizationof resourcesbyvariousobjects.Atruntime,statisticaldataisgeneratedbythevSphereserversperformance providers.Aperformanceproviderisanyentityonthesystemthatgeneratesutilizationorconsumption information.PerformanceprovidersincludeallthemanagedentitiessuchasHostSystemand VirtualMachineobjects,andthedevicesassociatedwiththem,suchasvirtualdisks. IMPORTANTSeveraldataobjects,includingHostListSummaryQuickStats,VirtualMachineQuickStats, andResourcePoolQuickStats,providenearrealtimesummaryinformationaboutperformanceor utilizationwithoutgoingthroughthePerformanceManager.Thesedataobjectsdonotsupportmonitoring. Thischapterincludesthesetopics: SampleCodeReferenceonpage 111 IntroductiontoPerformanceManageronpage 112 ObtainingStatisticsonpage 115 vCenterServerandPerformanceManageronpage 117
VMware, Inc.
111
Introduction to PerformanceManager
ThePerformanceManageristheserviceinterfaceforobtainingstatisticaldataaboutvariousaspectsofsystem performance,asgeneratedandmaintainedbyvariousperformanceproviders. Table 12-2. PerformanceManager Properties
Property description Type PerformanceDescript ion PerfInterval[ ] Description Thedescriptionpropertyisacompositeobjectthatincludes informationaboutthetypesofcounters(counterType)and statistics(statsType)availableonthesystem. AnarrayofPerfIntervaldataobjectsthatdefinesthe performanceintervalsconfiguredforthesystem. ForanESX/ESXisystem,thearraycontainsasingleobjectthat definesthebaselinesamplingperiodfortheserver. ForavCenterServer,thisarraycontainsfourobjects.See HistoricalIntervalsonpage 117formoreinformation. perfCounter PerfCounterInfo[ ] AnarrayofPerfCounterInfodataobjectsthatcontainsallthe metadataassociatedwiththeperformancemetricsgeneratedon thesystem.
historicalInterval
SeethevSphereAPIReferenceforVMwareWebServicesSDK4.0forcompletePerformanceManager documentation.
112
VMware, Inc.
Someofthesecountergroups,suchasstorageutilization,arenewinvSphere4.0.Thecountergroupsand specificcountersusedonanysystemdependonthespecificconfiguration.Notallcountergroupsareused, andyoumightfindavailablecountersthatarealsonotused.Disregardanyextraneouscounters. ThecountersaremodeledinthesystemusingthePerfCounterInfodataobject.Instancesofthisdataobject providethemetadatafortheruntimestatisticalvalues. Figure 12-1. PerfCounterInfo Data Object
groupInfo key
ElementDescription int
level
int
nameInfo rollupType
ElementDescription PerfSummaryType
VMware, Inc.
113
unitInfo
ElementDescription
Eachcounterhaskeypropertythatidentifiesthemetricgeneratedbythesystem.Thevalueofkeyisunique andisnotstaticitmightchangebetweensystemreboots,forexample.Atruntime,thekeypropertyofa PerfCounterInfoinstanceisusedtopopulatethevalueofthecounterIdpropertyofaspecific PerfMetricIdinstance(Figure 122). Figure 12-2. PerfCounterInfo Key Matches a PerfMetricId CounterId
114
VMware, Inc.
ThehistoricalIntervalisdefinedasanarrayofPerfIntervaldataobjects.ForanESX/ESXisystem,the arraycontainsasinglePerfIntervalobjectwiththepropertieslistedinTable 126. Table 12-6. Values of PerfInterval Data Object from an ESX/ESXi System
Property key name samplingPeriod length enabled level Value 1 PastDay 300 129600 true null Description NumericidentifierforthePerfInterval. NameofthePerfInterval. Numberofsecondsduringwhichthesystemsamplesperformance datatoproduceametric. Numberofsecondsthatstatisticsassociatedwiththeintervalarekept bythesystem. DenotesthatthisPerfIntervalisenabledonthesystem. Statisticscollectionlevel.ForanESX/ESXisystem,thispropertyis null.ThePerfIntervalobjectonanESX/ESXisystemdefinesthe baselineinterval.
SeeHistoricalIntervalsonpage 117forinformationaboutintervalsonmanagedhostsusingvCenterServer.
Obtaining Statistics
YouusetheQueryPerfandtheQueryPerfCompositeoperationsofPerformanceManagertoobtain statisticaldataaboutperformance.Theseoperationsbehavedifferently,inthefollowingways: TheQueryPerfoperationretrievesperformancestatisticsforoneormoreinventoryentities.Withoutan intervalIdaspartofthequery,theQueryPerfoperationsummarizesacrossallintervals.Youdefine oneoremorePerfQuerySpecobjectsforthequerySpecparameterforthisoperation,andtheserver returnsanarrayofoneormorePerfEntityMetricBaseobjects. TheQueryPerfCompositeoperationretrievesperformancestatisticsforanentityanditsfirstgeneration childentities. Forbothoperations,youmustdefinethestatisticsyouwanttoretrieveusingaPerfQuerySpecdataobject. ForQueryPerf,yousubmitanarrayofPerfQuerySpecobjects. ForQueryPerfComposite,yousubmitasinglePerfQuerySpecobject. Figure 12-3. Define a PerfQuerySpec to Obtain Statistics
QueryPerfCompositeisdesignedforefficientclientservercommunications.Intheory,itgeneratesless networktraffic(thanQueryPerf)becauseitreturnsalargegrainedobject,aPerfCompositeMetricdata objectthatcontainsallthedata(seeFigure 124,PerfEntityMetricBaseDataObject,onpage 116). Figure 12-4. PerfEntityMetricBase Data Object
endTime
dateTime
intervalId
int
116
VMware, Inc.
Historical Intervals
Table 128liststhedefaultvaluesofthehistoricalIntervalpropertyfromavCenterServersystem. Table 12-8. Values of PerfInterval Data Objects from a vCenter Server System
key 1 2 3 4 name PastDay PastWeek PastMonth PastYear sampling period 300 1800 7200 86400 length 86400 604800 2592000 31536000 enabled TRUE TRUE TRUE TRUE level 1 1 1 1
3 4
TherollupTypeidentifiesthefunctionthatcontrolshowdataisconvertedasitisconsolidatedfromone intervaltothenext.
VMware, Inc.
117
118
VMware, Inc.
13
13
VMwarevCenterServersupportscomprehensivedeployment,management,monitoring,andotherservices formultipleESX/ESXisystems.vCenterServerrunsasadatabasebackedserviceonavarietyofWindows operatingsystems.ThesoftwarelicensingandinstallationprocessincludesaninstanceofMicrosoftSQL Server.vCenterServeralsosupportsintegrationwithOracleDatabaseServer. AvCenterServerpersistsstatus,configuration,performance,andotherinformationabouteachvirtual machine,host,cluster,virtualapplication,andotherentitiesthatitmanagestoitsdatabase.Historical performance,event,task,andotherdataisalsopreservedinthevCenterServerdatabase. TheAPIavailableonthevCenterServerincludesseveralserviceinterfacesthatarenotsupportedon unmanagedESX/ESXisystems,includingAlarmManagerandScheduledTaskManager.Theseservice interfaceshavebeenavailableinpriorreleasesofvCenterServer,butwithvCenterServer4.0andvSphereAPI 4.0,theysupportmanynewcapabilities. Forexample,controloverAlarmsettingismoregranularthanin priorreleases,falsealarmsorunnecessaryrepeatedtriggeringofanalarmhasbeenresolved.SeeUsingthe AlarmInfrastructureonpage 137. ManynewfeaturesofvSphere4.0areavailableonlythroughtheAPIavailableonthevCenterServerWeb service,includingClusterProfileManager,ProfileComplianceManager,HostProfileManager, IpPoolManager,HostSnmpManager,VirtualMachineCompatibilityChecker,and VirtualMachineProvisioningChecker,amongothers. vCenterServerprovidesarangeofoptionsfordeployingandconfiguringvirtualmachines,andfor organizingvirtualassets.vCenterServerprovidescontainerobjects,suchasfoldersanddatacenters,for organizingvirtualassetsinaninventorycomprisingmultipleESX/ESXisystems.vCenterServersupports deployingmultiplevirtualmachinesbyusingatemplatethatcodifiesastandardconfiguration.Thischapter providesinformationabouttheseapproaches.Itincludesthesetopics: SampleCodeReferenceonpage 120 OverviewoftheVirtualMachineManagedObjectTypeonpage 120 UsingTemplatestoDeployStandardVirtualMachinesonpage 124 MigratingVirtualMachinesUsingVMotiononpage 125 MovingStorageDynamicallyUsingStorageVMotiononpage 127
VMware, Inc.
119
120
VMware, Inc.
bootOptions
changeTracking Enabled
changeVersion
string
boolean
VMware, Inc.
121
locationId
string
memoryMB name
long string
networkShaper npivDesiredNodeWwns
npivDesiredPortWwns
short
npivNodeWorldWideName
long[]
npivOnNonRdmDisks
boolean
122
VMware, Inc.
npivTemporaryDisabled
boolean
npivWorldWideNameOp
string
npivWorldWideNameType
string
swapDirectory
string
swapPlacement
string
tools uuid
ToolsConfigInfo string
VMware, Inc.
123
version
string
vServiceConfig vServiceConfigRemoved
VmConfigSpec boolean
ExportVm ExtractOvfEnvironment
Creating Templates
Youuseatemplatetocreatemultiplevirtualmachineshavingthesamecharacteristics,suchasamountof resourcesallocatedtoCPUandmemoryandtypeofvirtualhardwareattributessupported. Theonlypropertythatdistinguishesatemplatefromavirtualmachineisthetemplatepropertyofthe VirtualMachineConfigInfodataobjectthatcomprisestheconfigpropertyofaVirtualMachineinstance: AtemplateisaninstanceofaVirtualMachineobjectthathasitstemplatepropertysettotrue. Youuseoneofthesetwogeneralwaystocreateatemplate: Ifyounolongerneedaspecificinstanceofavirtualmachine,butyouwanttousethevirtualmachines configurationasatemplate,usetheMarkAsTemplateoperationonthevirtualmachineinstance.Youuse themanagedobjectreferenceofthevirtualmachinetoinvokethisoperation.Invokingthisoperationsets theconfig.templatepropertytotrue,andthevirtualmachineisdisabled. Ifyouwanttouseanexistingvirtualmachineasatemplate,yetalsokeepthevirtualmachine,usethe CloneVM_Taskoperationofthevirtualmachinefirst,tocreateaduplicateofthevirtualmachine Example 131demonstratesthecloningapproach,whichmakesthevirtualmachineinoperative.
124
VMware, Inc.
VMware, Inc.
125
TheCheckMigrate_TaskoperationdetermineswhetheraproposedMigrateVM_Taskoperationispossible. SeethevSphereAPIReferenceformoreinformation.
host
MOR>HostSystem
state
VirtualMachinePowerState
126
VMware, Inc.
VMware, Inc.
127
pool
MOR>ResourcePool
128
VMware, Inc.
14
14
AnEventisamessagegeneratedbymanagedentitiesduringoraftervariousoperations.TheEventManager istheserviceinterfacethatyoucanusetodefineyourownevents.Thischapterincludesthesetopics: SampleCodeReferenceonpage 129 UnderstandingEventManagerandtheEventDataObjectonpage 129 CreatingCustomEventsonpage 132 ObtainingInformationaboutEventsUsingaHistoryCollectoronpage 133
VMware, Inc.
129
130
VMware, Inc.
TheVmPoweredOnEventisalsoshowninFigure 142.Asshownattheconsole,theeventdataobjectsarenot formattedanddonotprovideanycontextinformation. Figure 14-2. Event Data Object is a Base Type Used by Many Generations of Subtypes
formatOnComputeResource
string
VMware, Inc.
131
2 3
132
VMware, Inc.
2 3
InadditiontothefilterpropertythattheyinheritfromtheHistoryCollectorbasetype,the EventHistoryCollectorandTaskHistoryCollectoreachhasalatestPagepropertyfortheirrespective objecttypes.TheHistoryCollectormanagedobjecttypeprovidesoperationsformanagingthelifecycle andscrollableviewofacollection. Table 14-3. Operations Common to HistoryCollector and Its Descendents
Operation DestroyCollector ResetCollector Description AHistoryCollectorexistsonlyforthecurrentsession.InvoketheDestroyCollector operationtoexplicitlydestroythecollectorbeforethesessionends. Adjuststhestartingpositionforthesubsetofobjectsfromthecollectortotheobject immediatelyprecedingthecurrentlatestPage.
VMware, Inc.
133
Table 144liststhepropertiesofTaskFilterSpec.TocreateaTaskHistoryCollector,youuseoneormore propertiesofTaskFilterSpecdataobjecttodefinefilterthatmeetsyourrequirements.Forexample,rather thanreturningallTaskobjectsassociatedwithvirtualmachines,youmightcreateafiltertocollectonlythose Taskobjectsassociatedwithvirtualmachinesthatwereexecutedbythebackupadministratorbetween2:00 and4:00a.m.onaspecificdate. Table 14-4. TaskFilterSpec Data Object
Property alarm entity eventChainId parentTaskKey rootTaskKey scheduledTask state Type MOR >Alarm TaskFilterSpecByEntity int[] string[] string[] MOR >ScheduledTask TaskInfoState[] Description and Usage Optional.Usetocreateafilterbasedonspecificinstanceofan Alarm. Optional.Usetocreateafilterbasedonspecificmanagedentity types.Defaultreturnsvaluesforallmanagedentities. Optional.UsetocreateafilterthatreturnsonlyTaskobjects associatedbyaspecificchainofevents. Optional.UsetocreateafilterthatreturnsonlythoseTaskobjects thathavethespecifiedparentTaskKey. Optional.UsetocreateafilterthatreturnsonlythoseTaskobjects thatcontainthespecifiedrootTaskKey. Optional.Usetocreateafilterthatreturnsareferenceonlytothe specifiedScheduledTask.DefaultreturnsallTaskobjects. Optional.UsetocreateafilterthatreturnsonlythoseTaskobjects inthespecifiedstate: error queued running success tag string[] Optional.UsetocreateafilterthatreturnsTaskobjectswiththe specifiedtag.Includeanemptystring()inthearraytoreturn Taskobjectswithoutatag. Optional.UsetocreateafilterthatreturnsTaskobjectswiththe specifiedtime.Ifnotspecified,thecollectorincludesallTask objects. Optional.UsetocreateafilterthatreturnsTaskobjectsfora specifieduseraccount.Ifnotprovided,thenthetasksbelongingto anyuserarecollected.
time
TaskFilterSpecByTime
userName
TaskFilterSpecByUsername
134
VMware, Inc.
Deleting a HistoryCollector
AHistoryCollectorexistsonlyforthedurationofthesessionthatinstantiatedit.Youinvokethe DestroyCollectoroperationtoexplicitlyeliminatethecollectorbeforethesessionends. SeethevSphereAPIReferenceforcompleteinformationaboutHistoryCollector,EventHistoryCollector, andTaskHistoryCollector.
VMware, Inc.
135
136
VMware, Inc.
15
15
VMwarevCenterServerprovidesacomprehensivealarminfrastructureforautomatingactionsandsending varioustypesofnotificationinresponsetospecifiedserverconditions.Youcancreatealarmsthatrespondto specificconditions,serverstate,oraspecifiedevent.Analarmmusthaveanexpressionthatevaluatestoa truefalsevalue.ThealarminfrastructureincludestheAlarmManagerserviceinterface,theAlarmmanaged objecttype,andmanyassociatedobjectsthatmakeupthedatastructuresrequiredtosupportdefiningthe serverconditionsthatmustexistforanalarmtobecomeactive.Thealarminfrastructureintegrateswithother servercomponents,suchaseventsandperformancecounters.WiththereleaseofvSphere4.0,thealarm infrastructureprovidesfinergrainedcontroloveralarmthresholdsettingsthaninpriorreleases.Many AlarmsexistbydefaultonvCenterServer. Thischapterincludesthesetopics: SampleCodeReferenceonpage 137 OverviewofAlarmManagerandAlarmManagedObjectsonpage 137
VMware, Inc.
137
Defining an Alarm
Severaldifferentdataobjectsprovidethecomponentsneededtospecifythesettingsforanalarm.Thealarm infrastructureintegrateswithotherinfrastructureservices,suchastheperformancemonitoringsystemand theeventinfrastructure. Forexample,youcandefineanalarmthatmonitorsthevaluesofaspecificmetricgeneratedbyoneofthe performanceprovidersonthesystem,byspecifyingthemetricintheexpressionyoudefine.Youmightwant tocreateanAlarmthatsendsanalertemailmessagewhenCPUusageonaspecificvirtualmachineexceeds 99%formorethan30minutes. Figure 15-2. CreateAlarm Operation Returns a Reference to an Alarm Managed Object
138
VMware, Inc.
VMware, Inc.
139
TheAlarmExpressionsubtypesallowyoutospecifythresholdsonobjects,stateofobjects,orspecifyspecific eventstomonitor.YouusetheAlarmExpressiondataobjecttypetospecifytheconditionsunderwhichyou wanttheAlarmtobecomeactive. Figure 15-3. AlarmExpression Abstract Data Type and Its Subtypes
ByusingtheappropriatesubtypeofAlarmExpression,youmightsetalarmsforavarietyofconditions, states,orevents,suchastheseexamples: Powerstateofavirtualmachineorthestateofadistributedvirtualswitch,byusinga StateAlarmExpressiondataobject Resourceutilizationmetricsthatexceedaspecifiedlimit,byusingaMetricAlarmExpression Eventssuchaspoweronorpoweroffofprimaryorsecondaryvirtualmachinesinafaulttolerantcluster, byusingtheEventAlarmExpression YoucreateinstancesoftheStateAlarmExpression,EventAlarmExpression,orMetricAlarmExpression dataobjectsspecifythresholdsthattriggerthealarm.Touseaspecifictypeofeventasthebasisforanalarm configuration,youusetheEventAlarmExpression.TheEventAlarmComparisondataobjectletsyouspecify thepropertyoftheEventthatshouldtriggerthealarmandtheoperatortouseasthebasisforcomparison. Figure 15-4. EventAlarmExpression
140
VMware, Inc.
YoumustdefineeithertheredoryellowpropertyintheMetricAlarmExpressiondataobjectthatyou create.Youcanalsospecifybothproperties,ifappropriateforyourapplication.Forexample,usetheyellow propertytospecifyathresholdvaluethatsignifiesawarningcondition,andusetheredpropertytospecifya thresholdvaluethatsignifiesamoreseriouscondition.Useeachofthesepropertiesinconjunctionwiththe isAboveorisBelowMetricAlarmOperatorenumerationstocompletethedefinitionofthethreshold. Inconjunctionwithredandyellowproperties,youuseeitherredIntervaloryellowIntervalproperties. TheredIntervalandyellowIntervalpropertiesarebothnewinvSphereAPI4.0.Thesepropertiesenable youtosetthenumberofsecondsthattheperformancemetricmustbeinredoryellow,respectively,before theexpressionbecomestrue,thustriggeringthedefinedaction. UsingoneormoreinstancesoftheAndAlarmExpressionandtheOrAlarmExpressiondataobjects,you combinetheobjectsintoacompleteexpressionthatevaluatestoatruefalsevalue.
VMware, Inc.
141
Figure 15-6. AlarmAction and Action Abstract Data Object Types and Subtypes
InvSphereAPI4.0,theAlarmTriggeringActiondataobjecthasanewproperty,transitionSpecs,that providesdiscretecontroloverthetiming,thresholds,andfrequencyofanAlarm.Ratherthanusing green2yellow,red2yellow,yellow2green,andyellow2redpropertiestotriggeralarms,usethe AlarmTriggeringActionTransitionSpectodefinestatechangeswithcompletecontrol. AlarmTriggeringActionTransitionSpechaspropertiesthatenableyoutodefineastartingstatusanda finalstatusforthestateoftheAlarm.ThestateofanalarmiscontainedinanAlarmStatedataobject.Youcan alsolimitthenumberofAlarmobjectsactuallytriggeredtoasingleAlarm,byspecifyingfalseforthe repeatspropertyoftheAlarmTriggeringActionTransitionSpec. Forexample,youcanusetheMethodActiondataobjecttypetoinvokeanoperationontheserver. The MethodActiondataobjectcontainstheseproperties: nameUsethenamepropertyofMethodArgumenttospecifythenameoftheoperationthatyouwantto invokeatthescheduledtime. argumentUsetheargumentpropertytopasstheparametersrequiredbytheoperation,ifany. The argumentpropertyisdefinedasanarrayofMethodArgumentActiondataobjects. Dependingontheentityassociatedwiththealarm,theargumentpropertyofMethodActionmightnotbe needed.Forexample,thePowerOffVM_Taskoperationnormallyrequiresthemanagedobjectreferenceofthe virtualmachineyouwanttoshutdown.Ifyouralarmactionisassociatedwithacontainerobject,suchasa FolderorDatacenter,aparameterspecifyingaspecificvirtualmachinereferenceisnotneeded. Whenanalarmisactivated,itgeneratesanEventthatgetspostedtotheEventhistorydatabase.The action initiatedbytheAlarmmightalsopostitsownEventtothedatabase,dependingontheActiontype. SeethevSphereAPIReferenceforcompleteinformation.
142
VMware, Inc.
16
16
TheScheduledTaskManagerenablesyoutoscheduleoperationsonvCenterServer.Theoperationmightbe scheduledforaonetimerunorforaregularrepeatingschedule.TheScheduledTaskManagerissupported onvCenterServer.Thischapterincludesthesetopics: SampleCodeReferenceonpage 143 ScheduledTaskManagerManagedObjectonpage 143 CreatingaScheduledTaskObjectonpage 144 DefiningtheScheduleforthevCenterServerOperationonpage 145 Visibilityofmanyoftheobjectsandreturntypesdiscussedinthischapterdependsonthepermissions associatedwithuseraccountusingtheclientapplication.Avisibleentityisoneforwhichtheprincipal associatedwiththesessionhasviewprivileges.Formoreinformationaboutpermissions,seeOverviewof UserModelsandServerAccessControlConceptsonpage 33.
Figure 161showstheScheduledTaskManagerserviceinterfaceandassociateddataobjectsforitsproperties. Figure 16-1. ScheduleTaskManager and ScheduledTask Managed Object Types
144
VMware, Inc.
YoucansetaScheduledTaskattheFolder,Datacenter,orVirtualApplevelandhavethescheduledaction applytoallentitiesassociatedwiththeFolder,Datacenter,orVirtualApp.SeeUnderstandingContainer ObjectsandtheInventoryonpage 26. Figure 16-2. Using ScheduledTaskManager to Create a ScheduledTask
scheduler
TaskScheduler
VMware, Inc.
145
Table 164providessomeusageinformationabouttheTaskSchedulersubtypesshowninFigure 164.The examplesinthetableareJavacodesnippets. Table 16-4. TaskScheduler Data Object Subtypes
TaskScheduler subtype AfterStartupTaskScheduler Usage ScheduleatasktostartassoonasthevCenterServersystemisstarted,orata definedtimeafterstartup.Usetheminutepropertytospecifythenumberof minutes.Thevaluemustbezero(tasktriggeredatstartup)orhigher. AfterStartupTaskScheduler asts = new AfterStartupTaskScheduler(); asts.setMinute(10); OnceTaskScheduler Example:Scheduleatasktorun thirtyminutesafterthescheduleis submittedtotheserver. Scheduleanactiontorunonceonlyatthespecifieddateandtime. Calendar runTime= Calendar.getInstance(); runtime.add(Calendar.MINUTE, 30); OnceTaskScheduler ots = new OnceTaskScheduler (); ots.setRunAt(runTime); RecurrentTaskScheduler BasetypeforHourlyTaskScheduler,DailyTaskScheduler, WeeklyTaskScheduler,andMonthlyTaskSchedulerobjects.Settheinterval propertytodefinehowfrequentlyataskshouldrun.Forexample,settingthe intervalpropertyofanhourlytaskto4causesthetasktorunevery4hours. Scheduleatasktorunonceeveryhour(oreveryspecifiednumberofhours)ata specifiedtime.Settheintervalpropertytorunthetaskafteraspecifiednumber ofhours. HourlyTaskScheduler hts = new HourlyTaskScheduler(); hts.setMinute(30); hts.setInterval(4); DailyTaskScheduler Scheduleatasktorundailyoraspecifiednumberofdaysataspecifiedtime (hourandminutes).Useinconjunctionwiththeintervalpropertytorunthetask afteraspecifiednumberofdays. DailyTaskScheduler dts = new DailyTaskScheduler(); dts.setMinute(30); dts.setHour(14); WeeklyTaskScheduler Scheduleatasktoruneveryweek(oreveryspecifiednumberofweeks)ona specifiedday(ordays)ataspecifictime.ThehoursandminutesaresetasUTC values.Atleastoneofthebooleanvaluesmustbesettotrue.Youcanalsosetthe intervalpropertytorunthetaskafteraspecifiednumberofweeks. WeeklyTaskScheduler wts = new WeeklyTaskScheduler(); wts.setMonday(true); wts.setTuesday(true); wts.setWednesday(false); wts.setThursday(false); wts.setFriday(false); wts.setSaturday(false); wts.setSunday(true); dts.setMinute(30); dts.setHour(4); MonthlyByDayTaskScheduler Scheduleatasktoruneverymonth(oreveryspecifiednumberofmonths)ona specifieddayataspecifiedtime(hourandminutes).Youcanalsosettheinterval propertytorunthetaskafteraspecifiednumberofmonths. MonthlyByDayTaskScheduler mbdts = new MonthlyByDayTaskScheduler(); mbdts.setDay(31); mbdts.setInterval(3); mbdts.setMinute(30); mbdts.setHour(14);
Example:Scheduleatasktorun10 minutesaftervCenterServerstartup.
HourlyTaskScheduler
Example:Scheduleatasktorun every4hoursathalfpastthehour.
Example:Scheduleatasktorun dailyat9:30am(EST).
VMware, Inc.
147
AsofvSphereAPI4.0,thehourandminutepropertiesofallobjectsthatextendtheRecurrentTaskSchedule dataobjectarespecifiedinCoordinatedUniversalTime(UTC)valuesratherthanthelocaltimeoftheserver. Whenyoudefinetheschedule,convertyourlocaltimetoaUTCvalue. Forexample,thecodeinExample 161definesaScheduledTaskthatpowersonvirtualmachinesdailyat4:15 a.m.,iftheserverlocaltimeisinthePacificStandardTime(PST)timezone.ForaserverintheEastern EuropeanSummerTime(EEST)zone,thesettingisreadbythesystemas3:15pm. Example 16-1. ScheduledTask for Powering-on Virtual Machines
... / Set the schedule using the DailyTaskScheduler subtype. DailyTaskScheduler dTScheduler = new DailyTaskScheduler(); dTScheduler.setHour(12); dTScheduler.setMinute(15); ScheduledTaskSpec tSpec = new ScheduledTaskSpec(); tSpec.setDescription("Start virtual machine as per schedule."); tSpec.setEnabled(Boolean=TRUE); tSpec.setName("Power On Virtual Machine"); tSpec.setAction(ma); tSpec.setScheduler(dTScheduler); tSpec.setNotification("admin@vmware.com"); my_conn.createScheduledTask(_sic.getScheduledTaskManager, vmRef, tSpec); ...
148
VMware, Inc.
VMwarevSpherecomponentsaresecuredthroughasystemofprivileges,roles,andpermissions(see Chapter 4,OverviewofUserModelsandServerAccessControlConcepts,onpage 33formoreinformation). Thissectionlistsprivilegesrequiredtoperformvariousoperations,andprivilegesrequiredtoreadproperties. Itincludesthesetopics: PrivilegesRequiredtoInvokeOperationsonpage 149 PrivilegesRequiredtoReadPropertiesonpage 156 PrivilegesDefinedfortheAdministratorRoleonpage 158
AcquireLocalTicket AcquireMksTicket AddAuthorizationRole AddCustomFieldDef AddHost_Task AddInternetScsiSendTargets AddInternetScsiStaticTargets AddPortGroup AddServiceConsoleVirtualNic AddStandaloneHost_Task AddVirtualNic AddVirtualSwitch AnswerVM ApplyRecommendation AssignUserToGroup AttachVmfsExtent AutoStartPowerOff
System.Anonymous VirtualMachine.Interact.ConsoleInteract Authorization.ModifyRoles Global.ManageCustomFields Host.Inventory.AddHostToCluster Host.Config.Storage Host.Config.Storage Host.Config.Network Host.Config.Network Host.Inventory.AddStandaloneHost Host.Config.Network Host.Config.Network VirtualMachine.Interact.AnswerQuestion Resource.ApplyRecommendation Host.Local.ManageUserGroups Host.Config.Storage Host.Config.AutoStart
X X X X X X X X X X X X X X X X X
X X X
X X X X
X X X
X X X
VMware, Inc.
149
Table A-1. Privileges Required for vCenter Server and ESX/ESXi Operations (Continued)
Operation AutoStartPowerOn BrowseDiagnosticLog CancelTask CancelWaitForUpdates CheckCustomizationResources CheckCustomizationSpec CheckForUpdates CheckIfMasterSnmpAgentRunning CheckLicenseFeature CloneVM_Task Privilege Host.Config.AutoStart Global.Diagnostics Global.CancelTask System.View System.View VirtualMachine.Provisioning.Customize System.View Host.Config.Snmp Global.Licenses NONE. Privilegesarerequiredonthevirtualmachinebeing clonedanddependonwhetherthevirtualmachineisa template.SeeCloneVM_TaskinthevSphereAPI Referenceforspecificprivileges. YouneedtheVirtualMachine.Inventory.Create privilegeonthefolderwherethenewvirtualmachine islocated. ComputeDiskPartitionInfo ConfigureDatastorePrincipal ConfigureLicenseSource CreateAlarm Host.Config.Storage Host.Config.Maintenance Global.Licenses NONE. Createprivilegerequiredontheentityassociatedwith thealarm. CreateCluster CreateCollectorForEvents CreateCollectorForTasks CreateCustomizationSpec CreateDatacenter CreateDiagnosticPartition CreateFilter CreateFolder CreateGroup CreateLocalDatastore CreateNasDatastore CreatePerfInterval CreateResourcePool CreateScheduledTask Host.Inventory.CreateCluster System.View System.View VirtualMachine.Provisioning.ModifyCustSpecs Datacenter.Create Host.Config.Storage System.View Folder.Create Host.Local.ManageUserGroups Host.Config.Storage Host.Config.Storage Performance.ModifyIntervals Resource.CreatePool NONE. ScheduledTask.Createrequiredontheentity associatedwiththescheduledtask. CreateSnapshot_Task CreateUser CreateVM_Task VirtualMachine.State.CreateSnapshot Host.Local.ManageUserGroups VirtualMachine.Inventory.Create Also,Resource.AssignVMToPoolprivilegerequired ontheresourcepoolwithwhichthevirtualmachine willbeassociated. X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X VS X X X X X X X X X X X X X X ESX/ESXi X X
150
VMware, Inc.
Table A-1. Privileges Required for vCenter Server and ESX/ESXi Operations (Continued)
Operation CreateVmfsDatastore CurrentTime CustomizationSpecItemToXml CustomizeVM_Task DeleteCustomizationSpec DeleteFile DeselectVnic Destroy_Task DestroyChildren DestroyCollector DestroyDatastore DestroyNetwork DestroyPropertyFilter DisableFeature DisableHyperThreading DisableMultipathPath DisableRuleSet DisconnectHost_Task DoesCustomizationSpecExist DuplicateCustomizationSpec EnableFeature EnableHyperThreading EnableMultipathPath EnableRuleset EnterMaintenanceMode_Task ExitMaintenanceMode_Task ExtendVmfsDatastore FindByDatastorePath FindByDnsName FindByInventoryPath FindByIp FindByUuid FindChild FormatVmfs GenerateLogBundles_Task GetAlarm GetAlarmState Privilege Host.Config.Storage System.View System.View VirtualMachine.Provisioning.Customize VirtualMachine.Provisioning.ModifyCustSpecs Datastore.DeleteFile Host.Config.Network SeeDestroy_TaskinthevSphereAPIReference. SeeDestroyChildreninthevSphereAPIReference. NONE Datastore.Delete Network.Delete NONE Global.Licenses Host.Config.HyperThreading Host.Config.Storage Host.Config.NetService Host.Config.Connection VirtualMachine.Provisioning.ReadCustSpecs VirtualMachine.Provisioning.ModifyCustSpecs Global.Licenses Host.Config.HyperThreading Host.Config.Storage Host.Config.NetService Host.Config.Maintenance Host.Config.Maintenance Host.Config.Storage System.View System.View System.View System.View System.View System.View Host.Config.Storage Global.Diagnostics System.View NONE System.Readprivilegeisrequiredontheentity associatedwiththealarm. GetCustomizationSpec Login VirtualMachine.Provisioning.ReadCustSpecs System.Anonymous X X X VS X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X ESX/ESXi X X
VMware, Inc.
151
Table A-1. Privileges Required for vCenter Server and ESX/ESXi Operations (Continued)
Operation Logout LogUserEvent Privilege System.View NONE Global.LogEventrequiredontheentityassociated withtheevent. MarkAsTemplate MarkAsVirtualMachine VirtualMachine.Provisioning.MarkAsTemplate VirtualMachine.Provisioning.MarkAsVM Resource.AssignVMToPoolrequiredontheresource pooltoassociatewiththevirtualmachine. MergePermissions MigrateVM_Task MountToolsInstaller MoveHostInto_Task Authorization.ReassignRolePermissions SeeMigrateVM_TaskinthevSphereAPIReference. VirtualMachine.Interact.ToolsInstall Host.Inventory.EditCluster Host.Inventory.MoveHostrequiredonthehost beingmoved. MoveInto_Task Host.Inventory.EditCluster Host.Inventory.MoveHostrequiredonthehost beingmoved. MoveIntoFolder_Task MoveIntoResourcePool OverwriteCustomizationSpec PowerOffVM_Task PowerOnVM_Task QueryAvailableDisksForVmfs QueryAvailablePartition QueryAvailablePerfMetric SeeMoveIntoFolder_TaskinthevSphereAPIReference. SeeMoveIntoFolder_TaskinthevSphereAPIReference. VirtualMachine.Provisioning.ModifyCustSpecs VirtualMachine.Interact.PowerOff VirtualMachine.Interact.PowerOn Host.Config.Storage Host.Config.Storage NONE System.Readisrequiredontheentityforwhich availableperformancemetricsarequeried. QueryConfigOption QueryConfigOptionDescriptor QueryConfigTarget QueryConnectionInfo QueryDescriptions QueryEvents QueryHostConnectionInfo QueryLicenseSourceAvailability QueryLicenseUsage QueryMemoryOverhead QueryNetworkHint QueryOptions QueryPartitionCreateDesc QueryPartitionCreateOptions QueryPerf System.Read System.Read System.Read Host.Inventory.AddStandaloneHost Global.Diagnostics System.View System.Read Global.Licenses Global.Licenses System.Read Host.Config.Network System.Read Host.Config.Storage Host.Config.Storage NONE System.Readprivilegeisrequiredontheentitywhose performancestatisticsarebeingqueried. X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X VS X X ESX/ESXi X X
152
VMware, Inc.
Table A-1. Privileges Required for vCenter Server and ESX/ESXi Operations (Continued)
Operation QueryPerfComposite Privilege NONE System.Readprivilegeisrequiredontheentitywhose performancestatisticsarebeingqueried. QueryPerfCounter QueryPerfProviderSummary System.View NONE System.Readprivilegeisrequiredontheentitywhose performancestatisticsarebeingqueried. QueryVmfsDatastoreCreateOptions QueryVmfsDatastoreExtendOptions QueryVMotionCompatibility ReadNextEvents ReadNextTasks ReadPreviousEvents ReadPreviousTasks RebootGuest RebootHost_Task RecommendHostsForVm ReconfigureAlarm ReconfigureAutostart ReconfigureCluster_Task ReconfigureHostForDAS_Task ReconfigureScheduledTask ReconfigureServiceConsoleReservation ReconfigVM_Task ReconnectHost_Task RefreshDatastore RefreshFirewall RefreshNetworkSystem RefreshServices RefreshStorageSystem RegisterVM_Task Host.Config.Storage Host.Config.Storage Resource.QueryVMotion NONE NONE NONE NONE VirtualMachine.Interact.Reset Host.Config.Maintenance System.Read Alarm.Edit Host.Config.AutoStart Host.Inventory.EditCluster Host.Config.Connection ScheduledTask.Edit Host.Config.Memory dynamic Host.Config.Connection System.Read Host.Config.NetService Host.Config.Network Host.Config.NetService Host.Config.Storage VirtualMachine.Inventory.Create Resource.AssignVMToPoolprivilegeisrequiredon theresourcepooltowhichthevirtualmachineshould beattached. ReleaseLease Reload RelocateVM_Task RemoveAlarm RemoveAllSnapshots_Task RemoveAuthorizationRole RemoveCustomFieldDef RemoveDatastore NONE. System.Read Resource.ColdMigrate Alarm.Delete VirtualMachine.State.RemoveSnapshot Authorization.ModifyRoles Global.ManageCustomFields Host.Config.Storage X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X VS X ESX/ESXi X
VMware, Inc.
153
Table A-1. Privileges Required for vCenter Server and ESX/ESXi Operations (Continued)
Operation RemoveEntityPermission Privilege NONE Authorization.ModifyPermissionsprivilegeis requiredontheentityassociatedwiththepermission. RemoveGroup RemoveInternetScsiSendTargets RemoveInternetScsiStaticTargets RemovePerfInterval RemovePortGroup RemoveScheduledTask RemoveServiceConsoleVirtualNic RemoveSnapshot_Task RemoveUser RemoveVirtualNic RemoveVirtualSwitch Rename_Task RenameCustomFieldDef RenameCustomizationSpec RenameDatastore RenameSnapshot RenewLease RescanAllHba RescanHba RescanVmfs ResetCollector ResetEntityPermissions Host.Local.ManageUserGroups Host.Config.Storage Host.Config.Storage Performance.ModifyIntervals Host.Config.Network ScheduledTask.Delete Host.Config.Network VirtualMachine.State.RemoveSnapshot Host.Local.ManageUserGroups Host.Config.Network Host.Config.Network SeeRename_TaskinthevSphereAPIReference. Global.ManageCustomFields VirtualMachine.Provisioning.ModifyCustSpecs Datacenter.RenameDatastore VirtualMachine.State.RenameSnapshot NONE Host.Config.Storage Host.Config.Storage Host.Config.Storage NONE NONE Authorization.ModifyPermissionsprivilegeis requiredontheentityassociatedwiththepermission andtheentitysparent. ResetGuestInformation ResetVM_Task RestartMasterSnmpAgent RestartService RestartServiceConsoleVirtualNic RetrieveAllPermissions RetrieveDiskPartitionInfo RetrieveEntityPermissions VirtualMachine.Config.ResetGuestInfo VirtualMachine.Interact.Reset Host.Config.Snmp Host.Config.NetService Host.Config.Network System.View Host.Config.Storage NONE System.Readprivilegeisrequiredontheentitywhose performancestatisticsarebeingqueried. RetrieveEntityScheduledTask RetrieveProperties RetrieveRolePermissions RetrieveServiceContent System.View System.View System.View System.Anonymous X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X Allbut ESX2.x X X X X X X X X X X X X X X X X X VS X ESX/ESXi X
154
VMware, Inc.
Table A-1. Privileges Required for vCenter Server and ESX/ESXi Operations (Continued)
Operation RetrieveUserGroups RevertToCurrentSnapshot_Task RevertToSnapshot_Task RewindCollector RunScheduledTask SearchDatastore_Task SearchDatastoreSubFolders_Task SelectActivePartition SelectVnic SetCollectorPageSize SetEntityPermissions Privilege System.View VirtualMachine.State.RevertToSnapshot VirtualMachine.State.RevertToSnapshot NONE ScheduledTask.Run Datastore.Browse Datastore.Browse Host.Config.Storage Host.Config.Network NONE NONE Authorization.ModifyPermissionsrequiredon entityassociatedwiththepermissionsanditsparent. SetField NONE Global.SetCustomFieldrequiredontheentity associatedwiththecustomfield. SetLicenseEdition SetLocale SetMultipathLunPolicy SetScreenResolution ShutdownGuest ShutdownHost_Task StandbyGuest StartService StopMasterSnmpAgent StopServiceq SuspendVM_Task TerminateSession UnassignUserFromGroup UninstallService UnmountToolsInstaller UnregisterAndDestroy_Task UnregisterVM UpdateAuthorizationRole UpdateChildResourceConfiguration UpdateConfig UpdateConsoleIpRouteConfig UpdateDefaultPolicy UpdateDiskPartitions UpdateDnsConfig UpdateInternetScsiAlias Global.Licenses System.View Host.Config.Storage VirtualMachine.Interact.ConsoleInteract VirtualMachine.Interact.PowerOff Host.Config.Maintenance VirtualMachine.Interact.Suspend Host.Config.NetService Host.Config.Snmp Host.Config.NetService VirtualMachine.Interact.Suspend Sessions.TerminateSession Host.Local.ManageUserGroups Host.Config.NetService VirtualMachine.Interact.ToolsInstall Folder.Delete
1
VS X X
X X X X X X X X
X X X X X X
X X X X X X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X X X X X X
VirtualMachine.Inventory.Delete Authorization.ModifyRoles SeeUpdateChildResourceConfigurationinthe vSphereAPIReference. SeeUpdateConfiginthevSphereAPIReference. Host.Config.Network Host.Config.Network Host.Config.Storage Host.Config.Network Host.Config.Storage
VMware, Inc.
155
Table A-1. Privileges Required for vCenter Server and ESX/ESXi Operations (Continued)
Operation UpdateInternetScsiAuthenticationProperties UpdateInternetScsiDiscoveryProperties UpdateInternetScsiIPProperties UpdateInternetScsiName UpdateIpConfig UpdateIpRouteConfig UpdateNetworkConfig UpdateOptions UpdatePerfInterval UpdatePhysicalNicLinkSpeed UpdatePortGroup UpdateServiceConsoleVirtualNic UpdateServiceMessage UpdateServicePolicy UpdateSnmpConfig UpdateSoftwareInternetScsiEnabled UpdateSystemResources UpdateUser UpdateVirtualNic UpdateVirtualSwitch UpgradeTools_Task UpgradeVM_Task UpgradeVmfs UpgradeVmLayout ValidateMigration Privilege Host.Config.Storage Host.Config.Storage Host.Config.Storage Host.Config.Storage Host.Config.Network Host.Config.Network Host.Config.Network SeeUpdateOptionsinthevSphereAPIReference. Performance.ModifyIntervals Host.Config.Network Host.Config.Network Host.Config.Network Sessions.GlobalMessage Host.Config.NetService Host.Config.Snmp Host.Config.Storage Host.Config.Resources Host.Local.ManageUserGroups Host.Config.Network Host.Config.Network VirtualMachine.Interact.ToolsInstall VirtualMachine.Config.UpgradeVirtualHardware Host.Config.Storage Host.Config.Storage SeeValidateMigrationinthevSphereAPIReference. Resource.AssignVMToPoolrequiredonthetarget resourcepoolforthevirtualmachines. WaitForUpdates XmlToCustomizationSpecItem System.View System.View X X X VS X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X ESX/ESXi X X X X X X X
1. Theprivilegeisalsorequiredontheparentmanagedentity.
156
VMware, Inc.
VMware, Inc.
157
158
VMware, Inc.
Privilege VApp.AssignResourcePool VApp.AssignVApp VApp.AssignVM VApp.Clone VApp.Create VApp.Delete VApp.Export VApp.ExtractOvfEnvironment VApp.Import VApp.InstanceConfig VApp.Move VApp.PowerOff VApp.PowerOn VApp.Rename VApp.ResourceConfig VirtualMachine.Config.AddExistingDisk VirtualMachine.Config.AddNewDisk VirtualMachine.Config.AddRemoveDevice VirtualMachine.Config.AdvancedConfig VirtualMachine.Config.ChangeTracking VirtualMachine.Config.CPUCount VirtualMachine.Config.DiskExtend VirtualMachine.Config.DiskLease VirtualMachine.Config.EditDevice VirtualMachine.Config.HostUSBDevice VirtualMachine.Config.Memory VirtualMachine.Config.QueryUnownedFiles VirtualMachine.Config.RawDevice VirtualMachine.Config.RemoveDisk VirtualMachine.Config.Rename VirtualMachine.Config.ResetGuestInfo VirtualMachine.Config.Resource VirtualMachine.Config.Settings VirtualMachine.Config.SwapPlacement VirtualMachine.Config.UpgradeVirtualHardware VirtualMachine.Interact.AnswerQuestion VirtualMachine.Interact.Backup VirtualMachine.Interact.ConsoleInteract VirtualMachine.Interact.CreateScreenshot VirtualMachine.Interact.CreateSecondary VirtualMachine.Interact.DefragmentAllDisks
159
160
VMware, Inc.
ThissectionprovidesinformationaboutusingtheDiagnosticManagerserviceinterfacetofacilitate troubleshooting.Thisappendixincludesthesetopics: BestPracticesforTroubleshootingonpage 161 OverviewofConfigurationFilesandLogFilesonpage 162 ModifyingtheLogLeveltoObtainDetailedInformationonpage 164 UnderstandingandUsingtheDiagnosticManageronpage 167
VMware, Inc.
161
/var/log/
VirtualMachine logfile
vmfs/volume/<vm_name>
Fordevelopers,thefollowingarethemostrelevantlogfiles: hostd.log,whichcanbeusedassomethingofaSOAPmonitor(whensettotrivialoglevelasGenerating Logsonpage 166) vpxa.log(filelocatedonamanagedESXhostsystem,placedbythevCenterServer) vmware.log Inadditiontoviewinglogfilesinrealtime,usingthevSphereClient(Administration>SystemLogstab),you canalsogeneratereportsandcompletediagnosticbundles. TogenerateadiagnosticbundleusingthevSphereClient,selectFile>Export>ExportDiagnosticData. ForcompleteinformationaboutESXandvCenterServerconfigurationandsystemsadministration,seethe vSpheredocumentationlibrary,inparticular,thevSphereBasicSystemAdministrationmanual.
162
VMware, Inc.
TherawtextformofanESX(hostd)logfileisshowninExample B1. Example B-1. Sample ESX Log (hostd.log) File Data
... [2008-05-07 09:50:04.857 'SOAP' 2260 trivia] Received soap response from [TCP:myservername.vmware.com:443]: GetInterfaceVersion [2008-05-07 09:50:04.857 'ClientConnection' 2260 info] UFAD interface version is vmware-converter-4.0.0 [2008-05-07 09:50:04.857 'SOAP' 2260 trivia] Sending soap request to [TCP:myservername.eng.vmware.com:443]: logout [2008-05-07 09:50:04.857 'ProxySvc Req00588' 3136 trivia] Client HTTP stream read error [2008-05-07 09:50:04.872 'ProxySvc Req00612' 3136 trivia] Request header: POST /vmc/sdk HTTP/1.1 User-Agent: VMware-client Content-Length: 435 Content-Type: text/xml; charset=utf-8 Cookie: vmware_soap_session="F127B435-56C7-4580-BAC4-3034DA1E67B6"; $Path=/ Host: myservername.vmware.com
09:50:04.872 'ProxySvc Req00588' 3816 trivia] Closed 09:50:08.450 'App' 3560 verbose] [VpxdHeartbeat] Invalid heartbeat from 10.17.218.46 09:50:10.013 'App' 3560 verbose] [VpxdHeartbeat] Queuing 10.17.218.45:829 (host-55) 09:50:10.013 'App' 1928 verbose] [HeartbeatHandler] 50208862-2752-d94c-2a73-fa2ec9e38ecc:829 (host-55)
VMware, Inc.
163
164
VMware, Inc.
Bydefault,theloglevelsettingisinfo.Ifyourunintoissuesduringdevelopment,youcansettheloglevelto triviatoobtainSOAPmessagecontenttouseindebugging. YoucanalsousethistechniquetoanalyzeanoperationinvokedusingthehevSphereClientandthenread throughtheextensivelogfilestoextrapolatehowyoumightaccomplishthesametasksinyourowncode. NOTETheprocessdescribedbelowrequiresasystemrestart. To change the log level in config.xml for hostd 1 2 ConnecttoESXusingputtyorothersecureshell. Navigatetothelocationoftheconfig.xmlfile:
cd /etc/vmware/hostd
VMware, Inc.
165
Usevioreditorofyourchoicetoopentheconfig.xmlfile:
vi config.xml
5 6 7
Restartthehostagent:
./mgmt-vmware restart
Aftertheservicerestarts,thenewloglevelisineffect.Example B4showstheentireprocess. Example B-4. Editing the ESX Configuration File and Restarting the Server
login as: root root@sdkpubslab-01.eng.vmware.com's password: Last login: Tue May 6 03:40:58 2008 from 10.16.250.244 [root@sdkpubslab-01 root]# cd /etc/vmware/hostd [root@sdkpubslab-01 hostd]# vi config.xml ... [root@sdkpubslab-01 hostd]# cd /etc/init.d [root@sdkpubslab-01 init.d]# ./mgmt-vmware restart Stopping VMware ESX Management services: VMware ESX Host Agent Watchdog [ OK VMware ESX Host Agent [ OK Starting VMware ESX Management services: VMware ESX Host Agent (background) [ OK Availability report startup (background) [root@sdkpubslab-01 init.d]#
] ] ] [
OK
Generating Logs
IfyouareconnectedtoESX,youcanusethetailcommandtoexplicitlycreatealogfilethatcapturesthe completedetailofanyactionsthatfollow.Forexample,youcanusethevSphereClienttocreateanewvirtual machineandthenusethecontentfromthelogasamodelforhowtocreateyourowncode. To start the logging process and capture content to a file 1 Navigatetothelocationofthehostd.logfile:
cd /var/log/vmware
Runthetailcommand(startscapturingnewlogdatafromtheendofthefile),passingafilenameinwhich tocaptureoutput:
tail -f hostd.log > yourfilenamehere
166
VMware, Inc.
ThefilecontainstheSOAPmessagecontentandotherlogmessagessentandreceivedbyhostdduringthe execution.Example B5showsanexcerptofaSOAPmessage(hostd)associatedwithcreatinganewvirtual machine. Example B-5. SOAP Message Contained in Generated ESX Log
<soap:Body> <CreateVM_Task xmlns="urn:internalvim25"> <_this type="Folder">ha-folder-vm</_this> <config> <name>TestVM_06</name> <version>vmx-04</version> <guestId>rhel3_64Guest</guestId> <alternateGuestName>Red Hat Enterprise Linux 3 (64-bit)</alternateGuestName> <files> <vmPathName>[sdkpubslab-01:storage1]</vmPathName> </files> <tools> <afterPowerOn>true</afterPowerOn> <afterResume>true</afterResume> <beforeGuestStandby>true</beforeGuestStandby> <beforeGuestShutdown>true</beforeGuestShutdown> <beforeGuestReboot>true</beforeGuestReboot> </tools> <numCPUs>1</numCPUs> <memoryMB>384</memoryMB> ... </config> <pool type="ResourcePool">ha-root-pool</pool> </CreateVM_Task> ...
Besuretochangetheloglevelbacktoinfoafterobtainingtheinformationyouneedfromthelogfile.
VMware, Inc.
167
Figure B2showsaUMLclassdiagramforDiagnosticManager.TheDiagnosticManagerisavailableon bothESXandvCenterServersystems. Figure B-2. DiagnosticManager Managed Object and Associated Data Objects
AsshowninFigure B2,thethreeoperationsavailablethroughDiagnosticManagerare: BrowseDiagnosticLog GenerateLogBundleTask QueryDescriptions SeethevSphereAPIReferenceforcompletedocumentation. Thecreatorofthelogisthesystemorsubsystemthatcontrolsthespecificlog.Forexample,hostdandvpxa aretwoexamplesoflogcreators. ThecreatorvalueispopulatedfromtheDiagnosticManagerLogCreatorenumeration.Table B3listsall stringvaluescurrentlyavailablefromtheDiagnosticManagerLogCreatorenumerationthatcanpopulate thecreatorpropertyoftheDiagnosticManagerLogDescriptordataobject. Table B-3. DiagnosticManagerLogCreator Enumeration
Name hostd install recordLog serverd vpxa vpxClient vpxd Description Hostagent Installation SystemRecordLog Hostserveragent VirtualCenteragent Virtualinfrastructureclient VirtualCenterservice
168
VMware, Inc.
VMware, Inc.
169
WhenyouclicktheInvokeMethodlink,thecontentsofthelogfilefortheselectedhostarereturnedbythe vCenterServersystem(Figure B5).ThecontentsarereturnedasastringarrayforthelineTextpropertyof DiagnosticManagerLogHeader. ThestringarrayreturnedthroughtheMOBinthiswayisthecontentofthelogfile.Thecontentcontainedin thelogfileisthesamecontentthatisavailablethroughthefollowingothermechanisms: DisplayedinthevSphereClient IncludedintheadiagnosticbundlecreatedthroughtheGenerateLogBundles_Task Availableinthehostd.log Returnedtoaclientapplicationthatyouwrite Figure B-5. DiagnosticManager Operations Available Through the MOB
170
VMware, Inc.
ThevSphereClientprovidesgraphicaluserinterfaceaccesstothesesameoperations.Example B6showsthe contentofalogfilewhentheloglevelissettoverbose. Example B-6. Sample Verbose Log File Data
...[2008-05-06 09:44:42.005 'TaskManager' 15227824 info] Task Created : haTask-ha-folder-vm-vim.Folder.createVm-755 [2008-05-06 09:44:42.005 'PropertyJournal' 19266480 verbose] PropertyJournalImpl::HasChanged: Overflow [N5Vmomi19PropertyJournalImplE:0xbb3cac0] recentTask ...'vm:/vmfs/volumes/47c5b0d6-16d11128-a260-0019b9c4369f/TestVM_05/TestVM_05.vmx' 15227824 verbose] Adding task: haTask-ha-folder-vm-vim.Folder.createVm-755 [2008-05-06 09:44:42.196 'ha-host' 15227824 verbose] ModeMgr::Begin: op = normal, current = normal, count = 1 [2008-05-06 09:44:42.201 'ha-eventmgr' 15227824 info] Event 17 : Creating TestVM_05 on host sdkpubslab-01.eng.vmware.com in ha-datacenter [2008-05-06 09:44:42.218 'HostsvcPlugin' 15227824 verbose] CreateEntry '112' [2008-05-06 09:44:42.222 'ResourcePool ha-root-pool' 15227824 verbose] Added child 112 to pool [2008-05-06 09:44:42.222 'Vmsvc' 15227824 verbose] Create VM initiated [112]: /vmfs/volumes/47c5b0d6-16d11128-a260-0019b9c4369f/TestVM_05/TestVM_05.vmx...
VMware, Inc.
171
To export diagnostic data using the vSphere Client 1 2 LaunchthevSphereClientandconnecttotheESXorvCenterServersystem. SelectAdministration>ExportDiagnosticData. ForvCenterServer,youcanfilterforspecifichostswhoselogsyouwanttoexportandthelocation forstoringthelogfiles. ForESXhostsystems,youcanspecifythelocationforthebundle. 3 ClickOK.
To collect ESX VMkernel files IftheVMkernelfails,errormessagestypicallydisplaybriefly,andthenthevirtualmachinereboots. IfyouspecifiedVMwarecoredumppartitionaspartofyourvirtualmachineconfiguration,theVMkernelalso generatesacoredumpanderrorlog. Inrarecircumstances,veryseriousVMkernelproblemscanfreezetheserverwithoutraisingerrormessages ordumpingthesystemcore. To use the command line to collect ESX log files 1 2 3 UseputtyorotherSSHtooltoconnecttotheserviceconsole. Navigatetothe/usr/binsubdirectory. Runthe vm-supportscript: /usr/bin/vm-support 4 ThisscriptcollectsallrelevantESX3systemlogfiles,configurationfiles,andotherserverdetailsintoa compressedfile(thediagnosticbundle)whosenameincludesthedateandtime.
172
VMware, Inc.
VMware, Inc.
173
ThehostsinthefilecanbespecifiedbyservernameorbyIPaddressbothIPv4andIPv6aresupported.At runtime,whenyoureaccessingthecredentialstoreandtryingtoobtainthepasswordfortheusername associatedwiththehost,youmustspecifythehostinthesameformasitisstoredinthebacking filehostnameorIPaddress. Forexample,ifyoustorebyhostname,youmustenterthehostnameintheapplication.OrifyouuseIP address,youmustusethesamestyleofIPaddressasisinthefile(IPv6,IPv4). Table C-1. Specify the Server by Hostname or by IP Address
Host prodserver.mycompany.com prodserver IPv4 192.168.28.124 IPv6 2001:0db8:3c4d:0015:0000:0000:abcd:ef12
Youdonotneedtousefullyqualifieddomainnames(FQDN)ifyourlocalsystemcanfindtheserver.Ifyou douseFQDNtospecifyservernames,youmustusethesamenameswithyourapplicationcodeaswiththe CredentialStoreAdmintool. Passwordsareobfuscated(Example C1)butnotencrypted,soitsimportantthatuserskeeptheircredential storefilesprotectedontheirlocalfilesystems. CAUTIONNeveremailthecredentialstorebackingfileunlessyouencryptthefile.Thecredentialstoreclient APIsdonotencryptthecontentsofthisfile. Furthermore,theCredentialStoreAdmintooldisplaysthepasswordincleartext,notinitsobfuscatedform, sobecarefulwhenusingthetooltodisplaypasswords. TheJavaruntime(JRE)mustbeinlocalpathtorunthetool.
174
VMware, Inc.
PerlandPowerShellversionsofthiscommandlinetoolarealsoavailablewiththeVMwarevSphereSDKfor PerlandwiththeVMwarevSpherePowerCLI. To run the Java Credential Store Administration Tool on a client machine 1 InstalltheCredentialStoreAdmintoolfromthevSphereWebServicesSDKintoadirectoryontheclient machinethatwillruntheagentsoftware. Installingthetoolmeanstocopythecontentsofthe\credstoresubdirectorytoadirectoryonthelocal machineandsetthepathsothattheJavaruntimecanloadtheclassandrunit. 2 3 4 Ontheclientmachine,openacommandprompt. NavigatetothesubdirectorycontainingtheCredentialStoreadministrationtool. LaunchtheCredentialStoreAdmintoolfromacommandpromptasfollows:
java com.vmware.security.credstore.CredentialStoreAdmin add -h <servername> -u <username> -p <password>
Table C2listsallthecommandsavailabletotheCredentialStoreAdmintool. Inadditiontotheargumentslistedinthetable,eachofthesecommandscantakethefargument,tospecify thenameofthebackingfile.UsethefoptiontocreateaCredentialStorebackingfileusinganameofyour choice,includingdirectorypath. Ifyoucreateacredentialstoreusingacustomfilename,youmustpassthefilenametothecommandwhen youinvokeit. Table C-2. CredentialStoreAdmin Command Summary
Command clear add ~ -h -u -p get -h -u help <command> Arguments ~ host username password host username Forthespecifiedhostnameandusername,obtainsthepasswordfromthe credentialstore. Displaysatthecommandpromptthesamebasictextascapturedinthis table.Currently,enteringacommandnamewiththehelpcommandhasno effectontheoutputofthehelpcommand. Displaysatthecommandpromptthecontentsofthecredentialstore. Withoutanyarguments,displaysallhostnameswitheachuseraccount. Usethe--showpwargumenttodisplaythepasswordsincleartext.(Be mindfulofthesecurityissuesassociatedwithdoingthis.)Theshowpw argumentusestwodashes. Usethe-hargumentwiththespecifichostnametoobtaintheuser namestoredinthecredentialstoreforthathost.Enterthehostnamein thesame remove -h -u host username Forthespecifiedhostnameandusername,deletestheusernameand passwordfromthecredentialstore. Forthespecifiedhostname,addstothelocalcredentialstorethespecified useraccountandpassword. Description
list
--showpw -h host
VMware, Inc.
175
176
VMware, Inc.
Index
A
access, limiting 70 accessing property values 49 accessor methods 52 accounts 70 Action object 142, 146 Active Directory 37 AddAuthorizationRole operation 42 Administrator role 158 Alarm managed object 137, 138 AlarmAction object 141, 142 AlarmExpression object 139, 140 AlarmManager object 137 alarms 137, 138 actions 146 deleting 142 disabling 142 list 138 samples 137 AlarmSpec object 139 properties 139 API version supported 64 applying permission to an entity 71 asynchronous applications 46 authenticating users 39 authentication 33 authorization 33 AuthorizationManager limiting access 70 managed object 40 operations 41, 43 overview 39 automating client application login 67
B
backing file 174
C
C# datatypes,map to XML 53 helper classes 65 cancelling tasks 88 changing permissions 43 CheckForUpdates operation 79 checking migration validity 126
client applications characteristics 46 deploying 173 pattern 59 patterns 59 client data, synchronizing 78 client library 51 client-side proxy code 51 cloning virtual machines 125 closing server connection 60 collection performance 79 complex content 55 config.xml file 165 configuration files 162, 166 configured storage 107 connection object 59 container object 26 cookie 63 counter groups 112 CreateAlarm operation 138 CreateFilter 57, 77 CreateUser sample 69 creating a VirtualMachineConfigSpec 94 creating custom events 132 creating datastores 108 creating new user accounts 70 creating roles 41 creating ScheduledTask object 144 creating snapshots 97 creating templates 124 creating UserAccount objects 71 creating virtual machines 93 credential store 69 administration tool 173 backing file 68, 174 backing file structure 68 client API libraries 67 client API methods 68 CreateUser sample 69 default locations 70 file format 68 introduction 67 least privilege 69 SimpleAgent sample 69
VMware, Inc.
177
D
Datacenter managed object type 26 Datastore managed object 102 datastores configuration 110 creating 108 datatypes for MOB usage 58 default log level setting 165 deleting alarms 142 deleting HistoryCollector 135 deleting permissions 43 deleting roles 41 deleting scheduled tasks 148 deploying client applications 173 deploying virtual machines 124 deployment model 173 deployment sample 120 deprecated items 51 diagnostic bundles 171 DiagnosticManager 167 log descriptor values 168 managed object 168 operations 170 operations available through the MOB 170 DiagnosticManagerLogCreator enumeration 168 diagnostics 161 disabling alarms 142 distributed virtual switch 12
EventDescriptionEventDetail data object type 131 EventHistoryCollector 133 EventManager object 129, 130 samples 129 events creating 132 exported from ESX/ESXi system 92 formatting messages 130 management 129 message content 131 examples generated accessor and mutator methods 52 returned object displayed in MOB 54
F
file access 34 file format, credential store 68 Folder object 27, 30 folder object 26 format for iSCSI names 105
G
generated accessor and mutator methods 52 generating logs 166 granting privileges 42 group permissions 44 groups 37 management 36 membership 44 permissions 44
H
helper classes 65 C#
E
enabling single sign-on support 37 Escape characters 53 ESX/ESXi config.xml file 165 configuration file 166 events 92 inventory 30 log 163 log file 163 log level 165 PerfInterval 115 sample log 163 user model 35 Event object 129, 130 objects 92, 130, 131 samples 129 EventAlarmExpression 140
sample applications
java
65 65
sample applications
sample applications 64 historical intervals 117 HistoryCollector 133 appending objects 135 deleting 135 operations 133 overview 133 host name 174 host provisioning 12 hostd.log 163 HostDatastoreSystem creation operations 108 modification operations 110 query operations 107
178
VMware, Inc.
Index
HostDatastoreSystem object 106 HostDatastoreSystem operations 106 HostHostBusAdapter data object 102, 106 HostLocalAccountManager object 35 operations 36 HostNasVolumeSpec data object 109 HostScsiDiskPartition data object 109 HostStorageSystem object 102 operations 103 HostSystem object 106 HostVmfsSpec data object 109 HTTP-based file access 34
settings 165 vCenter Server system 167 login 67 logs 163 generating 166 server 162 system 162
M
managed object browser 17 managed object references 24 managed objects 101 handling local user accounts 38 ManagedEntity 26 descendents 13 ManagedEntity subtypes 25 permission objects 29 ManagedObjectReference default methods 52 diagram 46 Type property 46 valid string values 52 XML schema 55 managing storage 99 mapping WSDL to client-side proxy code 51 mapping XML datatypes to java and C# datatypes 53 maximum allowed resource usage 94 messages (event), formatting 130 MetricAlarmExpression data object 141 Microsoft Active Directory 37 MigrateVM_Task operation 126 migrating virtual machines 125, 126 minimum available resources 94 mo_ref 22 MOB 17, 54, 58 invoking DiagnosticManager operations 170 invoking operations 53 navigating object model 17 passing complex datatypes to operations 55 passing primitive datatypes to operations 54 monitoring performance 111 MOR (managed object reference, abbreviation for) 22 MOR>ManagedObject 22 MoRef 22 multiple API versions 63 mutator methods 52
I
Import statements 51 includes 51 intervals 117 inventory 25, 26, 30 introduction 30 permissions 29 privileges 28 root folders 27 invoking operations through MOB 53 IP address 174 iSCSI names 105 overview 101
J
java datatypes, map to XML 53 helper classes 65 TaskList application 90
L
limit 94 limiting access 70 local storage 100 local user accounts 38 locale, setting 60 localization 60 log descriptor values 168 log files overview 162 sample 171 vCenter Server 164 virtual machines 163 log level default settings 165 ESX system 165 modifying 164
VMware, Inc.
N
NAS storage overview 100 nested data objects 57 nested properties 50, 52 nested TraversalSpec 76 new features 12
179
O
ObjectContent data object 76, 77 ObjectSpec definition as XML Schema 57 obtaining statistics 115 operations HistoryCollector 133 passing complex datatypes 55 passing primitive datatypes 54 privileges required 149 required privileges for 149 optimizing query response time 118
P
passing complex datatypes to operations 55 passing primitive datatypes to operations 54 PerfCounterInfo data object 113 matching PerfMetricId CounterId 114 overview 112 properties 113 PerfEntityMetricBase data object 116 PerfInterval data objects ESX/ESXi system 115 vCenter Server system 117 PerfMetricId CounterId 114 performance 79, 111 performance counter groups 112 PerformanceManager operations 112 overview 117 properties 112 samples 111 PerfQuerySpec 115 permissions 29, 42, 43, 44, 71 changing 43 deleting 43 group membership 44 setting 43 users and groups 44 physical storage 99 powering on VM 148 predefined user roles 41 privileges 28, 40, 42 Administrator role 158 and security management 28 definition format 28 ESX/ESXi
properties, required for 156 reading object properties 156 vCenter Server operations 149 profiles 12 property values 49 PropertyCollector 77, 89 managed object type 74, 81 operations 74 operations 74 operations, compared 78 performance 79 samples 73 PropertyFilter managed object type 74 PropertyFilterSpec 56, 75, 89 introduction 75 XML schema definition 56 PropertySpec XML schema 56 provisioning 12
Q
QueryAvailablePerfMetric operation 116
R
recent tasks 89 recentTask Array 90 recurring operations 146 recursion 76 RelocateVM_Task operation 127 removing permissions 43 reservation 94 ResourceAllocationInfo, properties 94 restarting server 166 RetrieveEntityScheduledTask operation 144 RetrieveProperties operation 76 return datatypes 50 revert to snapshot 97 roles 40, 41 and security management 40 creating 42 modifying 42 root folders 27
S
sample applications 64 sample ESX log 163 samples Alarm 137 datastore operations 99 Event 129 EventManager 129 multiple API versions 64 overview 83 PerformanceManager 111
VMware, Inc.
operations
149
examples 28 format 28, 34 invoking operations 149 operations, required for 149
180
Index
PropertyCollector 73 ScheduledTaskManager 143 SearchIndex 73 storage operations 99 verbose log file 171 virtual machine deployment 120 VirtualMachine 93 sampling intervals 114 sampling periods 114 ScheduledTask 144, 145 cancelling 88 deleting 148 power on VM 148 retrieving 144 ScheduledTaskManager creating ScheduledTask 145 samples 143 ScheduledTaskSpec object 145 ScheduleTaskManager 144 scheduling recurring operations 146 scheduling vCenter Server operations 145 SDK 2.5 client applications 14 SDK 2.5 clients and vSphere 4.0 servers 13 SearchIndex 80 object 81 operations 81 samples 73 security 69 server access control 33 server connection, closing 60 server logs 162 ServiceContent data object 18, 19 property names 20 return types 20 values 20 ServiceInstance object 23 properties 18 session token 63 session tokens 59, 60, 63 SessionManager managed object 39 setting permissions 43 shares 94 simple client application 62 SimpleAgent sample 69 single sign-on support 37 snapshots 97 special characters 53 specifying server 174 statistics 115 statistics level settings 117
storage 101, 107 requirements 100 storage VMotion 127 supported version 64 synchronizing client data 78 system logs 162 system privileges 34 system roles 40, 41
T
target server, specifying 174 task infrastructure 83 task management 129 Task object 84, 85 TaskFilterSpec data object 134 TaskHistoryCollector 133 TaskInfo object 85 properties 88 properties 85 TaskInfoState values 90 TaskList java application 90 TaskManager 88 object 84, 85 properties 84 tasks, cancelling 88 TaskScheduler subtypes 147 templates 124, 125 retrieving 125 tokens 60, 63 TraversalSpec 76 troubleshooting 161
U
Unified Modeling Language 21 Update operation 77 UpdateAuthorizationRole operation 42 updating roles 41 user accounts 38, 70 user management 36 user models 33 User permissions 44 UserAccount object 71 UserDirectory 37 UserDirectory managed object 37 UserManager operations 38 server source data 37 users overview 37 permissions 44
VMware, Inc.
181
V
vCenter Server DiagnosticManagerLogDescriptor values 171 inventory 30 log files 164 scheduling operations 145 user model, overview 36 virtual machine operations 119 version information 64 versions 51, 64 sample using multiple versions 64 VI SDK 2.5-based clients 14 View object 80 View objects 79 ViewManager object 80 ViewManager objects 79 vimServiceVersions.xml 63 virtual machines cloning 125 creating 93 deployment using vCenter Server 120 log files 163 managing 93 migrating 126 migration 125 operations 119 powering on 148 templates 124 virtual storage 99 VirtualMachine ConfigSpec data object 121 nested properties 50 operations 95 operations 124 operations for VMotion 125 overview 50 RelocateVM_Task operation 127 samples 93 VirtualMachine managed object overview 120 VirtualMachineConfigSpec 94 VirtualMachineProvisioningChecker service interface 126 VirtualMachineRelocateSpec data object 127 VMkernel availability report 164 VMotion 125 vNetwork Distributed Switch See distributed virtual switch 12 vSphere 4.0 servers and SDK 2.5 clients 13
vSphere Client connected to ESX/ESXi 16 Connected to vCenter Server 16 vSphere components 11 vSphere object model 15
W
WaitForUpdates operation 79 Web Server, reusing session token 63 web service connecting 59 overview 45, 50 WSDL file 45 map to client-side proxy code 51
X
XML schema 55 ManagedObjectReference 55 PropertyFilterSpec 56 PropertySpec 56 XML Schema Primitives to .NET mapping 53 XML Schema Primitives to java mapping 53
182
VMware, Inc.