How to use Wmtask with Virtual Center?

Sep 29, 2009 at 9:56 PM

Any Sample Code....

another thing, if i have one registered virtual Mahine


How to open Vm?

i'm using the following, but this throw an exception...

Now i'm using the code with Server 2.0, but i wish to use it with Virtual Center.


VMWareVirtualMachine virtualMachine = virtualHost.Open("Vm.vmx");
Sep 30, 2009 at 2:30 PM

By Virtual Center you mean that you have ESX(i) hosts? Or VSphere 4.0 hosts? And that you use Virtual Infrastructure client to connect to those?

This is well explained in the doc and there's a sample on the front page.

// declare a virtual host
VMWareVirtualHost virtualHost = new VMWareVirtualHost();
// connect to a remote (VMWare ESX) virtual machine
virtualHost.ConnectToVMWareVIServer("", "vmuser", "password");
// open an existing virtual machine
VMWareVirtualMachine virtualMachine = virtualHost.Open("[storage] testvm/testvm.vmx");