VMware vSphere

 View Only
  • 1.  How to migrate a vm from one host to another by command line

    Posted Mar 12, 2019 06:35 AM

    Hello,

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

    thanks.



  • 2.  RE: How to migrate a vm from one host to another by command line

    Posted Mar 12, 2019 07:15 AM

    Hi,

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

    Move-VM

    Cheers



  • 3.  RE: How to migrate a vm from one host to another by command line

    Posted Mar 12, 2019 09:21 AM

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

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



  • 4.  RE: How to migrate a vm from one host to another by command line

    Posted Mar 12, 2019 09:31 AM

    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



  • 5.  RE: How to migrate a vm from one host to another by command line

    Posted Mar 12, 2019 01:51 PM

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



  • 6.  RE: How to migrate a vm from one host to another by command line

    Posted Mar 12, 2019 09:55 AM

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