Page 1 of 1

VTL Cloud Replication via PowerShell

Posted: Wed Dec 11, 2019 4:12 pm
by metrobg
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.

Re: VTL Cloud Replication via PowerShell

Posted: Thu Dec 26, 2019 4:02 pm
by Boris (staff)
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?

Re: VTL Cloud Replication via PowerShell

Posted: Sun Feb 09, 2020 2:34 pm
by metrobg
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()
}

Re: VTL Cloud Replication via PowerShell

Posted: Tue Mar 31, 2020 11:50 am
by dgbegfb
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?

Re: VTL Cloud Replication via PowerShell

Posted: Thu Apr 02, 2020 12:39 pm
by yaroslav (staff)
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?

Re: VTL Cloud Replication via PowerShell

Posted: Fri Apr 03, 2020 11:48 am
by dgbegfb
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.

Re: VTL Cloud Replication via PowerShell

Posted: Fri Apr 03, 2020 3:41 pm
by yaroslav (staff)
Absolutely right! Only new tapes get affected by changing the retention policy.
Is the problem resolved?

Re: VTL Cloud Replication via PowerShell

Posted: Fri Apr 03, 2020 4:21 pm
by dgbegfb
Yep, thanks.

Re: VTL Cloud Replication via PowerShell

Posted: Fri Apr 03, 2020 5:45 pm
by yaroslav (staff)
Happy to read that.
Should you require any additional assistance, let us know.