darkjezebel
Contributor
Contributor

How to migrate a vm from one host to another by command line

Hello,

Is it posible to migrate a virtual machine from a esxi host to another using commnd line and not by web?

thanks.

5 Replies
schepp
Leadership
Leadership

Hi,

there's the PowerCli Cmdlet Move-VM that will start a vmotion.

Move-VM

Cheers

0 Kudos
darkjezebel
Contributor
Contributor

I don't know how to enable Powercli in mi ESXi

couldn't I migrate theese vms by vim-cmd or esxcli?

0 Kudos
IRIX201110141
Champion
Champion

vMotion is a feature of the vCenter so the host them self doesnt know about.

  • Install PowerCLI on Windows(Powershell)
  • Install vSphere CLI on Linux/Windows (Perl)
  • Write a Script which connects against vCenter and perform a vMotion

There is a REST API comming around the corner within the new 6.7 vCenter. Rest means URLs which often ends up in a one-line so a cURL or Wget can be used and the later one is available in the Busybox of a ESXi. But i preferer to use my admin PC for that kind of jobs.

Regards

Joerg

0 Kudos
MikeStoica
Expert
Expert

here is how you can install it Install PowerCLI and then connect to esxi host using powercli and run the move command.

0 Kudos
scriptermad
Enthusiast
Enthusiast

no as vmotion is a vCenter led process and for that you need powercli and not esxcli

0 Kudos