@@ -3271,14 +3271,15 @@ def _live_snapshot(self, context, instance, guest, disk_path, out_path,
3271
3271
libvirt_utils.create_cow_image(src_back_path, disk_delta,
3272
3272
src_disk_size)
3273
3273
3274
- quiesced = False
3275
3274
try:
3276
- self._set_quiesced(context, instance, image_meta, True)
3277
- quiesced = True
3275
+ self._can_quiesce(instance, image_meta)
3278
3276
except exception.NovaException as err:
3279
- if self._requires_quiesce(image_meta):
3277
+ if image_meta.properties.get('os_require_quiesce', False):
3278
+ LOG.error('Quiescing instance failed but image property '
3279
+ '"os_require_quiesce" is set: %(reason)s.',
3280
+ {'reason': err}, instance=instance)
3280
3281
raise
3281
- LOG.info('Skipping quiescing instance: %(reason)s.',
3282
+ LOG.info('Quiescing instance not available : %(reason)s.',
3282
3283
{'reason': err}, instance=instance)
3283
3284
3284
3285
try:
@@ -3299,12 +3300,24 @@ def _live_snapshot(self, context, instance, guest, disk_path, out_path,
3299
3300
while not dev.is_job_complete():
3300
3301
time.sleep(0.5)
3301
3302
3303
+ finally:
3304
+ quiesced = False
3305
+ try:
3306
+ # NOTE: The freeze FS is applied after the end of
3307
+ # the mirroring of the disk to minimize the time of
3308
+ # the freeze. The mirror between both disks is finished,
3309
+ # sync continuously, and stopped after abort_job().
3310
+ self.quiesce(context, instance, image_meta)
3311
+ quiesced = True
3312
+ except exception.NovaException as err:
3313
+ LOG.info('Skipping quiescing instance: %(reason)s.',
3314
+ {'reason': err}, instance=instance)
3315
+
3302
3316
dev.abort_job()
3303
3317
nova.privsep.path.chown(disk_delta, uid=os.getuid())
3304
- finally:
3305
3318
self._host.write_instance_config(xml)
3306
3319
if quiesced:
3307
- self._set_quiesced (context, instance, image_meta, False )
3320
+ self.unquiesce (context, instance, image_meta)
3308
3321
3309
3322
# Convert the delta (CoW) image with a backing file to a flat
3310
3323
# image with no backing file.
0 commit comments