PowerShell script exchange
Post Reply
Simpleacc
Influencer
Posts: 12
Liked: never
Joined: Nov 13, 2017 10:02 am
Full Name: Javier
Contact:

VMMapping with CSV

Post by Simpleacc »

Hello,

We are writing a script to auto-configure the replica VM mapping (seeding).
With our standalone works fine. But we have a problem with our CSV.

This is our current script:

Code: Select all

$replica = $original_vm_name+'_replica'
$original_vm += @(Find-VBRHvEntity -Server '$original_host -Name $original_vm_name)
$replicated_vm += @(Find-VBRHvEntity -Server $replica_host -Name $replica)

Set-VBRHvReplicaJob -Job $job -EnableVMMapping -OriginalVM $originalvm -ReplicaVM $replicavm
I think this is the problem:

$original_vm += @(Find-VBRHvEntity -Server '$original_host -Name $original_vm_name)

It is a CSV (named: C:\clusterstorage\XXXXXX) not a Server. Is there another type of cmdlet for this kind of 'sources'?

Best regards,
veremin
Product Manager
Posts: 20410
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: VMMapping with CSV

Post by veremin »

I think you need to add couple of lines:

Code: Select all

$OriginalHost = Get-VBRServer -name "Name of host imported from csv file"
$ReplicaHost = Get-VBRServer -name "Name of host imported from csv file" 
Also, you need to utilize Import-CSV cmdlet to read data from .csv file.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests