<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: VM migration to another datacenter / cluster / array and folders in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VM-migration-to-another-datacenter-cluster-array-and-folders/m-p/2878558#M104185</link>
    <description>&lt;P&gt;I begin with this script but I have an error when I want to do a vMotion on another cluster&lt;/P&gt;&lt;P&gt;$csvinput = $args[0]&lt;/P&gt;&lt;P&gt;import-csv $csvinput | foreach {&lt;BR /&gt;$name = $_.Name&lt;BR /&gt;$clustercible = $_.clustercible&lt;BR /&gt;$targetds = $_.targetds&lt;BR /&gt;$ds1=get-datacenter "dc_old" | Get-Datastore | where {$_.Name -eq "DSD_migration"}&lt;BR /&gt;$ds2=get-datacenter "dc_maq" | Get-Datastore | where {$_.Name -eq "DSD_migration"}&lt;BR /&gt;&lt;BR /&gt;Get-VM ($name) | Move-VM -Datastore $ds1 -RunAsync -Confirm:$false&lt;BR /&gt;Get-VM ($name) | Move-VM -Destination $clustercible -Datastore $ds2 &amp;nbsp;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this error:&lt;/P&gt;&lt;P&gt;Move-VM : 17/11/2021 12:20:07 Move-VM Object reference not set to an instance of an object.&lt;BR /&gt;At D:\Alexandre\Script\test1.ps1:40 char:18&lt;BR /&gt;+ Get-VM ($name) | Move-VM -Destination $clustercible -Datastore $ds2&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : NotSpecified: (:) [Move-VM], VimException&lt;BR /&gt;+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.MoveVM&lt;/P&gt;</description>
    <pubDate>Wed, 17 Nov 2021 13:02:35 GMT</pubDate>
    <dc:creator>Alexandre2</dc:creator>
    <dc:date>2021-11-17T13:02:35Z</dc:date>
    <item>
      <title>VM migration to another datacenter / cluster / array and folders</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VM-migration-to-another-datacenter-cluster-array-and-folders/m-p/2878364#M104158</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I need to migrate 2000 VMs from one datacenter to another, change arrays and folders too.&lt;/P&gt;&lt;P&gt;Below my configuration:&lt;/P&gt;&lt;P&gt;Datacenter1 - Source cluster - Source Array&lt;/P&gt;&lt;P&gt;Datacenter2 - Target cluster - Target Array&lt;/P&gt;&lt;P&gt;I want to migrate from the SAN because it's more quicker. So I've a LUN (target array) dedicated to the migration only, it has been masked on both clusters.&lt;/P&gt;&lt;P&gt;I propose to do theses actions:&lt;BR /&gt;1) SVMotion on dedicated migration LUN&lt;BR /&gt;2) vMotion target cluster&lt;BR /&gt;3) SVmotion target LUN (target array)&lt;BR /&gt;4) Folder migration (if it not exist on the target datacenter)&lt;/P&gt;&lt;P&gt;Could you have ideas to script this on Powercli ?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 15:28:52 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VM-migration-to-another-datacenter-cluster-array-and-folders/m-p/2878364#M104158</guid>
      <dc:creator>Alexandre2</dc:creator>
      <dc:date>2021-11-16T15:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: VM migration to another datacenter / cluster / array and folders</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VM-migration-to-another-datacenter-cluster-array-and-folders/m-p/2878365#M104159</link>
      <description>&lt;P&gt;Yes, I could&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 15:32:01 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VM-migration-to-another-datacenter-cluster-array-and-folders/m-p/2878365#M104159</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2021-11-16T15:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: VM migration to another datacenter / cluster / array and folders</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VM-migration-to-another-datacenter-cluster-array-and-folders/m-p/2878558#M104185</link>
      <description>&lt;P&gt;I begin with this script but I have an error when I want to do a vMotion on another cluster&lt;/P&gt;&lt;P&gt;$csvinput = $args[0]&lt;/P&gt;&lt;P&gt;import-csv $csvinput | foreach {&lt;BR /&gt;$name = $_.Name&lt;BR /&gt;$clustercible = $_.clustercible&lt;BR /&gt;$targetds = $_.targetds&lt;BR /&gt;$ds1=get-datacenter "dc_old" | Get-Datastore | where {$_.Name -eq "DSD_migration"}&lt;BR /&gt;$ds2=get-datacenter "dc_maq" | Get-Datastore | where {$_.Name -eq "DSD_migration"}&lt;BR /&gt;&lt;BR /&gt;Get-VM ($name) | Move-VM -Datastore $ds1 -RunAsync -Confirm:$false&lt;BR /&gt;Get-VM ($name) | Move-VM -Destination $clustercible -Datastore $ds2 &amp;nbsp;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this error:&lt;/P&gt;&lt;P&gt;Move-VM : 17/11/2021 12:20:07 Move-VM Object reference not set to an instance of an object.&lt;BR /&gt;At D:\Alexandre\Script\test1.ps1:40 char:18&lt;BR /&gt;+ Get-VM ($name) | Move-VM -Destination $clustercible -Datastore $ds2&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : NotSpecified: (:) [Move-VM], VimException&lt;BR /&gt;+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.MoveVM&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 13:02:35 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VM-migration-to-another-datacenter-cluster-array-and-folders/m-p/2878558#M104185</guid>
      <dc:creator>Alexandre2</dc:creator>
      <dc:date>2021-11-17T13:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: VM migration to another datacenter / cluster / array and folders</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VM-migration-to-another-datacenter-cluster-array-and-folders/m-p/2878736#M104205</link>
      <description>&lt;P&gt;I've updated my script and powercli version to 12.4 but the problem is always present. Below the script and the output:&lt;/P&gt;&lt;P&gt;import-csv $csvinput | foreach {&lt;BR /&gt;$name = get-vm $_.Name&lt;BR /&gt;$clustercible = get-cluster $_.clustercible&lt;BR /&gt;$targetds = get-datastorecluster $_.targetds&lt;BR /&gt;$ds1=get-datacenter "dc_old" | Get-Datastore | where {$_.Name -eq "DSD_migration"}&lt;BR /&gt;$ds2=get-datacenter "dc_maq" | Get-Datastore | where {$_.Name -eq "DSD_migration"}&lt;/P&gt;&lt;P&gt;#Get-VM ($name) | Move-VM -Datastore $ds1 -RunAsync -Confirm:$false&lt;BR /&gt;#Get-VM ($name) | Move-VM -Destination $clustercible -Datastore $ds2&lt;BR /&gt;Move-VM -VM $name -Destination $clustercible -Datastore $ds2&lt;BR /&gt;$vm.ExtensionData.RelocateVM($spec, [VMware.Vim.VirtualMachineMovePriority]::defaultPriority)&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PS D:\Alexandre\Script&amp;gt; .\test1.ps1 .\liste_VMs.csv&lt;/P&gt;&lt;P&gt;Name Port User&lt;BR /&gt;---- ---- ----&lt;BR /&gt;vcenter 443 xxxxxxxxxx&lt;BR /&gt;Move-VM : 18/11/2021 09:21:43 Move-VM Object reference not set to an instance of an object.&lt;BR /&gt;At D:\Alexandre\Script\test1.ps1:24 char:1&lt;BR /&gt;+ Move-VM -VM $name -Destination $clustercible -Datastore $ds2&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : NotSpecified: (:) [Move-VM], VimException&lt;BR /&gt;+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.MoveVM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have ideas to resolve this problem ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 08:54:33 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VM-migration-to-another-datacenter-cluster-array-and-folders/m-p/2878736#M104205</guid>
      <dc:creator>Alexandre2</dc:creator>
      <dc:date>2021-11-18T08:54:33Z</dc:date>
    </item>
  </channel>
</rss>

