PowerCLI

 View Only
  • 1.  Move-VM - could not find VIContainer error

    Posted Feb 12, 2020 12:22 PM

    Hi

    Our setup is one vCenter instance with four clusters underneath it

    I am trying to use the Move-VM command to automate the vMotion of multiple VMs off an ESX server I want to take down for maintenance but when I run the Move-VM command  below to move the VM "TEST-VM" onto an ESX host called "ESXHOST02":

    Move-VM "TEST-VM" -Destination ESXHOST02

    I get the following error message:

    "Could not find VIContainer with name 'ESXHOST02'

    I am already connected to vCenter via the Connect-VIServer command

    Any advice please?



  • 2.  RE: Move-VM - could not find VIContainer error
    Best Answer

    Posted Feb 12, 2020 12:26 PM

    It looks as if the ESXi node ESXHOST02 can not be found.

    Does this return anything?

    Get-VMHost -Name ESXHOST02



  • 3.  RE: Move-VM - could not find VIContainer error

    Posted Feb 12, 2020 12:51 PM

    You pointed me in the right direction, thanks.  The output of "Get-VMHost" showed that the ESX servers name have the DNS FQDN attached so I had to address the ESX server as ESXHOST02.domain.local for example.

    Thanks