Commit 5e79ce4c authored by Kristian Feldsam's avatar Kristian Feldsam

Added VM locking

Signed-off-by: Kristian Feldsam's avatarKristián Feldsam <feldsam@gmail.com>
parent d0f25354
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment