共用方式為


ExportSystemDefinition method of the Msvm_VirtualSystemManagementService class

Exports a virtual system, or a snapshot of a virtual computer system to a file. The virtual system must be in a powered off or saved state for the export to succeed. The virtual system, its associated configuration settings, and its associated resource settings will be preserved in the resulting file.

Syntax

uint32 ExportSystemDefinition(
  [in]  CIM_ComputerSystem REF ComputerSystem,
  [in]  string                 ExportDirectory,
  [in]  string                 ExportSettingData,
  [out] CIM_ConcreteJob    REF Job
);

Parameters

ComputerSystem [in]

A reference to the CIM_ComputerSystem that represents the virtual system to export.

ExportDirectory [in]

The fully-qualified path of the directory that receives the exported virtual system. If the CreateVmExportSubdirectory property that is referenced by the ExportSettingData parameter is set to true, then this directory can be reused for exporting multiple virtual systems, and this method places each virtual system definition in a separate subdirectory under this path.

ExportSettingData [in]

An instance of Msvm_VirtualSystemExportSettingData that represents the settings for the export operation.

Job [out]

A reference to an optional job for the operation if the operation is run asynchronously.

Return value

The possible return values are:

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)

Requirements

Minimum supported client
None supported
Minimum supported server
Windows Server 2016
Namespace
Root\HyperVCluster\v2
MOF
WindowsHyperVCluster.V2.mof
DLL
VMMS.exe

See also

Msvm_VirtualSystemManagementService