Wednesday, January 2, 2008

How to Use the Remote Command-line Interface to Invoke Storage Vmotion in Windows Server or Desktop

Below are step by step instructions on how to perform a Storage Vmotion from a Windows system. After the instructions, I have also included an example for you to go by. I hope this helps to make the process a bit clearer for you. Any comments are always welcomed.

  1. Download the Remote Command-line Interface from this location: http://www.vmware.com/download/download.do?downloadGroup=VI-RCLI. Be sure to put your email address and password for the VMware download site. If you do not have, please register and then login to download the software.
  2. Double-click on the VMware-VIRemoteCLI-1.1.0-64644.exe to install the file. Choose the standard options and let the install take place.
  3. Once this is done, open a command line (go to start > run and type cmd)
  4. In the command line, navigate to the location of the VMware VI Remote CLI scripts. This is normally found at c:\program files\vmware\vmware vi remote CLI\bin.
  5. Once in this directory at the command line to bring up the interactive session for Storage Vmotion., type in svmotion.pl –-interactive.
  6. A command prompt will appear that states “Enter the VirtualCenter service url you wish to connect to (e.g. https://myvc.my corp.com/sdk, or just myvc.mycorp.com):”
  7. Enter the url of your Virtual Center Server or your specific ESX server and hit enter.
  8. Another prompt will ask you to “Enter your username:”
  9. Enter your domain username used to access your virtual center server or the username used to access the specific ESX server and hit enter.
  10. The next prompt states “Enter your password:”
  11. Enter the password of your domain username used to access your virtual center or the password used to access the specific ESX server and hit enter.
  12. The Remote CLI will then attempt to connect to the server. Once it is connect it will state “Connected to server.”
  13. A prompt will appear and ask you to “Enter the name of the datacenter:”
  14. Please enter the name of your datacenter after this prompt and hit enter.
  15. Another prompt will appear and ask you to “Enter the datastore path of the virtual machine (e.g. [datastore1] myvm/myvm.vmx):”
  16. At this prompt use the following format [datastorename] VM name/VM name.vmx and hit enter.
  17. Another prompt will appear and ask you to “Enter the name of the destination datastore:”
  18. After the prompt enter the name of the destination datastore. Do not place the brackets around the datastore name at this stage. Hit enter once you are complete.
  19. A final prompt will state “You can also move disks independently of the virtual machine. If you want the disks to stay with the virtual machine, then skip this step.. "
  20. After this, the prompt asks you “Would you like to individually place the disks (yes/no)?”
  21. For a standard move choose No and hit enter.

The files for the VM will then be moved without taking the server down. Depending on the size of the files, this could take some time so please be patient.

Example of a Remote CLI Storage Vmotion

C:\Program Files\VMware\VMware VI Remote CLI\bin>svmotion.pl --interactive

Entering interactive mode. All other options and environment variables will be
ignored.

Enter the VirtualCenter service url you wish to connect to (e.g. https://myvc.my
corp.com/sdk, or just myvc.mycorp.com):
myserver.testlab.com

Enter your username: vmuser

Enter your password: vmuser1

Attempting to connect to https://myserver.testlab.com/sdk.
Connected to server.


Enter the name of the datacenter: TestLab

Enter the datastore path of the virtual machine (e.g. [datastore1] myvm/myvm.vmx): [VMFS3] ITV99005/ITV99005.vmx

Enter the name of the destination datastore: VMFS4

You can also move disks independently of the virtual machine. If you want the disks to stay with the virtual machine, then skip this step..
Would you like to individually place the disks (yes/no)?
no

Performing Storage VMotion.
0% ----------------------------------------------------------------------------
------------------------ 100%
#################################################################
Storage VMotion completed successfully.

Disconnecting.

Finally, after all of this, Dominic at VMProfessional.com has posted a script on his site that simplifies the process. Go here to get the script.

Thanks Dominic!

3 Comments:

Ben Turner said...

Hey, thanks for this - very useful guide. Regards, Ben

Andrew Murrey said...

Great Walk Through

Anonymous said...

Thanks a lot.. well documented
Harpreet

Google