Hello,
Can anyone please confirm if it's possible to use import-vapp remotely?
My environment is vCenter 6.5 and I've tried different powercli versions, 6.3 and 6.5
I'm trying this:
invoke-command -computername $computer {
param ($clus,$vmname,$vmhost,$DC)
Add-PSSnapin VMware.VimAutomation.Core
Connect-VIServer vcenter
foreach ($ds in (Get-DatastoreCluster -Location $DC)) {$Datastore = get-datastore -location $ds.name | Sort FreeSpaceGB -Descending |Select -first 1}
Import-VApp -source "e:\Win.ova" -location $clus -Name $VMName -vmhost $vmhost -runasync -Datastore $Datastore -DiskStorageFormat Thin
} -ArgumentList $clus,$vmname,$vmhost,$DC
The process times out after 5 min.
This works perfectly when running locally.
I can't see much in the vmware logs, but I suspect it's certificate related, although I can't prove it.
The connection to the vcenter server is correct, so it's the import-Vapp what it doesn't to be working.
I've configured Set-PowerCLIConfiguration -InvalidCertificateAction ignore -confirm:$false, and also tried Set-PowerCLIConfiguration -InvalidCertificateAction prompt and run the process in the remote server locally to accept the certificates, but no luck
I've also tried a powershell file in the remote server and ran it as a scheduled task or job, no luck.
Thanks