GetSummaryInformation method of the Msvm_VirtualSystemManagementService class

Returns virtual machine summary information.

Syntax

uint32 GetSummaryInformation(
  [in]  CIM_VirtualSystemSettingData REF SettingData[],
  [in]  uint32                           RequestedInformation[],
  [out] Msvm_SummaryInformationBase      SummaryInformation[]
);

Parameters

SettingData [in]

Type: CIM_VirtualSystemSettingData[]

An array of CIM_VirtualSystemSettingData instances that specify the virtual machines or snapshots for which information is to be retrieved. If this parameter is Null, information for all virtual machines is retrieved.

RequestedInformation [in]

Type: uint32[]

An array of enumeration values, which correspond to the properties in the Msvm_SummaryInformation class, that specify the data to retrieve for the virtual machines and snapshots specified in the SettingData array.

Name (0)

This corresponds to the Name property of the Msvm_SummaryInformation class.

Element Name (1)

This corresponds to the ElementName property of the Msvm_SummaryInformation class.

Creation Time (2)

This corresponds to the CreationTime property of the Msvm_SummaryInformation class.

Notes (3)

This corresponds to the Notes property of the Msvm_SummaryInformation class.

Number of Processors (4)

This corresponds to the NumberOfProcessors property of the Msvm_SummaryInformation class.

Small Thumbnail Image (80x60) (5)

This corresponds to the ThumbnailImage property of the Msvm_SummaryInformation class. A thumbnail image with the dimensions of 80 60 will be retrieved.

Medium Thumbnail Image (160x120) (6)

This corresponds to the ThumbnailImage property of the Msvm_SummaryInformation class. A thumbnail image with the dimensions of 160 120 will be retrieved.

Large Thumbnail Image (320x240) (7)

This corresponds to the ThumbnailImage property of the Msvm_SummaryInformation class. A thumbnail image with the dimensions of 320 240 will be retrieved.

AllocatedGPU (8)

This corresponds to the AllocatedGPU property of the Msvm_SummaryInformation class.

VirtualSwitchNames (9)

Version (10)

Note

Added in Windows 10 and Windows Server 2016.

Shielded (11)

Note

Added in Windows 10, version 1703 and Windows Server 2016.

EnabledState (100)

This corresponds to the EnabledState property of the Msvm_SummaryInformation class.

ProcessorLoad (101)

This corresponds to the ProcessorLoad property of the Msvm_SummaryInformation class.

ProcessorLoadHistory (102)

This corresponds to the ProcessorLoadHistory property of the Msvm_SummaryInformation class.

MemoryUsage (103)

This corresponds to the MemoryUsage property of the Msvm_SummaryInformation class.

Heartbeat (104)

This corresponds to the Heartbeat property of the Msvm_SummaryInformation class.

Uptime (105)

This corresponds to the UpTime property of the Msvm_SummaryInformation class.

GuestOperatingSystem (106)

This corresponds to the GuestOperatingSystem property of the Msvm_SummaryInformation class.

Snapshots (107)

This corresponds to the Snapshots property of the Msvm_SummaryInformation class.

AsynchronousTasks (108)

This corresponds to the AsynchronousTasks property of the Msvm_SummaryInformation class.

HealthState (109)

This corresponds to the HealthState property of the Msvm_SummaryInformation class.

OperationalStatus (110)

This corresponds to the OperationalStatus property of the Msvm_SummaryInformation class.

StatusDescriptions (111)

This corresponds to the StatusDescriptions property of the Msvm_SummaryInformation class.

MemoryAvailable (112)

This corresponds to the MemoryAvailable property of the Msvm_SummaryInformation class.

AvailableMemoryBuffer (113)

This corresponds to the AvailableMemoryBuffer property of the Msvm_SummaryInformation class.

Replication Mode (114)

This corresponds to the ReplicationMode property of the Msvm_SummaryInformation class.

Replication State (115)

This corresponds to the ReplicationState property of the Msvm_SummaryInformation class.

Replication HealthTest Replica System (116)

This corresponds to the ReplicationHealth property of the Msvm_SummaryInformation class.

Application Health (117)

ReplicationStateEx (118)

This corresponds to the ReplicationState property of the Msvm_ReplicationRelationship class. This is array for all replication state values across primary and extended relationship. 0 index value is always for primary relationship, and if extended replication is enabled, it is returned in index 1.

ReplicationHealthEx (119)

This corresponds to the ReplicationHealth property of the Msvm_ReplicationRelationship class. This is array for all replication health values across primary and extended relationship. 0 index value is always for primary relationship, and if extended replication is enabled, it is returned in index 1.

SwapFilesInUse (120)

This corresponds to the SwapFilesInUse property of the Msvm_SummaryInformation class.

IntegrationServicesVersionState (121)

ReplicationProviderId (122)

This corresponds to the Name property of the Msvm_ReplicationProvider class.

MemorySpansPhysicalNumaNodes (123)

IntegrationServicesVersionState (132)

This corresponds to the IntegrationServicesVersionState property of the Msvm_SummaryInformation class.

OtherEnabledState (132)

This corresponds to the OtherEnabledState property of the Msvm_SummaryInformation class.

(133)

SummaryInformation [out]

Type: Msvm_SummaryInformationBase[]

An array of Msvm_SummaryInformationBase instances containing the requested information for the virtual machines and/or snapshots specified in the SettingData array. This array will have the same number of elements as the SettingData array. Each of these entries will contain the Name property, even if this property was not requested. If the virtual machine or snapshot cannot be found or is unavailable, the Name property of the corresponding summary information entry will be empty.

Properties not specified in the RequestedInformation parameter will have a Null value.

Note

Datatype updated from in Windows 10, version 1703 from Msvm_SummaryInformation.

Return value

Type: uint32

This method returns one of the following values.

Completed with No Error (0)

Method Parameters Checked - Job Started (4096)

Failed (32768)

Access Denied (32769)

Not Supported (32770)

Status is unknown (32771)

Timeout (32772)

Invalid parameter (32773)

System is in use (32774)

Invalid state for this operation (32775)

Incorrect data type (32776)

System is not available (32777)

Out of memory (32778)

Remarks

Access to the Msvm_VirtualSystemManagementService class might be restricted by UAC Filtering. For more information, see User Account Control and WMI.

Examples

The following C# sample displays summary information. The referenced utilities can be found in Common utilities for the virtualization samples (V2).

Important

To function correctly, the following code must be run on the virtual machine host server, and must be run with Administrator privileges.

public class GetSummaryInformationClassV2
{
    public static void GetSummaryInformation(string[] vmNames)
    {
        ManagementScope scope = new ManagementScope(@"root\virtualization\v2", null);
        ManagementObject virtualSystemService = Utility.GetServiceObject(scope, "Msvm_VirtualSystemManagementService");
        ManagementBaseObject inParams = virtualSystemService.GetMethodParameters("GetSummaryInformation");

        ManagementObject[] virtualSystemSettings = new ManagementObject[vmNames.Length];

        for (int i = 0; i < vmNames.Length; i++)
        {
            virtualSystemSettings[i] = GetVirtualSystemSetting(vmNames[i], scope);
        }

        UInt32[] requestedInformation = new UInt32[4];
        requestedInformation[0] = 1;    // ElementName
        requestedInformation[2] = 103;  // MemoryUsage
        requestedInformation[3] = 112;  // MemoryAvailable

        inParams["SettingData"] = virtualSystemSettings;
        inParams["RequestedInformation"] = requestedInformation;

        ManagementBaseObject outParams = virtualSystemService.InvokeMethod("GetSummaryInformation", inParams, null);

        if ((UInt32)outParams["ReturnValue"] == ReturnCode.Completed)
        {
            Console.WriteLine("Summary information was retrieved successfully.");

            ManagementBaseObject[] summaryInformationArray = 
                (ManagementBaseObject[])outParams["SummaryInformation"];

            foreach (ManagementBaseObject summaryInformation in summaryInformationArray)
            {
                Console.WriteLine("\nVirtual System Summary Information:");
                if ((null == summaryInformation["Name"]) || 
                    (summaryInformation["Name"].ToString().Length == 0))
                {
                    Console.WriteLine("\tThe VM or snapshot could not be found.");
                }
                else
                {
                    Console.WriteLine("\tName: {0}", summaryInformation["Name"].ToString());
                    foreach (UInt32 requested in requestedInformation)
                    {
                        switch (requested)
                        {
                            case 1:
                                Console.WriteLine("\tElementName: {0}", summaryInformation["ElementName"].ToString());
                                break;

                            case 103:
                                Console.WriteLine("\tMemoryUsage: {0}", summaryInformation["MemoryUsage"].ToString());
                                break;

                            case 112:
                                Console.WriteLine("\tMemoryAvailable: {0}", summaryInformation["MemoryAvailable"].ToString());
                                break;
                        }
                    }
                }
            }
        }
        else
        {
            Console.WriteLine("Failed to retrieve virtual system summary information");
        }

        inParams.Dispose();
        outParams.Dispose();
        virtualSystemService.Dispose();
    }

    public static ManagementObject GetVirtualSystemSetting(string vmName, ManagementScope scope)
    {
        ManagementObject virtualSystem = Utility.GetTargetComputer(vmName, scope);

        ManagementObjectCollection virtualSystemSettings = virtualSystem.GetRelated
         (
             "Msvm_VirtualSystemSettingData",
             "Msvm_SettingsDefineState",
             null,
             null,
             "SettingData",
             "ManagedElement",
             false,
             null
         );

        ManagementObject virtualSystemSetting = null;

        foreach (ManagementObject instance in virtualSystemSettings)
        {
            virtualSystemSetting = instance;
            break;
        }

        return virtualSystemSetting;

    }
}

Requirements

Minimum supported client
Windows 8 [desktop apps only]
Minimum supported server
Windows Server 2012 [desktop apps only]
Namespace
Root\Virtualization\V2
MOF
WindowsVirtualization.V2.mof
DLL
Vmms.exe

See also

Msvm_VirtualSystemManagementService

CIM_VirtualSystemSettingData

Msvm_SummaryInformation