Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenNebula 3PAR Backup
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
FeldHost Public Projects
OpenNebula 3PAR Backup
Commits
1a27fb11
Commit
1a27fb11
authored
Oct 23, 2019
by
Kristian Feldsam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3PAR - backup using borgbackup
Signed-off-by:
Kristián Feldsam
<
feldsam@gmail.com
>
parent
2ce2287e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
config.sample.py
config.sample.py
+2
-2
drivers/_3par.py
drivers/_3par.py
+17
-4
No files found.
config.sample.py
View file @
1a27fb11
...
...
@@ -5,8 +5,8 @@ ONE = {
'password'
:
'pass'
}
# Path
where to save backups on backup server
BACKUP_
DIR
=
'/var/data/backups/'
# Path
to borgbackup repo
BACKUP_
REPO
=
'/var/data/backups/'
# Lock Image and VM during backup
# OpenNebula 5.6+ required
...
...
drivers/_3par.py
View file @
1a27fb11
...
...
@@ -122,9 +122,12 @@ def backup_live(one, image, vm, vm_disk_id, verbose):
raise
Exception
(
'Can not discover LUN'
,
ex
)
# backup
# TODO
if
verbose
:
print
'TODO: Backuping image....'
print
'Backuping image....'
dev
=
'/dev/mapper/3%s'
%
wwn
result
=
borgbackup
(
name
,
dev
)
if
verbose
:
print
result
# flush volume
if
verbose
:
...
...
@@ -165,9 +168,12 @@ def backup(image, verbose):
raise
Exception
(
'Can not discover LUN'
,
ex
)
# backup
# TODO
if
verbose
:
print
'TODO: Backuping image....'
print
'Backuping image....'
dev
=
'/dev/mapper/3%s'
%
wwn
result
=
borgbackup
(
name
,
dev
)
if
verbose
:
print
result
# flush volume
if
verbose
:
...
...
@@ -181,3 +187,10 @@ def backup(image, verbose):
if
verbose
:
print
'Unexporting volume %s from backup server...'
%
name
unexport_vv
(
name
,
config
.
EXPORT_HOST
)
def
borgbackup
(
name
,
dev
):
try
:
return
subprocess
.
check_output
(
'borg create -v --stats --read-special %s::%s-{now} %s'
%
(
config
.
BACKUP_REPO
,
name
,
dev
),
shell
=
True
)
except
subprocess
.
CalledProcessError
as
ex
:
raise
Exception
(
'Can not backup dev using borgbackup!'
,
ex
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment