VMware Cloud Community
AnonAdmin
Enthusiast
Enthusiast
Jump to solution

Move-VM taking long time

I'm trying to vmotion about 200 vmGuests from one datacenter to another (both in same vCenter). The clusters both already share the same datastores so the vmotion's would just be for compute only.  Surprisingly, the few that I've done have taken upwards of 30 minutes and those were even vmGuests that were powered off. On some other guests, I would receive the error message, 'The input arguments had entities that did not belong to the same datacenter.' However when I attempt to migrate these vmGuests through the web client they go smoothly and complete within a few seconds - as I'd expect.

  • The command that I'm running is;
    • Move-VM vmGuest -Destination vmHost -NetworkAdapter (Get-NetworkAdapter -VM vmGuest) -PortGroup (Get-VDPortgroup -VDSwitch dvSwitch -Name vmGuestVLAN) -RunAsync
  • I'm running PowerCLI version 11.2.0 build 12483598.
  • vCenter is 6.7.0 (build 15976728).
  • Both source and destination datacenters are running 6.5.0 (build 8294253) hosts.

Has anyone experienced these symptoms or does anyone have a guess as to what's causing this?

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

This was a known issue, see Move-VM bug

Can you try to upgrade to the latest PowerCLI version (12.0 at the moment)?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
10 Replies
LucD
Leadership
Leadership
Jump to solution

This was a known issue, see Move-VM bug

Can you try to upgrade to the latest PowerCLI version (12.0 at the moment)?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
AnonAdmin
Enthusiast
Enthusiast
Jump to solution

Thanks! I just installed 12.0 (Install-Module -Name VMware.PowerCLI -Confirm:$false -AllowClobber -Force) and logged off. After logging back on, I run (Get-Module -Name VMware* -ListAvailable) and I see 12.0 module along side the original 11.2 module. A (Get-powercliversion) still shows that I have 11.2 loaded.

Can you advise on how I can get my session to load the newly installed 12.0 module?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Can you run the following 2 commands?

Get-Module -Name VMware* -ListAvailable

$env:PSModulePath


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
AnonAdmin
Enthusiast
Enthusiast
Jump to solution

PS C:\> Get-Module -Name VMware* -ListAvailable

    Directory: C:\Users\admin\Documents\WindowsPowerShell\Modules

ModuleType Version    Name                                ExportedCommands

---------- -------    ----                                ----------------

Script     6.7.0.1... VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...}

Script     6.7.0.1... VMware.ImageBuilder                 {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Export-EsxImage...

Manifest   11.2.0.... VMware.PowerCLI

Script     6.7.0.1... VMware.Vim

Script     11.2.0.... VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}

Script     11.0.0.... VMware.VimAutomation.Cloud          {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...}

Script     11.2.0.... VMware.VimAutomation.Common

Script     11.2.0.... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHost...

Script     11.2.0.... VMware.VimAutomation.Hcx            {Connect-HCXServer, Disconnect-HCXServer, Get-HCXAppliance, Get-HCXApplianceCompute...}

Script     7.6.0.1... VMware.VimAutomation.HorizonView    {Connect-HVServer, Disconnect-HVServer}

Script     10.0.0.... VMware.VimAutomation.License        Get-LicenseDataManager

Script     11.2.0.... VMware.VimAutomation.Nsxt           {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtPolicyService, Get-NsxtService}

Script     11.2.0.... VMware.VimAutomation.Sdk            {Get-ErrorReport, Get-PSVersion, Get-InstallPath}

Script     11.0.0.... VMware.VimAutomation.Security       {Get-SecurityInfo, Get-VTpm, Get-VTpmCertificate, Get-VTpmCSR...}

Script     11.2.0.... VMware.VimAutomation.Srm            {Connect-SrmServer, Disconnect-SrmServer}

Script     11.2.0.... VMware.VimAutomation.Storage        {Add-KeyManagementServer, Copy-VDisk, Export-SpbmStoragePolicy, Get-KeyManagementServer...

Script     1.3.0.0    VMware.VimAutomation.StorageUtility Update-VmfsDatastore

Script     11.2.0.... VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup, Export-VDS...

Script     11.2.0.... VMware.VimAutomation.Vmc            {Connect-Vmc, Disconnect-Vmc, Get-VmcSddcNetworkService, Get-VmcService...}

Script     10.0.0.... VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAlertDefinition...}

Script     6.5.1.7... VMware.VumAutomation                {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance...}

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    Name                                ExportedCommands

---------- -------    ----                                ----------------

Script     12.0.0.... VMware.CloudServices                {Connect-Vcs, Get-VcsOrganizationRole, Get-VcsService, Get-VcsServiceRole...}

Script     7.0.0.1... VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...}

Script     6.7.0.1... VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...}

Script     7.0.0.1... VMware.ImageBuilder                 {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Export-EsxImage...

Script     6.7.0.1... VMware.ImageBuilder                 {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Export-EsxImage...

Manifest   12.0.0.... VMware.PowerCLI

Manifest   11.2.0.... VMware.PowerCLI

Script     7.0.0.1... VMware.Vim

Script     6.7.0.1... VMware.Vim

Script     12.0.0.... VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}

Script     11.2.0.... VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}

Script     12.0.0.... VMware.VimAutomation.Cloud          {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...}

Script     11.0.0.... VMware.VimAutomation.Cloud          {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...}

Script     12.0.0.... VMware.VimAutomation.Common         {Get-Task, New-OAuthSecurityContext, Stop-Task, Wait-Task}

Script     11.2.0.... VMware.VimAutomation.Common

Script     12.0.0.... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHost...

Script     11.2.0.... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHost...

Script     12.0.0.... VMware.VimAutomation.Hcx            {Connect-HCXServer, Disconnect-HCXServer, Get-HCXAppliance, Get-HCXComputeProfile...}

Script     11.2.0.... VMware.VimAutomation.Hcx            {Connect-HCXServer, Disconnect-HCXServer, Get-HCXAppliance, Get-HCXApplianceCompute...}

Script     7.12.0.... VMware.VimAutomation.HorizonView    {Connect-HVServer, Disconnect-HVServer}

Script     7.6.0.1... VMware.VimAutomation.HorizonView    {Connect-HVServer, Disconnect-HVServer}

Script     12.0.0.... VMware.VimAutomation.License        Get-LicenseDataManager

Script     10.0.0.... VMware.VimAutomation.License        Get-LicenseDataManager

Script     12.0.0.... VMware.VimAutomation.Nsxt           {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtPolicyService, Get-NsxtService}

Script     11.2.0.... VMware.VimAutomation.Nsxt           {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtPolicyService, Get-NsxtService}

Script     12.0.0.... VMware.VimAutomation.Sdk            Get-ErrorReport

Script     11.2.0.... VMware.VimAutomation.Sdk            Get-ErrorReport

Script     12.0.0.... VMware.VimAutomation.Security       {Add-AttestationServiceInfo, Add-KeyProviderServiceInfo, Add-TrustAuthorityKeyProviderS...

Script     11.0.0.... VMware.VimAutomation.Security       {Get-SecurityInfo, Get-VTpm, Get-VTpmCertificate, Get-VTpmCSR...}

Script     11.5.0.... VMware.VimAutomation.Srm            {Connect-SrmServer, Disconnect-SrmServer}

Script     11.2.0.... VMware.VimAutomation.Srm            {Connect-SrmServer, Disconnect-SrmServer}

Script     12.0.0.... VMware.VimAutomation.Storage        {Add-EntityDefaultKeyProvider, Add-KeyManagementServer, Add-VsanFileServiceOvf, Add-Vsa...

Script     11.2.0.... VMware.VimAutomation.Storage        {Add-KeyManagementServer, Copy-VDisk, Export-SpbmStoragePolicy, Get-KeyManagementServer...

Script     1.3.0.0    VMware.VimAutomation.StorageUtility Update-VmfsDatastore

Script     12.0.0.... VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup, Export-VDS...

Script     11.2.0.... VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup, Export-VDS...

Script     12.0.0.... VMware.VimAutomation.Vmc            {Add-VmcSddcHost, Connect-Vmc, Disconnect-Vmc, Get-AwsAccount...}

Script     11.2.0.... VMware.VimAutomation.Vmc            {Connect-Vmc, Disconnect-Vmc, Get-VmcSddcNetworkService, Get-VmcService...}

Script     12.0.0.... VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAlertDefinition...}

Script     10.0.0.... VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAlertDefinition...}

Script     12.0.0.... VMware.VimAutomation.WorkloadMan... {Get-WMNamespace, Get-WMNamespacePermission, Get-WMNamespaceStoragePolicy, New-WMNamesp...

Script     6.5.1.7... VMware.VumAutomation                {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance...}

    Directory: D:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules

ModuleType Version    Name                                ExportedCommands

---------- -------    ----                                ----------------

Binary     6.0.0.0    VMware.DeployAutomation

Binary     6.0.0.0    VMware.ImageBuilder

Binary     6.5.0.4... VMware.VimAutomation.Cis.Core

Binary     6.5.0.4... VMware.VimAutomation.Cloud

Manifest   6.5.0.4... VMware.VimAutomation.Common

Binary     6.5.0.2... VMware.VimAutomation.Core           HookGetViewAutoCompleter

Binary     6.0.0.0    VMware.VimAutomation.HA

Binary     7.0.2.4... VMware.VimAutomation.HorizonView

Binary     6.5.0.4... VMware.VimAutomation.License

Binary     6.5.0.4... VMware.VimAutomation.PCloud

Manifest   6.5.0.4... VMware.VimAutomation.Sdk            Get-PSVersion

Binary     6.5.0.4... VMware.VimAutomation.Storage

Binary     6.5.0.4... VMware.VimAutomation.Vds

Binary     6.5.0.4... VMware.VimAutomation.vROps

Binary     6.0.0.0    VMware.VumAutomation

PS C:\> $env:PSModulePath

C:\Users\admin\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modu

les;D:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules;C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell\

PS C:\> Get-Powercliversion

PowerCLI Version

----------------

   VMware PowerCLI 11.2.0 build 12483598

---------------

Component Versions

---------------

   VMware Cis Core PowerCLI Component PowerCLI Component 11.2 build 12483642

   VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 11.2 build 12483638

PS C:\>

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Can you delete the VMware folders in C:\Users\admin\Documents\WindowsPowerShell\Modules

And then start your PowerShell session again


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
AnonAdmin
Enthusiast
Enthusiast
Jump to solution

That did the trick - thanks!!

However, my attempts to run 'Move-VM' result in the same error message; 'The input arguments had entities that did not belong to the same datacenter.'

I checked that the vmGuest does not have anything attached to its CD-ROM drive as was mentioned in some other forum posts.  I think at this point I may need to open a support case.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes, opening an SR would be a good idea if the problem persists.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
AnonAdmin
Enthusiast
Enthusiast
Jump to solution

I got an SR open for this but while I'm waiting I think I know what the issue is - Although the vmGuests that I'm migrating are in a different cluster and datacenter (but same vcenter), they share the same datastore. And I suspect that with the source & destination datastore name being the same it's causing this error. That Move-VM bug forum post that referenced earlier indicated that the source & destination Folder name were the same however we don't use Folders. So it kinda makes sense that this issue is related to an inventory object being duplicated across clusters.

Do you know if there's a way around this by invoking the Datastore name in a 'more unique' method other than just its name.  I'm just looking for any way around this...

0 Kudos
LucD
Leadership
Leadership
Jump to solution

You can do a Get-Datastore, and use the returned object on the Datastore parameter.

With the Get-Datastore you should be able to retrieve the correct datastore.

Get-Cluster -Name MyCluster | Get-Datastore -Name MyDS


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

AnonAdmin
Enthusiast
Enthusiast
Jump to solution

That works perfectly! Thanks again for getting me on my way around this bug!!

0 Kudos