VMware Cloud Community
Mnemonic
Enthusiast
Enthusiast
Jump to solution

How to X-vMotion / Enhanced vMotion etc.

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

0 Kudos
1 Solution

Accepted Solutions
Mnemonic
Enthusiast
Enthusiast
Jump to solution

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.

dk.atea.extra_v1.0.package

http://ge.tt/7qPXj3W1/v/0

View solution in original post

0 Kudos
7 Replies
ChristianWehner
VMware Employee
VMware Employee
Jump to solution

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 Smiley Happy

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 Smiley Wink

Cheers, Chris

0 Kudos
Mnemonic
Enthusiast
Enthusiast
Jump to solution

Last time I checked the Web Client was not supported by Onyx, so I don't see how that is going to help me.

0 Kudos
ChristianWehner
VMware Employee
VMware Employee
Jump to solution

Onyx is now supported for version 5.5.x so you are able to test this Smiley Happy I'm not sure it works through the Web Client but with the installed Client it is working.

0 Kudos
Mnemonic
Enthusiast
Enthusiast
Jump to solution

Hi Christian,

Let me enlighten you.

  • You cannot use Onyx with the Web Client.
  • You cannot do X-vMotion from the gui client, that was what I was trying to hint 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.

Mnemonic
Enthusiast
Enthusiast
Jump to solution

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

  • Create a new module in the Actions tab named "com.vmware.onyx".
  • Right-click on the new module and add the action  array.action  that is located in  "<Onyx directory>\Extensions\Onyx.Interpreters.VcoJavaScript".
  • Copy the generated script into a scripting task and modify it to suit your needs.

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");;

0 Kudos
Burke-
VMware Employee
VMware Employee
Jump to solution

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

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you!

Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator
for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
Mnemonic
Enthusiast
Enthusiast
Jump to solution

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.

dk.atea.extra_v1.0.package

http://ge.tt/7qPXj3W1/v/0

0 Kudos