10

Since vSphere 5.x we can now request a combined vMotion and Storage vMotion at the same time via the Web Client - but can it be done via the CLI (not PowerCLI)?

I've read the documentation for 5.1 CLI and googled it pretty hard but I can't find any reference. Also if I do find an answer I thought it should have a place for it be easier to find.

Chopper3
  • 100,240
  • 9
  • 106
  • 238

3 Answers3

1

can it be done via the CLI (not PowerCLI)?

You really need to clarify what you mean when you say "not PowerCLI". There's the VMA, and then there's right-on-an-ESX-server.

However I've recently taken the courses for vSphere 5...

The two operations require very different things, and are done sequentially (one-after-another) instead of simultaneously when you use the Web-based UI.

That means when you do it from the VMA command line, you have to do two different things. (What your asking isn't possible directly from the ESX servers, as far as I could tell)

Signal15
  • 943
  • 7
  • 27
0

Well, since VMotion is a licensed vCenter feature, invoking it would need to be done by vCenter server. Perhaps the reason it is not currently exposed through the CLI is for some commercial/licensing reasons..

Anyway, I've looked and can't find any references to VMware equivalent of "svmotion" for traditional VMotion either.

I suppose, if you don't want to use PowerCLI, you could try to script something resembling VMotion with vmware-cmd, but even if it works (which I doubt), it will be clunky and totally unsupported.

Basic structure behind a VMotion operation is:

  1. create a memory snapshot of a running VM on source host
  2. begin tracking changes to VM memory map since snapshot
  3. transfer the original memory snapshot to the target ESX host
  4. quiesce the VM
  5. apply memory snapshot delta to the original memory snapshot on the target host
  6. stop the VM on source host
  7. start the VM on target host with memory snapshot

There is a vmware-cmd parameter that does quiescing and memory snapshots, so while you won't be able to do (2), you may be able to do the rest.

Virtual Machine Operations

 vmware-cmd <conn_option> <config_file_path>
    [answer |
     connectdevice <device_name> |
     createsnapshot <name> <description> quiesce [0|1] memory [0|1] |
     ...

I doubt it will run in a short enough time-frame to be useful with respect to loss of service. Sorry, probably not the answer you are looking for.

-- ab1

Reference:

http://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.vcli.ref.doc%2Fvmware-cmd.html

ab77
  • 615
  • 4
  • 7
0

In v5.1 docs, it looks like you can use svmotion command, though I'm not certain if its capable of doing just storage or both.

svmotion [standard vCLI options] - -datacenter=<datacenter_name>
     - -vm <VM config datastore path>:<new datastore>
    [- -disks <virtual disk datastore path>:<new datastore>,
     <virtual disk datastore path>:<new datastore>]

svmotion link

This is also another method - How to move a VM without vCenter or Storage VMotion

Al Biheiri
  • 141
  • 2