1

我想以编程方式从 vSphere/vCenter 部署 VM 模板,因此我从 VMware 下载了 SDK zip 并将 VMClone.java 从 Web 服务 sdk 复制到 Eclipse 项目中,并使用以下代码运行它:

String[] myargs = new String[12];
myargs[0] = "--url";
myargs[1] = "https://192.168.0.91:9443";
myargs[2] = "--username";
myargs[3] = "[myuser]";
myargs[4] = "--password";
myargs[5] = "[mypassword].";
myargs[6] = "--datacentername";
myargs[7] = "LaptopIkor";
myargs[8] = "--vmpath";
myargs[9] = "[datastore1]/liferayTomcat/liferayTomcat.vmx";
myargs[10] = "--clonename";
myargs[11] = "DriverCreation1";
com.vmware.vm.VMClone.main(myargs);

(这只是一个示例设置,所以上面的代码没有隐私问题)(是的,这段代码不是很好,它只是为了测试)

但这因以下消息/堆栈跟踪而失败:

com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 200: OK
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at $Proxy35.retrieveServiceContent(Unknown Source)
at com.vmware.vm.VMCreate.connect(VMCreate.java:287)
at com.vmware.vm.VMCreate.main(VMCreate.java:1047)
at (my own class with above code) 

这也发生在 VMCreate 和使用 samples.jar 而不是复制源文件时。知道如何解决这个问题吗?

该 url 指向安装了 vCenter Server 的 win2008 服务器,包括 vSphere Web Client。

谢谢你的帮助。

4

1 回答 1

0
myargs[1] = "https://192.168.0.91:9443";

尝试

myargs[1] = "https://192.168.0.91/sdk";
于 2013-09-05T02:39:43.343 回答