I'm trying to write a little script to migrate VM between two ESXi hosts. However, I'm running into error with following error:
Code: Select all
Start-VBRQuickMigration : Host 'esx-test-bc.xxxx.local' with type 'ESX' and parentId 'fe845ede-59b7-4555-b45a-4f8ee5
0f52a4' not found.
At C:\Users\moignon\Desktop\FromTemplates\sandbox.ps1:73 char:25
+ Start-VBRQuickMigration <<<< -Entity $vmToMigrate -Server $hostEsxDest -Datastore $d -ForceVeeamQM
+ CategoryInfo : NotSpecified: (:) [Start-VBRQuickMigration], Exception
+ FullyQualifiedErrorId : System.Exception,Veeam.Backup.PowerShell.Command.StartVBRQuickMigration
Here is what I'm doing:
[*]First, I get my reference to ESXi source
Code: Select all
PS C:\Users\moignon\Desktop\FromTemplates> $hostEsxSrc = Get-VBRServer -Name "192.16.21.15"
PS C:\Users\moignon\Desktop\FromTemplates> $hostEsxSrc
Info : 192.16.21.15
ParentId : 00000000-0000-0000-0000-000000000000
Id : fe845ede-59b7-4555-b45a-4f8ee50f52a4
Name : 192.16.21.15
RealName : 192.16.21.15
Reference : ha-host
Description : Created by Powershell at 2/24/2014 6:56:45 PM.
IsUnavailable : False
Type : ESXi
ApiVersion : V50
PhysHostId : c1430ddf-12f9-4f94-960c-8a7e7da0bdd5
ProxyServicesCreds :
[*]Then, I get the reference of my VM:
Code: Select all
PS C:\Users\moignon\Desktop\FromTemplates> $vmToMigrate = Find-VBRViEntity -Server $hostEsxSrc -Name "VM-Test"
PS C:\Users\moignon\Desktop\FromTemplates> $vmToMigrate
ConnHost : Veeam.Backup.Core.CHost
Type : Vm
Reference : 9
Id : fe845ede-59b7-4555-b45a-4f8ee50f52a4_9
Name : VM-Test
Path : 192.16.21.15\VM-Test
VmHostName : esx-test-bc.xxxx.local
VmFolderName : vm
FaultTolerance : False
GuestInfo : Veeam.Backup.Model.CGuestInfo
Uuid : 564d61f2-6fa7-f29f-4f93-a091433c03c0
PowerState : PoweredOff
IsTemplate : False
ProvisionedSize : 19489949324
UsedSize : 2982151820
ConnHostId : fe845ede-59b7-4555-b45a-4f8ee50f52a4
[*]Then, I get the reference to my Destination ESX:
Code: Select all
PS C:\Users\moignon\Desktop\FromTemplates> $hostEsxDest = Get-VBRServer -Name "190.63.255.21"
PS C:\Users\moignon\Desktop\FromTemplates> $hostEsxDest
Info : 190.63.255.21
ParentId : 00000000-0000-0000-0000-000000000000
Id : 9ccffa75-3270-4467-8014-d8862d410d99
Name : 190.63.255.21
RealName : 190.63.255.21
Reference : ha-host
Description : Created by Powershell at 2/24/2014 7:13:41 PM.
IsUnavailable : False
Type : ESXi
ApiVersion : V55
PhysHostId : 51d7fbd4-d35a-4337-b6b4-e73123277c27
ProxyServicesCreds :
Code: Select all
PS C:\Users\moignon\Desktop\FromTemplates> $d = Find-VBRViDatastore -Server $hostEsxDest
PS C:\Users\moignon\Desktop\FromTemplates> $d
IsVSAN : False
ConnHost : Veeam.Backup.Core.CHost
Type : Datastore
Reference : 52cbdff5-2b0ca385-31e3-b8ca3a69ec38
Capacity : 891205713920
FreeSpace : 336815194112
Id : 9ccffa75-3270-4467-8014-d8862d410d99_52cbdff5-2b0ca385-31e3-b8ca3a69ec38
Name : datastore1
Path :
Code: Select all
PS C:\Users\moignon\Desktop\FromTemplates> Start-VBRQuickMigration -Entity $vmToMigrate -Server $hostEsxDest -Datastore
$d -ForceVeeamQM
Start-VBRQuickMigration : Host 'esx-test-bc.xxxx.local' with type 'ESX' and parentId 'fe845ede-59b7-4555-b45a-4f8ee5
0f52a4' not found.
At line:1 char:24
+ Start-VBRQuickMigration <<<< -Entity $vmToMigrate -Server $hostEsxDest -Datastore $d -ForceVeeamQM
+ CategoryInfo : NotSpecified: (:) [Start-VBRQuickMigration], Exception
+ FullyQualifiedErrorId : System.Exception,Veeam.Backup.PowerShell.Command.StartVBRQuickMigration
Am I adding the host correctly ? I used this syntax:
[Veeam.Backup.Core.CHost]$hostEsx = Add-VBRESXi -Name "$ip_host" -User $LOGIN -Password $PASSWORD
I also added in my host file the IP and hostname of my source server but it seems to be a DNS issues ?
Thank you for your help