"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/volume/drivers/lvm.py" between
cinder-13.0.2.tar.gz and cinder-13.0.3.tar.gz

About: OpenStack Cinder (Core Service: Block Storage) provides persistent block storage to running instances. Its pluggable driver architecture facilitates the creation and management of block storage devices.
The "Rocky" series (latest release).

lvm.py  (cinder-13.0.2):lvm.py  (cinder-13.0.3)
skipping to change at line 244 skipping to change at line 244
'vg': self.configuration.volume_group, 'vg': self.configuration.volume_group,
'lvm_type': self.configuration.lvm_type, 'lvm_type': self.configuration.lvm_type,
'lvm_mirrors': self.configuration.lvm_mirrors}) 'lvm_mirrors': self.configuration.lvm_mirrors})
thin_enabled = self.configuration.lvm_type == 'thin' thin_enabled = self.configuration.lvm_type == 'thin'
# Calculate the total volumes used by the VG group. # Calculate the total volumes used by the VG group.
# This includes volumes and snapshots. # This includes volumes and snapshots.
total_volumes = len(self.vg.get_volumes()) total_volumes = len(self.vg.get_volumes())
supports_multiattach = True
if self.configuration.target_helper == 'lioadm':
supports_multiattach = False
# Skip enabled_pools setting, treat the whole backend as one pool # Skip enabled_pools setting, treat the whole backend as one pool
# XXX FIXME if multipool support is added to LVM driver. # XXX FIXME if multipool support is added to LVM driver.
single_pool = {} single_pool = {}
single_pool.update(dict( single_pool.update(dict(
pool_name=data["volume_backend_name"], pool_name=data["volume_backend_name"],
total_capacity_gb=total_capacity, total_capacity_gb=total_capacity,
free_capacity_gb=free_capacity, free_capacity_gb=free_capacity,
reserved_percentage=self.configuration.reserved_percentage, reserved_percentage=self.configuration.reserved_percentage,
location_info=location_info, location_info=location_info,
QoS_support=False, QoS_support=False,
provisioned_capacity_gb=provisioned_capacity, provisioned_capacity_gb=provisioned_capacity,
max_over_subscription_ratio=( max_over_subscription_ratio=(
self.configuration.max_over_subscription_ratio), self.configuration.max_over_subscription_ratio),
thin_provisioning_support=thin_enabled, thin_provisioning_support=thin_enabled,
thick_provisioning_support=not thin_enabled, thick_provisioning_support=not thin_enabled,
total_volumes=total_volumes, total_volumes=total_volumes,
filter_function=self.get_filter_function(), filter_function=self.get_filter_function(),
goodness_function=self.get_goodness_function(), goodness_function=self.get_goodness_function(),
multiattach=supports_multiattach, multiattach=True,
backend_state='up' backend_state='up'
)) ))
data["pools"].append(single_pool) data["pools"].append(single_pool)
data["shared_targets"] = False data["shared_targets"] = False
# Check availability of sparse volume copy. # Check availability of sparse volume copy.
data['sparse_copy_volume'] = self._sparse_copy_volume data['sparse_copy_volume'] = self._sparse_copy_volume
self._stats = data self._stats = data
skipping to change at line 845 skipping to change at line 841
return self.target_driver.initialize_connection(volume, connector) return self.target_driver.initialize_connection(volume, connector)
def validate_connector(self, connector): def validate_connector(self, connector):
return self.target_driver.validate_connector(connector) return self.target_driver.validate_connector(connector)
def terminate_connection(self, volume, connector, **kwargs): def terminate_connection(self, volume, connector, **kwargs):
# NOTE(jdg): LVM has a single export for each volume, so what # NOTE(jdg): LVM has a single export for each volume, so what
# we need to do here is check if there is more than one attachment for # we need to do here is check if there is more than one attachment for
# the volume, if there is; let the caller know that they should NOT # the volume, if there is; let the caller know that they should NOT
# remove the export. # remove the export.
has_shared_connections = False
if len(volume.volume_attachment) > 1:
has_shared_connections = True
# NOTE(jdg): For the TGT driver this is a noop, for LIO this removes # NOTE(jdg): For the TGT driver this is a noop, for LIO this removes
# the initiator IQN from the targets access list, so we're good # the initiator IQN from the targets access list, so we're good
# NOTE(lyarwood): Given the above note we should only call
# terminate_connection for the target lioadm driver when there is only
# one attachment left for the host specified by the connector to
# remove, otherwise the ACL will be removed prematurely while other
# attachments on the same host are still accessing the volume.
attachments = volume.volume_attachment
if volume.multiattach:
if sum(1 for a in attachments if a.connector == connector) > 1:
return True
self.target_driver.terminate_connection(volume, connector, self.target_driver.terminate_connection(volume, connector, **kwargs)
**kwargs) return len(attachments) > 1
return has_shared_connections
 End of changes. 5 change blocks. 
9 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)