VTL Cloud Replication via PowerShell

StarWind VTL, VTL Free, VTL Appliance

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

Post Reply
metrobg
Posts: 4
Joined: Wed Dec 11, 2019 3:56 pm

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
Script results
Script results
Repliaction.PNG (211.47 KiB) Viewed 23098 times
Boris (staff)
Staff
Posts: 805
Joined: Fri Jul 28, 2017 8:18 am

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?
metrobg
Posts: 4
Joined: Wed Dec 11, 2019 3:56 pm

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()
}
dgbegfb
Posts: 12
Joined: Tue Mar 31, 2020 11:14 am

Tue Mar 31, 2020 11:50 am

Boris (staff) wrote: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?
Hi Boris,

I have exactly the same issue with version 8.0 13481 Free license. I try to adjust $keepInCloud setting to 180 days for Azure blob archive tier storage after that $device.ReplicationSettings shows me $keepInCloud : -1 but the key <timedeletecloud>180</timedeletecloud> in VTL1.SWDSK every time properly changes.

Where is indeed actual value?
yaroslav (staff)
Staff
Posts: 2904
Joined: Mon Nov 18, 2019 11:11 am

Thu Apr 02, 2020 12:39 pm

Hi,

Sorry for the delayed response. Could you try setting $keepInCloud to 1 day to see if tape moves properly?
<timedeletecloud>180</timedeletecloud>
in VTL1.SWDSK looks reliable to me.
Could you try setting that value to 1 day and see if it finally works as expected?
dgbegfb
Posts: 12
Joined: Tue Mar 31, 2020 11:14 am

Fri Apr 03, 2020 11:48 am

yaroslav (staff) wrote:Hi,

Sorry for the delayed response. Could you try setting $keepInCloud to 1 day to see if tape moves properly?
<timedeletecloud>180</timedeletecloud>
in VTL1.SWDSK looks reliable to me.
Could you try setting that value to 1 day and see if it finally works as expected?
If you perform an upload a tape after the setting $keepInCloud=1 has been made it deletes the tape exactly in 24h after an upload has been finished and doesn't affect previously uploaded tapes.

So it works but this adjustment affect only the newly created tapes.

Cheers.
yaroslav (staff)
Staff
Posts: 2904
Joined: Mon Nov 18, 2019 11:11 am

Fri Apr 03, 2020 3:41 pm

Absolutely right! Only new tapes get affected by changing the retention policy.
Is the problem resolved?
dgbegfb
Posts: 12
Joined: Tue Mar 31, 2020 11:14 am

Fri Apr 03, 2020 4:21 pm

Yep, thanks.
yaroslav (staff)
Staff
Posts: 2904
Joined: Mon Nov 18, 2019 11:11 am

Fri Apr 03, 2020 5:45 pm

Happy to read that.
Should you require any additional assistance, let us know.
Post Reply