-
- Veeam ProPartner
- Posts: 55
- Liked: 12 times
- Joined: Apr 10, 2013 12:11 pm
- Full Name: Gregor Smerke
- Location: Ljubljana, SI - Slovenia
- Contact:
How to Detach and then Import an Object Storage?
Dear fellow scripters
(Still on VBR v11 ) I need a PowerShell equivalent to:
1. Backup Infrastructure --> Backup Repositories --> S3 Object Storage (instance) --> Detach repository [command] (is it Unmount-VBRObjectStorageRepository?)
and then
2. Backup Infrastructure --> Backup Repositories --> S3 Object Storage (instance) --> Import Backup... [command] (not sure which cmdlet?)
Reference: Managing Object Storage Repositories.
Kind regards
Gregor
(Still on VBR v11 ) I need a PowerShell equivalent to:
1. Backup Infrastructure --> Backup Repositories --> S3 Object Storage (instance) --> Detach repository [command] (is it Unmount-VBRObjectStorageRepository?)
and then
2. Backup Infrastructure --> Backup Repositories --> S3 Object Storage (instance) --> Import Backup... [command] (not sure which cmdlet?)
Reference: Managing Object Storage Repositories.
Kind regards
Gregor
-
- Veeam ProPartner
- Posts: 55
- Liked: 12 times
- Joined: Apr 10, 2013 12:11 pm
- Full Name: Gregor Smerke
- Location: Ljubljana, SI - Slovenia
- Contact:
Re: How to Detach and then Import an Object Storage?
Answering my own question :
The last command returned a "Temporary helper SOBR for importing backups from object storage" which I did not save into a variable. Now I am figuring out how to programmatically determine when the Configuration Database Resynchronize task status will turn from Working to Success (in other works how to wait for completion). (?)
Code: Select all
$ObjectStorageRepository = Get-VBRObjectStorageRepository -Name "A S3 Object Storage"
Unmount-VBRObjectStorageRepository -Repository $ObjectStorageRepository -Force
$EncryptionKey = Get-VBREncryptionKey -Description "An Encryption Password"
Mount-VBRObjectStorageRepository -Repository $ObjectStorageRepository -EncryptionKey $EncryptionKey
-
- Veeam ProPartner
- Posts: 55
- Liked: 12 times
- Joined: Apr 10, 2013 12:11 pm
- Full Name: Gregor Smerke
- Location: Ljubljana, SI - Slovenia
- Contact:
Re: How to Detach and then Import an Object Storage?
Guys, how do I get a Configuration Database Resynchronize job (History --> System --> Configuration Database Resynchronize [instance])? I need to (programmatically) wait for it to finish (Status -ne "Working").
-
- Veeam Software
- Posts: 2121
- Liked: 513 times
- Joined: Jun 28, 2016 12:12 pm
- Contact:
Re: How to Detach and then Import an Object Storage?
Hi @GregorS,
I'm not sure there's a supported method at this time for getting it. If you're willing to go into unsupported territory with .NET Reflection, you can use the following:
[Veeam.backup.Core.CBaseSession]::FindLastByJobType("102")
This just returns the most recent Configuration Database Resynchronize Task. If you're expecting to launch a bunch of these at once, you can use the GetRunning() method and then filter on JobType "102"
I'm not sure there's a supported method at this time for getting it. If you're willing to go into unsupported territory with .NET Reflection, you can use the following:
[Veeam.backup.Core.CBaseSession]::FindLastByJobType("102")
This just returns the most recent Configuration Database Resynchronize Task. If you're expecting to launch a bunch of these at once, you can use the GetRunning() method and then filter on JobType "102"
David Domask | Product Management: Principal Analyst
-
- Veeam ProPartner
- Posts: 55
- Liked: 12 times
- Joined: Apr 10, 2013 12:11 pm
- Full Name: Gregor Smerke
- Location: Ljubljana, SI - Slovenia
- Contact:
Re: How to Detach and then Import an Object Storage?
Hmm... Error: Unable to find type [Veeam.Backup.Core.CBaseSession]. (?)
-
- Veeam Software
- Posts: 2121
- Liked: 513 times
- Joined: Jun 28, 2016 12:12 pm
- Contact:
Re: How to Detach and then Import an Object Storage?
Hi!
DId you launch this from a Powershell console with the Veeam Powershell Module loaded? (You can do this automatically from Veeam from the Menu > Console > Powershell, or from any powershell with Veeam console installed by Import-Module Veeam.Backup.Powershell.
You will need to run _any_ normal cmdlet first, like Get-VBRLicenseAutoUpdateStatus
DId you launch this from a Powershell console with the Veeam Powershell Module loaded? (You can do this automatically from Veeam from the Menu > Console > Powershell, or from any powershell with Veeam console installed by Import-Module Veeam.Backup.Powershell.
You will need to run _any_ normal cmdlet first, like Get-VBRLicenseAutoUpdateStatus
David Domask | Product Management: Principal Analyst
-
- Veeam ProPartner
- Posts: 55
- Liked: 12 times
- Joined: Apr 10, 2013 12:11 pm
- Full Name: Gregor Smerke
- Location: Ljubljana, SI - Slovenia
- Contact:
Re: How to Detach and then Import an Object Storage?
You are right, the module has not been loaded yet. The object returned has a State property that I can use to wait until Stopped. Thanks!
-
- Veeam Software
- Posts: 2121
- Liked: 513 times
- Joined: Jun 28, 2016 12:12 pm
- Contact:
Re: How to Detach and then Import an Object Storage?
Happy to help! And glad it was that simple
David Domask | Product Management: Principal Analyst
Who is online
Users browsing this forum: No registered users and 5 guests