Hi,
Has anyone had any success figuring out how to do a vMotion operation on a VM without shared storage? I am surprised why there are no sample workflow for this standard operation.
/Brian
Thank you Burke. In the meantime I figured that out myself.
Here is a package with a working workflow for doing X-vMotion.
I hope it helps someone.
Hi Brian,
you can figure it out by using onyx Onyx – VMware Labs run onyx, start a session to your vCenter and start a vMotion like you need it. Onyx will present you the API calls which are needed to do this non shared storage vMotion. And onyx will present it to you in javascript so you can copy/paste it direct to the vCO and run it in most the cases
If you need any help on getting the onyx output running, you can post the output here and there will be one who can help you
Cheers, Chris
Last time I checked the Web Client was not supported by Onyx, so I don't see how that is going to help me.
Onyx is now supported for version 5.5.x so you are able to test this I'm not sure it works through the Web Client but with the installed Client it is working.
Hi Christian,
Let me enlighten you.
On the bright side, I got this from VMware:
From vCO, you need to invoke: RelocateVM_Task
Here is sample script:
var spec = new VcVirtualMachineRelocateSpec();
spec.datastore = Server.findForType("VC:Datastore", managedObject.vimHost.id + "/datastore-383");;
spec.host = Server.findForType("VC:HostSystem", managedObject.vimHost.id + "/host-382");;
spec.disk = System.getModule("com.vmware.onyx").array(VcVirtualMachineRelocateSpecDiskLocator, 1);
spec.disk[0] = new VcVirtualMachineRelocateSpecDiskLocator();
spec.disk[0].diskId = 2000;
spec.disk[0].datastore = Server.findForType("VC:Datastore", managedObject.vimHost.id + "/datastore-383");;
managedObject.relocateVM_Task(spec, VcVirtualMachineMovePriority.defaultPriority); // VirtualMachine
I have not tried it out yet, but I wanted to share this anyway. I will report back when I have testet it.
Ok, so I figured out that I need to import the Onyx module to get it working.
Like described in the Readme.html from Onyx download:
To use the generated JavaScript in a vCO workflow
I also figured out that I need to create an input parameter VC:VirtualMachine called managedObject.
I have exchanged the host-<id> to the moref id of the destination host. I got this from powerCLI with the following command:
get-vmhost myHost | get-view
I have exchanged the datastore-<id> with my destination datastore-id. I got this from powerCLI with the following command:
get-datastore myDatastore | get-view
And the it worked. I just need to get vCO to fill in the blanks, so I do not need to use powershell. Does anyone know how to do this?
The javascript lines in question are these:
spec.datastore = Server.findForType("VC:Datastore", managedObject.vimHost.id + "/datastore-383");;
spec.host = Server.findForType("VC:HostSystem", managedObject.vimHost.id + "/host-382");;
first off, when dealing with Onyx code, I personally prefer to replace "managedObject" with a more meaningful variable name... in this case, I would change it to "vm".
As for the two lines you mention, assuming you have a VC:Datastore object variable named "datastore" and a VC:HostSystem object variable named "hostSystem", those values (name-number) can be obtained by:
datastore.id
hostSystem.id
Thank you Burke. In the meantime I figured that out myself.
Here is a package with a working workflow for doing X-vMotion.
I hope it helps someone.