How To Use The WMI Interfaces With Windows

  • Slides: 50
Download presentation
How To Use The WMI Interfaces With Windows Virtualization Pierre Jacomet Senior Program Manager

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

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

Agenda Introduction Computer systems Management service Resources and resource pools Virtual system settings Runtime

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

Introduction To WMI – Windows Management Interface is Microsoft’s implementation of DMTF WBEM DMTF

Introduction To 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

WMI Value Proposition WMI is the interface that applications use to manage all aspects

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

Introduction To CIM Common Information Model Object-oriented information model Provides a conceptual framework for

Introduction To CIM Common 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

CIM Schemas are building blocks of CIM Describe and represent manageability Core model Capture

CIM 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

CIM Common models Apps Database Device Event Interop Metrics Network Physical Policy Support System

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

DMTF Management Profile Specification that defines the CIM model and associated behavior for a

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 classes and associations

CIM Virtualization Profile Specification that defines the CIM model and behavior for virtualization management

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

CIM Virtualization Profile General Design Approach Model interoperable with other virtualization platforms Virtual resources

CIM Virtualization Profile General 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

CIM Virtualization Profile Note on name differences Throughout this presentation please note the following

CIM Virtualization Profile Note 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

Main Virtualization Objects Computer systems Describe both physical and virtual computers Management service Controls

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

Agenda Introduction Computer systems Management service Resources and resource pools Virtual system settings Runtime

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

Computer Systems Physical or virtual VM is a computer system Host is a computer

Computer Systems Physical or virtual VM is a computer system Host is a computer system CIM_Computer. System (Physical) CIM_Computer. System (Virtual)

Computer Systems Linking Physical to Virtual Hosted Dependency association links VM computer system to

Computer Systems Linking Physical to Virtual Hosted Dependency association links VM computer system to Host computer system Host Computer System Hosted Dependency VM-1 Computer System VM-2 Computer System VM-3 Computer System

Computer Systems Virtual Systems All virtual aspects abstracted into a virtualization specific object Host

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

Virtual System Lifecycle (Or possible states a VM can be in) Defined Initial state,

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

Virtual System State transitions Starting state VM defined VM active VM paused VM suspended

Virtual System State transitions Starting state VM defined VM active VM paused VM suspended End state

Agenda Introduction Computer systems Management service Resources and resource pools Virtual system settings Runtime

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

Management Service Full name: Virtual System Management Service (VSMS) Central object in virtualization profile

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

Management Service Relationship to host VSMS is just another service Scoped by Hosting computer

Management Service Relationship 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 Host Computer System Hosted Service

VSMS Discovering Capabilities Virtual System Management Capabilities class describes VSMS implementation level Optional methods

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

Agenda Introduction Computer systems Management service Resources and resource pools Virtual system settings Runtime

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

Resources Physical or virtual resources have the same representation Include items like Memory Network

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

Resource Pools Managed by resource pool configuration service One allocated for a each device

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

Resource Pools Resource pool configuration service Host System Hosted Service Resource Pool Configuration Capabilities

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

Host Computer System Instance diagram Host has resources Processor, memory Host resources go into

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

Agenda WMI introduction Computer systems Management service Resources and resource pools Virtual system settings

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

Virtual System Settings Virtual aspects of a Computer system One instance for each different

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

Resource Allocation Setting Data Represents settings of a single resource One instance for each

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

Virtual Computer System Instance diagram Virtual Computer System Virtual System Settings (Active) Virtual System

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

Agenda WMI introduction Computer systems Management service Resources and resource pools Virtual system settings

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

Running VM Instance Diagram Host Computer System Virtual System Settings (Active) Hosted Dependency Resource

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

Agenda Introduction Computer systems Management service Resources and resource pools Virtual system settings Runtime

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

Snapshots Definition Represents point in time configuration of a VM including it’s resources In

Snapshots Definition Represents point in time configuration of a VM including it’s resources In CIM terms A Virtual System Settings Data structure All of the associated Resource Allocation Setting Data elements

Snapshots Creation Simplified instance diagram Virtual Computer System Element Setting Data Virtual System Settings

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

Applying A Snapshot Client enumerates snapshots using Element Setting Data aggregation Selects snapshot that

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

Applying A Snapshot Simplified instance diagram Virtual Computer System Element Setting Data Virtual System

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

Agenda Introduction Computer systems Management service Resources and resource pools Virtual system settings Runtime

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

Common Code Sequence Locate Windows virtualization services Connect to WMI CIMOM in virtualization namespace

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

Connecting To VSMS Dim WMIService Dim VMHost = ". “ ‘ Connect to the

Connecting To VSMS Dim WMIService Dim VMHost = ". “ ‘ Connect to the CIMOM in the destination machine ‘ we use the virtualization namespace. Set WMIService = Get. Object( "winmgmts: \" & VMHost _ & "rootVirtualization") ‘ Connect to WMI class that represents VSMS Set VMService = WMIService. Get("Msvm_Virtual. System. Management. Service")

Enumerate VMs Dim Dim WMIService VMList VM VMHost = ". " ' Get instance

Enumerate VMs Dim Dim WMIService VMList VM VMHost = ". " ' Get instance of the WMI Service in the virtualization namespace. Set WMIService = Get. Object("winmgmts: \" & VMHost & _ "rootvirtualization") ' Enumerate all Msvm_Virtual. Computer. System objects. Set VMList = WMIService. Instances. Of("Msvm_Virtual. Computer. System") For Each VM In VMList WScript. Echo "VM Name: " & VM. Element. Name Next

Activate A VM Const wbem. Flag. Forward. Only = 32 Const wbem. Flag. Return.

Activate A VM Const wbem. Flag. Forward. Only = 32 Const wbem. Flag. Return. Immediately = 16 Dim VMList Dim VM … … ' Use a WQL query to Find the VM passed in as argument in VMName Set VMList = WMIService. Exec. Query ( _ "SELECT * FROM Msvm_Virtual. Computer. System "WHERE " & _ Element. Name='" & VMName & "'", "WQL", _ wbem. Flag. Forward. Only + wbem. Flag. Return. Immediately _ ) ' Activate the specified VM. For Each VM In VMList WScript. Echo "Activating VM " & VM. Name VMService. Activate. Virtual. System (VM) Next

Deactivate A VM Const wbem. Flag. Forward. Only = 32 Const wbem. Flag. Return.

Deactivate A VM Const wbem. Flag. Forward. Only = 32 Const wbem. Flag. Return. Immediately = 16 Dim VMList Dim VM … … ' Use a WQL query to Find the VM passed in as argument in VMName Set VMList = WMIService. Exec. Query ( _ "SELECT * FROM Msvm_Virtual. Computer. System "WHERE " & _ Element. Name='" & VMName & "'", "WQL", _ wbem. Flag. Forward. Only + wbem. Flag. Return. Immediately _ ) ' Deactivate the specified VM. For Each VM In VMList WScript. Echo “Deactivating VM " & VM. Name VMService. De. Activate. Virtual. System (VM) Next

Call To Action If you are interested to have your software or hardware product

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 MSVirt. Ex @ microsoft. com

Additional Resources Related Sessions BUS 126 Windows Virtualization Strategy and Roadmap VIR 065 Microsoft

Additional Resources Related Sessions BUS 126 Windows Virtualization Strategy and Roadmap VIR 065 Microsoft Operating System Virtualization Strategy and Virtual Hard Disk Directions VIR 047 Hypervisor, Virtualization Stack, and Device Virtualization Architectures VIR 040 Device Virtualization Architecture VIR 043 How to Use WMI Interfaces with Windows Virtualization VIR 049 Inside Microsoft’s Network and Storage VSP/VSC VIR 124 Windows Virtualization Best Practices and Future Hardware Directions VIR 046 Hypercall APIs Explained

Additional Resources Publications and Contact Information Publications Presentations and future papers http: //www. microsoft.

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

© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows Vista and other product names

© 2006 Microsoft Corporation. All rights reserved. Microsoft, 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.