StarWind iSCSI SAN
StarWind Native SAN for Hyper-V
 

VTL Cloud Replication via PowerShell

StarWind VTL / VTL Appliance / Storage Gateway for Backblaze

Moderators: art (staff), anton (staff), Anatoly (staff), Max (staff)

VTL Cloud Replication via PowerShell

Postby metrobg » Wed Dec 11, 2019 4:12 pm

Hello all,

We have been using the free license of VTL without issue for the past 60 days. Management using the powershell utilities however is proving to be an issue as related to modification of my Cloud replication settings. Using the supplied VTLReplicationSettings script does not seem to work for me.
All of the necessary parameters have been modified to suit my environment, the access key and secret key are correct but the function $device.ApplyReplicationSettings($settings) does not appear to do what it's told. Specifically, I'm attempting to change the parameter KeepInCloud from -1 to 21 and after each run of the script the parameter remains at -1, and the script returns what appears to be a 0 exit code. Can anyone shed some light as to what may be happening?
The Management Console reports Version 8.0.0.12767

Attached is the output received after running the script.
Thanks in advance for any help.
Attachments
Repliaction.PNG
Script results
Repliaction.PNG (211.47 KiB) Viewed 312 times
metrobg
 
Posts: 2
Joined: Wed Dec 11, 2019 3:56 pm

Re: VTL Cloud Replication via PowerShell

Postby Boris (staff) » Thu Dec 26, 2019 4:02 pm

WE have performed some testing in our environment and nothing has got reproduced. Could you share the script (with sensitive info removed) that you used to adjust the settings?
Boris (staff)
Staff
 
Posts: 806
Joined: Fri Jul 28, 2017 8:18 am

Re: VTL Cloud Replication via PowerShell

Postby metrobg » Sun Feb 09, 2020 2:34 pm

Import-Module StarWindX

$server = New-SWServer -host 127.0.0.1 -port 3261 -user root -password starwind

try
{
$server.Connect()

#
# common parameters
#
$deviceName = "VTL1"
$device = $null

foreach($dev in $server.Devices)
{

if( $dev.Name.Equals($deviceName) -and $dev.DeviceType.Equals("VTL") )
{
$device = $dev
break
}
}

if( !$device )
{
Write-Host "Device '$($deviceName)' not found" -foreground red
return
}

$device

$settings = new-object -ComObject StarWindX.VTLReplicationSettings
$settings

# $settings.Target=[StarWindVtlReplicationTarget]::REPLICATION_TARGET_S3
# $settings.Target=[StarWindVtlReplicationTarget]::REPLICATION_TARGET_BACKBLAZE
# $settings.Target=[StarWindVtlReplicationTarget]::REPLICATION_TARGET_AZURE
# $settings.Target=[StarWindVtlReplicationTarget]::REPLICATION_TARGET_S3GENERIC


$settings.Target=[StarWindVtlReplicationTarget]::REPLICATION_TARGET_S3GENERIC

$settings.AccessKey = 'XXXXXXXXXXXXXXXXX'
$settings.SecretAccessKey = 'XXXXXXXXXXXXXXXXXXXXX'

$settings.RegionName='us-east-1'
$settings.ContainerName='mycontainer'
$settings.KeepLocal=0 #-1 never delete, 0 delete immediate after upload, other positive value means a day interval between uploading and removing local copy
$settings.KeepInCloud=21
$settings.KeepInStorage1=-1
$settings.KeepInStorage2=1
$settings.DelayBeforeStart=0
$settings.ServiceUrl='https://s3.wasabisys.com'

$res = $device.CheckReplicationCredentials($settings)
$res
$res = $device.ApplyReplicationSettings($settings)
$res
$device.ReplicationSettings


}
catch
{
Write-Host $_ -foreground red
}
finally
{
$server.Disconnect()
}
metrobg
 
Posts: 2
Joined: Wed Dec 11, 2019 3:56 pm


Return to StarWind VTL / VTL Appliance / Storage Gateway for Backblaze

Who is online

Users browsing this forum: No registered users and 1 guest