Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FeldHost Public Projects
OpenNebula 3PAR Backup
Commits
5e79ce4c
Commit
5e79ce4c
authored
Oct 23, 2019
by
Kristian Feldsam
Browse files
Added VM locking
Signed-off-by:
Kristián Feldsam
<
feldsam@gmail.com
>
parent
d0f25354
Changes
1
Hide whitespace changes
Inline
Side-by-side
backup.py
View file @
5e79ce4c
...
...
@@ -82,12 +82,24 @@ for image_key in images:
if
args
.
verbose
:
print
'Backup persistent image %d:%s attached to VM %d:%s as disk %d'
%
(
image
.
ID
,
image
.
NAME
,
vmId
,
vm
.
NAME
,
vmDiskId
)
# lock VM
if
config
.
LOCK_RESOURCES
:
if
args
.
verbose
:
print
'Locking VM %d:%s'
%
(
vmId
,
vm
.
NAME
)
one
.
vm
.
lock
(
vmId
,
4
)
try
:
_3par
.
backup_live
(
one
,
image
,
dataStore
,
vm
,
vmDiskId
,
args
.
verbose
)
except
Exception
as
ex
:
print
ex
continue
# unlock VM
if
config
.
LOCK_RESOURCES
:
if
args
.
verbose
:
print
'Unlocking VM %d:%s'
%
(
vmId
,
vm
.
NAME
)
one
.
vm
.
unlock
(
vmId
)
# persistent not attached
elif
image
.
PERSISTENT
==
1
:
if
args
.
verbose
:
...
...
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