This is nothing earth-shattering; I just needed to record the syntax for the SVMotion command in the Remote CLI so that next time I need it six months from now, I’ll have an easy reference.
Here’s the syntax:
svmotion --datacenter=<DC Name> --url=https://<FQDN of VCMS>/sdk --username=<Username on VCMS> --password=<Password> --vm=[<Source datastore>] <Path to VMX file of VM>:<Destination datastore>
If any parameters have spaces in them—like the datacenter name or the path to the .VMX file—you’ll need to enclose those parameters in single quotes.
Tags: CLI, Storage, Virtualization, VMware
-
Are you sure it’s “smvotion”?
-
I’ve used this before like this:
A quick way to use this repeatedly, is to put this into a batch file with some wildcards.
Here’s an example of a batch with some of the items that don’t change:
svmotion –datacenter= –url=https:///sdk –username=%1 –password=%2 –vm=[%3] %4:%5Calling the batch would be something like:
svmotion.bat username password SOURCEDATASTORE VMXPATH DESTDATASTOREWill save you some typing…
-
You can also run svmotion –interactive and just answer the questions as it asks them. If you’re only running it once every 6 months, that’s a pretty easy way to remember what info it needs =)
-
Do you use the svmotion plugin from lostcreations? I find it really useful, though if VMware could’ve included it in vClient that would have been nicer. I would post a dload link but I can’t seem to find it right now.
-
Why not use the SVmotion plugin.
I made a blogpost about this plugin http://ict-freak.nl/2008/11/21/vmware-storage-vmotion-the-easy-way/ (it’s in dutch).
-
Keep in mind that it is recommended to not make more than 1 change at a time on any given LUN (power on VM, clone VM, storage VMotion, VCB backup, -anything that changes VMFS metadata). You can get into some interesting SCSI reservation errors that at best could power off a VM, or at worst ZAP it’s vmdisk or VMFS partition.
This is a great read if you are worried about SCSI res issues:
http://www.informit.com/articles/article.aspx?p=1156956&seqNum=2 -
Of course, you could use the new VI Toolkit for powershell. (v1.5)
http://blogs.vmware.com/vipowershell/
Some good videos that illustrate some of the changes:
-
I am tring to use SVMotion and I am unsure what my Datacenter name is. Can someone tell me what this field is looking for?
-
I’ve knocked up a vbscript which will svmotion a batch of VM’s and email the outcome of each svmotion
http://communities.vmware.com/blogs/virtuallysi/2009/09/17/batch-svmotion-vbscript




15 comments
Comments feed for this article
Trackback link: http://blog.scottlowe.org/2009/01/15/svmotion-syntax/trackback/