私は、vsphere Esx 5.5上の仮想マシンを管理するWebインターフェイスで作業しています。私のプログラムは、.net Webフォーム(MVCではなく)で開発されています。VMWare.vim.dllでVMを複製した後にタスクを待つ方法は?
私は(あなたに感謝、Jeff)https://communities.vmware.com/thread/434579を助けたjeffpaton投稿(VMware.Vimを使用)に従った。
今、私はこの件について凍りついています。私はVMをクローンした後にタスクを待つ方法を知らない。私のウェブサイトは、vmware.vimを使ってVsphere Esxにvsphereコマンドを起動します。 vpshereが別の指示を出す作業を終えたときを知る必要があります。
私はPropertyCollectorを使用しようが、私はそれを使用する方法がわからない:
私はこのポストを赤が、成功せず:ここ
は、tryと私のコードの一部ですが、私がブロックされています。私はjeffpaton関数を使用します。
using VMware.Vim;
...
VimClient client;
string serverUrl = "..."
client.Connect("https://" + serverUrl + "/sdk");
client.Login(userLogin, userPassword);
...
ManagedObjectReference cloneTask_MoRef = null;
//1 waiting the cloning task
cloneTask_MoRef = sourceVm.cloneVM_Task(sourceVm.Parent, "cloneName", mySpec);
if (cloneTask_MoRef == null) {
//error
}else
{
PropertyCollector pc = new PropertyCollector(client, cloneTask_MoRef);
PropertyFilterSpec[] pfs = null;
RetrieveOptions ro = new RetrieveOptions();
RetrieveResult rResult = new RetrieveResult();
//PropertySpec
//pc.CreateFilter(pfs, true);
//rResult = pc.RetrievePropertiesEx(pfs,ro);
//
//2 PowerOn the CloneVM
cloneVM = this.vimClientTools.getVirtualMachines(selectedDC, cloneName)[0];
//3 waiting the powerOn Task...
//What could i do to know if the task is over or in progress ? :-(
私はいくつかの助けが必要です。誰かが提案が始まったら...
ありがとうございました。