简体   繁体   English

Hyper-V WMI:导入虚拟机并创建快照

[英]Hyper-V WMI: Import virtual machine and create snapshot

I'm using the Hyper-V WMI Provider to import virtual machines in Hyper-V, specifically using the ImportVirtualSystemEx method of the Msvm_VirtualSystemManagementService class, largely using the C# code snippets provided by MS. 我正在使用Hyper-V WMI提供程序在Hyper-V中导入虚拟机,特别是使用Msvm_VirtualSystemManagementService类的ImportVirtualSystemEx方法,主要使用MS提供的C#代码段。

I need to create a snapshot immediately after import, using the CreateVirtualSystemSnapshot method, but I can't figure out how to identify the newly imported virtual machine among all the other virtual machines that have already been imported in Hyper-V. 我需要在导入后立即使用CreateVirtualSystemSnapshot方法创建快照,但是我无法弄清楚如何在Hyper-V中已经导入的所有其他虚拟机中识别新导入的虚拟机

I was hoping to get something back from the ImportVirtualSystemEx method, but that doesn't seem to be the case. 我希望从ImportVirtualSystemEx方法中得到一些回报,但事实并非如此。

Any clues? 有什么线索吗?

我刚刚意识到,在导入期间使用GetVirtualSystemImportSettingData方法创建的Msvm_VirtualSystemImportSettingData类包含我需要的所有信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM