#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""
ZFS Storage Appliance Cinder Volume Driver
"""
import ast
import base64
ZFSSA_OPTS = [
'128k'],
]
'zfssa:sparse',
'zfssa:compression',
'zfssa:logbias'}
def factory_zfssa():
"""ZFSSA Cinder volume driver"""
"""return target alias"""
"""Setup - create multiple elements.
Project, initiators, initiatorgroup, target and targetgroup.
"""
for initiator_group in initiator_config:
zfssa_initiator_group + '-' +
zfssa_initiator['iqn'],
zfssa_initiator['user'],
zfssa_initiator['password'])
if (zfssa_initiator_group != 'default'):
zfssa_initiator['iqn'],
else:
'Using deprecated configuration options.'))
' wont be used on '
'zfssa_initiator_group= %(inigrp)s.')
# Setup initiator and initiator group
# Parse interfaces
interfaces = []
if interface == '':
continue
# Setup target and target group
"""Check that driver can login.
Check also pool, project, initiators, initiatorgroup, target and
targetgroup.
"""
for initiator_group in initiator_config:
else:
"""return provider information"""
return provider
"""Create a volume on ZFSSA"""
volume['name'],
"""Deletes a volume with the given volume['name']."""
volume['name'])
# Delete clone temp snapshot. see create_cloned_volume()
if lun2del['nodestroy']:
volume['name'],
return
"""Creates a snapshot with the given snapshot['name'] of the
snapshot['volume_name']
"""
snapshot['volume_name'],
snapshot['name'])
"""Deletes a snapshot."""
snapshot['volume_name'],
snapshot['name'])
if has_clones:
snapshot['volume_name'],
snapshot['name'])
"""Creates a volume from a snapshot - clone a snapshot"""
volume['name'])
snapshot['name'])
exception_msg = (_('Error verifying clone size on '
'Volume clone: %(clone)s '
'Size: %(size)d on'
'Snapshot: %(snapshot)s')
snapshot['volume_name'],
snapshot['name'],
volume['name'])
"""Retrieve status info from volume group."""
data = {}
return
"""Get volume status.
If 'refresh' is True, run update the stats first.
"""
if refresh:
pass
pass
pass
"""Driver entry point to extent volume size."""
volume['name'],
"""Create a clone of the specified volume."""
try:
except exception.VolumeBackendAPIException:
'%(volume)s failed from source volume:'
'%(src_vref)s')
# Cleanup snapshot
"""Not implemented"""
pass
"""Not implemented"""
pass
"""Not implemented"""
pass
"""Check whether the clone size is the same as the parent volume"""
snapshot['volume_name'])
connector['initiator'])
for initiator_group in init_groups:
volume['name'],
iscsi_properties = {}
if 'provider_auth' in provider:
'provider_auth'].split()
return {
'driver_volume_type': 'iscsi',
'data': iscsi_properties
}
"""Driver entry point to terminate a connection for a volume."""
volume['name'],
'')
"""Get specs suitable for volume creation."""
extra_specs = None
if vtype:
result = {}
for spc in ZFSSA_LUN_SPECS:
val = None
if xspecs:
if val is None:
return result