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
d0f25354
Commit
d0f25354
authored
Oct 23, 2019
by
Kristian Feldsam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Images locking and backup info added
Signed-off-by:
Kristián Feldsam
<
feldsam@gmail.com
>
parent
dc53aae0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
backup.py
backup.py
+19
-2
No files found.
backup.py
View file @
d0f25354
#!/usr/bin/env python
import
argparse
import
pprint
import
datetime
import
time
import
config
import
pyone
...
...
@@ -50,6 +51,15 @@ for image_key in images:
if
datastore
.
TM_MAD
!=
'3par'
:
continue
# set info abut backup start to image template
one
.
image
.
update
(
image
.
ID
,
'BACKUP_IN_PROGRESS=YES BACKUP_FINISHED_UNIX=--- BACKUP_FINISHED_HUMAN=--- BACKUP_STARTED_UNIX=%d BACKUP_STARTED_HUMAN="%s"'
%
(
int
(
time
.
time
()),
datetime
.
datetime
.
now
().
ctime
()),
1
)
# lock image
if
config
.
LOCK_RESOURCES
:
if
args
.
verbose
:
print
'Locking image %d:%s'
%
(
image
.
ID
,
image
.
NAME
)
one
.
image
.
lock
(
image
.
ID
,
4
)
# persistent and attached to VM
if
image
.
PERSISTENT
==
1
and
image
.
RUNNING_VMS
>
0
:
vmId
=
image
.
VMS
.
ID
[
0
]
...
...
@@ -78,7 +88,6 @@ for image_key in images:
print
ex
continue
break
# persistent not attached
elif
image
.
PERSISTENT
==
1
:
if
args
.
verbose
:
...
...
@@ -89,6 +98,14 @@ for image_key in images:
if
args
.
verbose
:
print
'Backup non-persistent image %d:%s'
%
(
image
.
ID
,
image
.
NAME
)
# unlock image
if
config
.
LOCK_RESOURCES
:
if
args
.
verbose
:
print
'Unlocking image %d:%s'
%
(
image
.
ID
,
image
.
NAME
)
one
.
image
.
unlock
(
image
.
ID
)
# set info abut backup start to image template
one
.
image
.
update
(
image
.
ID
,
'BACKUP_IN_PROGRESS=NO BACKUP_FINISHED_UNIX=%d BACKUP_FINISHED_HUMAN="%s"'
%
(
int
(
time
.
time
()),
datetime
.
datetime
.
now
().
ctime
()),
1
)
# disconnect form 3PAR
_3par
.
logout
()
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