37
37
cfg.StrOpt('nexenta_host',
39
help='IP address of Nexenta SA'),
39
help='IP address of Nexenta SA'),
40
40
cfg.IntOpt('nexenta_rest_port',
42
42
help='HTTP port to connect to Nexenta REST API server'),
130
130
self.nms.zvol.destroy(self._get_zvol_name(volume['name']), '')
131
131
except nexenta.NexentaException as exc:
132
132
if "zvol has children" in exc.args[1]:
133
raise exception.VolumeIsBusy
133
raise exception.VolumeIsBusy(volume_name=volume['name'])
200
200
LOG.info(_('Ignored target creation error "%s"'
201
' while ensuring export'), exc)
201
' while ensuring export'), exc)
203
203
self.nms.stmf.create_targetgroup(target_group_name)
204
204
except nexenta.NexentaException as exc:
208
208
LOG.info(_('Ignored target group creation error "%s"'
209
' while ensuring export'), exc)
209
' while ensuring export'), exc)
211
211
self.nms.stmf.add_targetgroup_member(target_group_name,
217
217
LOG.info(_('Ignored target group member addition error "%s"'
218
' while ensuring export'), exc)
218
' while ensuring export'), exc)
220
220
self.nms.scsidisk.create_lu(zvol_name, {})
221
221
except nexenta.NexentaException as exc:
225
225
LOG.info(_('Ignored LU creation error "%s"'
226
' while ensuring export'), exc)
226
' while ensuring export'), exc)
228
228
self.nms.scsidisk.add_lun_mapping_entry(zvol_name, {
229
229
'target_group': target_group_name,
235
235
LOG.info(_('Ignored LUN mapping entry addition error "%s"'
236
' while ensuring export'), exc)
236
' while ensuring export'), exc)
237
237
return '%s:%s,1 %s' % (FLAGS.nexenta_host,
238
238
FLAGS.nexenta_iscsi_target_portal_port,
269
269
except nexenta.NexentaException as exc:
270
270
# We assume that target group is already gone
271
271
LOG.warn(_('Got error trying to destroy target group'
272
' %(target_group)s, assuming it is already gone: %(exc)s'),
273
{'target_group': target_group_name, 'exc': exc})
272
' %(target_group)s, assuming it is '
273
'already gone: %(exc)s'),
274
{'target_group': target_group_name, 'exc': exc})
275
276
self.nms.iscsitarget.delete_target(target_name)
276
277
except nexenta.NexentaException as exc:
277
278
# We assume that target is gone as well
278
279
LOG.warn(_('Got error trying to delete target %(target)s,'
279
' assuming it is already gone: %(exc)s'),
280
{'target': target_name, 'exc': exc})
280
' assuming it is already gone: %(exc)s'),
281
{'target': target_name, 'exc': exc})
283
def copy_image_to_volume(self, context, volume, image_service, image_id):
284
"""Fetch the image from image_service and write it to the volume."""
285
raise NotImplementedError()
287
def copy_volume_to_image(self, context, volume, image_service, image_id):
288
"""Copy the volume to the specified image."""
289
raise NotImplementedError()
291
def create_cloned_volume(self, volume, src_vref):
292
"""Creates a clone of the specified volume."""
293
raise NotImplementedError()