1 / 50

How To Use The WMI Interfaces With Windows Virtualization

How To Use The WMI Interfaces With Windows Virtualization . Pierre Jacomet Senior Program Manager Windows Virtualization Microsoft Corporation. Goals. After this presentation you will Have a clear idea of Microsoft’s management approach to virtualization services

Samuel
Download Presentation

How To Use The WMI Interfaces With Windows Virtualization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How To Use The WMI Interfaces With Windows Virtualization Pierre JacometSenior Program ManagerWindows VirtualizationMicrosoft Corporation

  2. Goals • After this presentation you will • Have a clear idea of Microsoft’s management approach to virtualization services • Have a high level understanding on the virtualization services WMI interface • Have a better idea of how you can integrate your product with virtualization services • For managing purposes • To integrate your hardware

  3. Agenda • Introduction • Computer systems • Management service • Resources and resource pools • Virtual system settings • Runtime instance of a VM • Snapshots • Code examples

  4. Introduction To WMI • WMI – Windows Management Interface is Microsoft’s implementation of DMTF WBEM • DMTF = Distributed Management Task Force • WBEM = Web Based Enterprise Management • Object oriented approach to systems manageability • Uses DMTF CIM – Common Information Model • Microsoft is working in the DMTF • Defining virtualization management profile • WMI interface is subject to change • DMTF changes • Ongoing Microsoft development work

  5. WMI Value Proposition • WMI is the interface that applications use to manage all aspects of Windows virtualization services • WMI is consumer agnostic • Can be accessed remotely by WS-Management, • Programmable via C++, WSH, .NET • Hardware manufacturers benefit from understanding WMI • Understand how their hardware can participate within overall Windows virtualization services manageability

  6. Introduction To CIMCommon Information Model • Object-oriented information model • Provides a conceptual framework for describing management data • For computing and business entities • In Internet, enterprise and service provider environments • Formalism • UML – Universal Modeling Language • MOF – Managed Object Format • CIMOM – CIM object manager • Implements CIM • WMI includes a CIMOM component

  7. CIM Schema • Schemas are building blocks of CIM • Describe and represent manageability • Core model • Capture notions applicable to all management areas • Common models • Capture notions common to particular management areas • Independent of any particular implementation

  8. Apps Database Device Event Interop Metrics Network Physical Policy Support System User Virtualization CIM Common models

  9. DMTF Management Profile • Specification that defines the CIM model and associated behavior for a management domain • Use small subset of full CIM schema • Within management domain defines • Classes, associations, etc. • Requirements regarding above classesand associations

  10. CIM Virtualization Profile • Specification that defines the CIM model and behavior for virtualization management domain • Depends on CIM core model • Core includes basic classes, associations, indications, methods and properties • Implemented by Windows virtualization WMI provider

  11. CIM Virtualization ProfileGeneral Design Approach • Model interoperable with other virtualization platforms • Virtual resources modeled in the same way as their physical counterparts • Virtual aspects abstracted into associated classes

  12. CIM Virtualization ProfileNote on name differences • Throughout this presentation please note the following • Usage of word “Host” or “Physical” maps to parent partition or the computer system running in the parent partition

  13. Main Virtualization Objects • Computer systems • Describe both physical and virtual computers • Management service • Controls all aspects of the lifecycle of a VM • Virtual system settings • Represent a VM or a snapshot • Resources and resource pools • Represent resources

  14. Agenda • Introduction • Computer systems • Management service • Resources and resource pools • Virtual system settings • Runtime instance of a VM • Snapshots • Code examples

  15. Computer Systems • Physical or virtual • VM is a computer system • Host is a computer system CIM_ComputerSystem (Physical) CIM_ComputerSystem (Virtual)

  16. Computer SystemsLinking Physical to Virtual • Hosted Dependency association links VM computer system to Host computer system Host Computer System VM-1 Computer System Hosted Dependency VM-2 Computer System VM-3 Computer System

  17. Computer SystemsVirtual Systems • All virtual aspects abstracted into a virtualization specific object Host Computer System Hosted Dependency Element Setting Data Virtual Computer System Virtual System Setting Data

  18. Virtual System Lifecycle(Or possible states a VM can be in) • Defined • Initial state, resource usage described by configuration, resources not allocated except for disks • Active • VM is running, all resources are allocated • Paused • VM is paused, all resources remain allocated • Suspended • VM resources are de-allocated, state is persisted

  19. Virtual SystemState transitions Starting state VM defined VM active VM paused VM suspended End state

  20. Agenda • Introduction • Computer systems • Management service • Resources and resource pools • Virtual system settings • Runtime instance of a VM • Snapshots • Code examples

  21. Management Service • Full name: Virtual System Management Service (VSMS) • Central object in virtualization profile • Needed to access and manage virtualization services exposed by a host system • Exposes operations to manage VM lifecycle • Define virtual system • Modify virtual system • Request State Change • Others

  22. Associated Virtual System Management Service Hosted Service Management ServiceRelationship to host • VSMS is just another service • Scoped by Hosting computer system • Associated to host via Hosted Service • VSMS is special • Associated to host via Associated Virtual System Management Service Virtual System Management Service Host Computer System

  23. VSMS Discovering Capabilities • Virtual System Management Capabilities class describes VSMS implementation level • Optional methods • Indication support • Asynchronous operations support Virtual System Management Capabilities Virtual System Management Service Element Capabilities

  24. Agenda • Introduction • Computer systems • Management service • Resources and resource pools • Virtual system settings • Runtime instance of a VM • Snapshots • Code examples

  25. Resources • Physical or virtual resources have the same representation • Include items like • Memory • Network • Ports • Allocated from resource pools

  26. Resource Pools • Managed by resource pool configuration service • One allocated for a each device type • May be hierarchical • Central class for virtual device allocations • Virtual resources are allocated from resource pools

  27. Resource PoolsResource pool configuration service Host System Resource Pool Configuration Capabilities Hosted Service Element Capabilities Resource Pool Configuration Service Service Affects Element System Device Allocated From Pool Hosted Resource Pool Resource Pool Concrete Component Virtual Resource Host Resource

  28. Host has resources Processor, memory Host resources go into pools Hosted Resource Pool Concrete Comp. System Device Processor Resource Pool Processor Memory Resource Pool Memory NIC Resource Pool NIC Host Computer SystemInstance diagram Host Computer System

  29. Agenda • WMI introduction • Computer systems • Management service • Resources and resource pools • Virtual system settings • Runtime instance of a VM • Snapshots • Code examples

  30. Virtual System Settings • Virtual aspects of a Computer system • One instance for each different configuration settings for a VM • Active state • Snapshots – 0 or more • Associated with resource allocation settings for VM

  31. Resource Allocation Setting Data • Represents settings of a single resource • One instance for each different device settings • Active • Snapshots – 0 or more

  32. Virtual System has virtual devices Virtual system settings and Resource allocation settings track allocations Resource Allocation Setting Processor Virtual System Setting Data Component Resource Allocation Setting Memory Resource Allocation Setting NIC Virtual Computer SystemInstance diagram Virtual Computer System Element Setting Data Virtual System Settings (Active) System Device Element Setting Data

  33. Agenda • WMI introduction • Computer systems • Management service • Resources and resource pools • Virtual system settings • Runtime instance of a VM • Snapshots • Code examples

  34. Hosted Dependency Resource Allocation Setting Resource Allocation Setting Resource Allocation Setting Allocated from Pool Running VM InstanceDiagram Virtual Computer System Host Computer System Virtual System Settings (Active) Processor Resource pool Processor Processor Memory Resource pool Memory Memory NIC Resource pool NIC NIC

  35. Agenda • Introduction • Computer systems • Management service • Resources and resource pools • Virtual system settings • Runtime instance of a VM • Snapshots • Code examples

  36. SnapshotsDefinition • Represents point in time configurationof a VM including it’s resources • In CIM terms • A Virtual System Settings Data structure • All of the associated Resource Allocation Setting Data elements

  37. Virtual Computer System Virtual System Settings (Active) Virtual System Settings (Snapshot @ t-2) Virtual System Settings (Snapshot @ t-1) Resource Allocation Setting Resource Allocation Setting Resource Allocation Setting Processor Resource Allocation Setting Resource Allocation Setting Resource Allocation Setting Memory Resource Allocation Setting Resource Allocation Setting Resource Allocation Setting NIC Snapshots CreationSimplified instance diagram Element Setting Data

  38. Applying A Snapshot • Client enumerates snapshots using Element Setting Data aggregation • Selects snapshot that she/he wants to apply • Invokes ApplySnapshot() method of VSMS • Snapshot recorded values become current values

  39. Virtual Computer System Virtual System Settings (Active) Virtual System Settings (Snapshot @ t-2) Virtual System Settings Snapshot (t-2) Resource Allocation Setting Resource Allocation Setting Resource Allocation Setting Processor Resource Allocation Setting Resource Allocation Setting Resource Allocation Setting Memory Resource Allocation Setting Resource Allocation Setting Resource Allocation Setting NIC Applying A SnapshotSimplified instance diagram Element Setting Data Apply Snapshot

  40. Agenda • Introduction • Computer systems • Management service • Resources and resource pools • Virtual system settings • Runtime instance of a VM • Snapshots • Code examples

  41. Common Code Sequence • Locate Windows virtualization services • Connect to WMI CIMOM invirtualization namespace • Connect to VSMS • Issue WQL – WMI Query Language to • Locate instances of classes • Subscribe to events

  42. Connecting To VSMS Dim WMIService Dim VMHost VMHost = ".“ ‘ Connect to the CIMOM in the destination machine ‘ we use the \virtualization namespace. Set WMIService = GetObject( "winmgmts:\\" & VMHost _ & "\root\Virtualization") ‘ Connect to WMI class that represents VSMS Set VMService = WMIService.Get("Msvm_VirtualSystemManagementService")

  43. Enumerate VMs Dim WMIService Dim VMList Dim VM Dim VMHost VMHost = "." ' Get instance of the WMI Service in the virtualization namespace. Set WMIService = GetObject("winmgmts:\\" & VMHost & _ "\root\virtualization") ' Enumerate all Msvm_VirtualComputerSystem objects. Set VMList = WMIService.InstancesOf("Msvm_VirtualComputerSystem") For Each VM In VMList WScript.Echo "VM Name: " & VM.ElementName Next

  44. Activate A VM Const wbemFlagForwardOnly = 32 Const wbemFlagReturnImmediately = 16 Dim VMList Dim VM … … ' Use a WQL query to Find the VM passed in as argument in VMName Set VMList = WMIService.ExecQuery ( _ "SELECT * FROM Msvm_VirtualComputerSystem " & _ "WHERE ElementName='" & VMName & "'", "WQL", _ wbemFlagForwardOnly + wbemFlagReturnImmediately _ ) ' Activate the specified VM. For Each VM In VMList WScript.Echo "Activating VM " & VM.Name VMService.ActivateVirtualSystem (VM) Next

  45. Deactivate A VM Const wbemFlagForwardOnly = 32 Const wbemFlagReturnImmediately = 16 Dim VMList Dim VM … … ' Use a WQL query to Find the VM passed in as argument in VMName Set VMList = WMIService.ExecQuery ( _ "SELECT * FROM Msvm_VirtualComputerSystem " & _ "WHERE ElementName='" & VMName & "'", "WQL", _ wbemFlagForwardOnly + wbemFlagReturnImmediately _ ) ' Deactivate the specified VM. For Each VM In VMList WScript.Echo “Deactivating VM " & VM.Name VMService.DeActivateVirtualSystem (VM) Next

  46. Call To Action • If you are interested to have your software or hardware product participate in virtualized environment manageability • Stay in touch with our WMI interface • Engage in Beta program • Send feedback and questions to MSVirtEx @ microsoft.com

  47. Additional ResourcesRelated Sessions • BUS126 Windows Virtualization Strategy and Roadmap • VIR065 Microsoft Operating System Virtualization Strategyand Virtual Hard Disk Directions • VIR047 Hypervisor, Virtualization Stack,and Device Virtualization Architectures • VIR040 Device Virtualization Architecture • VIR043 How to Use WMI Interfaces with Windows Virtualization • VIR049 Inside Microsoft’s Network and Storage VSP/VSC • VIR124 Windows Virtualization Best Practicesand Future Hardware Directions • VIR046 Hypercall APIs Explained

  48. Additional ResourcesPublications and Contact Information • Publications • Presentations and future papers http://www.microsoft.com/whdc/system/platform/virtual/default.mspx • Preview papers and specs WinHEC Proceedings DVD • Windows Hypervisor Top Level Functional Specification • Windows Virtualization Glossary • Web resources • Windows Virtualization Team Bloghttp://blogs.technet.com/virtualization • AMD I/O Virtualization Technology (IOMMU) Specificationhttp://developer.amd.com/documentation.aspx • Intel® Virtualization Technology for Directed I/O Architecture Specificationftp://download.intel.com/technology/computing/vptech/Intel(r)_VT_for_Direct_IO.pdf • LaGrande Technology Preliminary Architecture Specificationhttp://www.intel.com/technology/security/ • Trusted Computing Grouphttp://www.trustedcomputinggroup.org/home • Email comments to msvirtex @ microsoft.com

  49. © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related