'provider_location': 'None:3260,None None '
'None dev_path'})
- def test_update_volume_status(self):
+ def test_update_volume_stats(self):
self.mox.StubOutWithMock(self.drv, '_devices_sizes')
self.drv._devices_sizes().AndReturn({'/dev/loop1': 1024,
'/dev/loop2': 1024})
self.configuration.safe_get('volume_backend_name'). \
AndReturn('BlockDeviceDriver')
self.mox.ReplayAll()
- self.drv._update_volume_status()
+ self.drv._update_volume_stats()
self.assertEquals(self.drv._stats,
{'total_capacity_gb': 2,
'free_capacity_gb': 2,
self.volume.driver.set_execute(_emulate_vgs_execute)
- self.volume.driver._update_volume_status()
+ self.volume.driver._update_volume_stats()
stats = self.volume.driver._stats
return l[l.index('=') + 1:].strip()
def get_volume_stats(self, refresh=False):
- """Get volume status.
+ """Get volume stats.
If 'refresh' is True, run update the stats first.
"""
if refresh:
- self._update_volume_status()
+ self._update_volume_stats()
return self._stats
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
- LOG.debug(_("Updating volume status"))
+ LOG.debug(_("Updating volume stats"))
data = {}
backend_name = self.configuration.safe_get('volume_backend_name')
data["volume_backend_name"] = backend_name or 'Generic_iSCSI'
def get_volume_stats(self, refresh=False):
if refresh:
- self._update_volume_status()
+ self._update_volume_stats()
return self._stats
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
dict_of_devices_sizes = self._devices_sizes()
used_devices = self._get_used_devices()
total_size = 0
free_size += size
total_size += size
- LOG.debug("Updating volume status")
+ LOG.debug("Updating volume stats")
backend_name = self.configuration.safe_get('volume_backend_name')
data = {'total_capacity_gb': total_size / 1024,
'free_capacity_gb': free_size / 1024,
self.conn = self._get_ecom_connection()
self._unmap_lun(volume, connector)
- def update_volume_status(self):
- """Retrieve status info."""
- LOG.debug(_("Updating volume status"))
+ def update_volume_stats(self):
+ """Retrieve stats info."""
+ LOG.debug(_("Updating volume stats"))
self.conn = self._get_ecom_connection()
storage_type = self._get_storage_type()
self.common.terminate_connection(volume, connector)
def get_volume_stats(self, refresh=False):
- """Get volume status.
+ """Get volume stats.
If 'refresh' is True, run update the stats first.
"""
if refresh:
- self.update_volume_status()
+ self.update_volume_stats()
return self._stats
- def update_volume_status(self):
- """Retrieve status info from volume group."""
- LOG.debug(_("Updating volume status"))
- data = self.common.update_volume_status()
+ def update_volume_stats(self):
+ """Retrieve stats info from volume group."""
+ LOG.debug(_("Updating volume stats"))
+ data = self.common.update_volume_stats()
backend_name = self.configuration.safe_get('volume_backend_name')
data['volume_backend_name'] = backend_name or 'EMCSMISISCSIDriver'
data['storage_protocol'] = 'iSCSI'
pass
def get_volume_stats(self, refresh=False):
- """Get volume status.
+ """Get volume stats.
If 'refresh' is True, or stats have never been updated, run update
the stats first.
"""
if not self._stats or refresh:
- self._update_volume_status()
+ self._update_volume_stats()
return self._stats
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
- LOG.debug("Updating volume status")
+ LOG.debug("Updating volume stats")
data = {}
backend_name = self.configuration.safe_get('volume_backend_name')
data["volume_backend_name"] = backend_name or 'GPFS'
self._delete_luncopy(luncopy_id)
def get_volume_stats(self, refresh=False):
- """Get volume status.
+ """Get volume stats.
If 'refresh' is True, run update the stats first.
"""
if refresh:
- self._update_volume_status()
+ self._update_volume_stats()
return self._stats
return False
return True
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
- LOG.debug(_("Updating volume status"))
+ LOG.debug(_("Updating volume stats"))
data = {}
backend_name = self.configuration.safe_get('volume_backend_name')
data["volume_backend_name"] = backend_name or 'HuaweiISCSIDriver'
self.tgtadm.remove_iscsi_target(iscsi_target, 0, volume['id'])
def get_volume_stats(self, refresh=False):
- """Get volume status.
+ """Get volume stats.
If 'refresh' is True, run update the stats first.
"""
if refresh:
- self._update_volume_status()
+ self._update_volume_stats()
return self._stats
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
- LOG.debug(_("Updating volume status"))
+ LOG.debug(_("Updating volume stats"))
data = {}
# Note(zhiteng): These information are driver/backend specific,
self.configuration.volume_group,
run_as_root=True)
except exception.ProcessExecutionError as exc:
- LOG.error(_("Error retrieving volume status: %s"), exc.stderr)
+ LOG.error(_("Error retrieving volume stats: %s"), exc.stderr)
out = False
if out:
self._do_lvm_snapshot(orig_lv_name, snapshot)
def get_volume_stats(self, refresh=False):
- """Get volume status.
+ """Get volume stats.
If 'refresh' is True, run update the stats first.
"""
if refresh:
- self._update_volume_status()
+ self._update_volume_stats()
return self._stats
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
- LOG.debug(_("Updating volume status"))
+ LOG.debug(_("Updating volume stats"))
data = {}
backend_name = self.configuration.safe_get('volume_backend_name')
self._clone_lun(src_vol.name, new_name, 'true')
def get_volume_stats(self, refresh=False):
- """Get volume status.
+ """Get volume stats.
If 'refresh' is True, run update the stats first.
"""
if refresh:
- self._update_volume_status()
+ self._update_volume_stats()
return self._stats
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
raise NotImplementedError()
else:
self.client.set_vserver(None)
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
- LOG.debug(_("Updating volume status"))
+ LOG.debug(_("Updating volume stats"))
data = {}
netapp_backend = 'NetApp_iSCSI_Cluster_direct'
backend_name = self.configuration.safe_get('volume_backend_name')
'is-space-reservation-enabled')
return meta_dict
- def _update_volume_status(self):
+ def _update_volume_stats(self):
"""Retrieve status info from volume group."""
- LOG.debug(_("Updating volume status"))
+ LOG.debug(_("Updating volume stats"))
data = {}
netapp_backend = 'NetApp_iSCSI_7mode_direct'
backend_name = self.configuration.safe_get('volume_backend_name')
return {'provider_location': share}
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
- super(NetAppNFSDriver, self)._update_volume_status()
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
+ super(NetAppNFSDriver, self)._update_volume_stats()
class NetAppDirectNfsDriver (NetAppNFSDriver):
'destination-path': dest_path})
self._invoke_successfully(clone_create, vserver)
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
- super(NetAppDirectCmodeNfsDriver, self)._update_volume_status()
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
+ super(NetAppDirectCmodeNfsDriver, self)._update_volume_stats()
netapp_backend = 'NetApp_NFS_cluster_direct'
backend_name = self.configuration.safe_get('volume_backend_name')
self._stats["volume_backend_name"] = (backend_name or
time.sleep(5)
retry = retry - 1
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
- super(NetAppDirect7modeNfsDriver, self)._update_volume_status()
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
+ super(NetAppDirect7modeNfsDriver, self)._update_volume_stats()
netapp_backend = 'NetApp_NFS_7mode_direct'
backend_name = self.configuration.safe_get('volume_backend_name')
self._stats["volume_backend_name"] = (backend_name or
{'target': target_name, 'exc': exc})
def get_volume_stats(self, refresh=False):
- """Get volume status.
+ """Get volume stats.
If 'refresh' is True, run update the stats first.
"""
if refresh:
- self._update_volume_status()
+ self._update_volume_stats()
return self._stats
- def _update_volume_status(self):
- """Retrieve status info for Nexenta device."""
+ def _update_volume_stats(self):
+ """Retrieve stats info for Nexenta device."""
# NOTE(jdg): Aimon Bustardo was kind enough to point out the
# info he had regarding Nexenta Capabilities, ideally it would
KB = 1024
MB = KB ** 2
- LOG.debug(_("Updating volume status"))
+ LOG.debug(_("Updating volume stats"))
data = {}
backend_name = self.__class__.__name__
if self.configuration:
raise
def get_volume_stats(self, refresh=False):
- """Get volume status.
+ """Get volume stats.
If 'refresh' is True, run update the stats first.
"""
if refresh or not self._stats:
- self._update_volume_status()
+ self._update_volume_stats()
return self._stats
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
data = {}
backend_name = self.configuration.safe_get('volume_backend_name')
"""====================================================================="""
def get_volume_stats(self, refresh=False):
- """Get volume status.
+ """Get volume stats.
If we haven't gotten stats yet or 'refresh' is True,
run update the stats first.
"""
if not self._stats or refresh:
- self._update_volume_status()
+ self._update_volume_stats()
return self._stats
- def _update_volume_status(self):
- """Retrieve status info from volume group."""
+ def _update_volume_stats(self):
+ """Retrieve stats info from volume group."""
- LOG.debug(_("Updating volume status"))
+ LOG.debug(_("Updating volume stats"))
data = {}
data['vendor_name'] = 'IBM'
ssh_cmd = 'svcinfo lssystem -delim !'
attributes = self._execute_command_and_parse_attributes(ssh_cmd)
if not attributes or not attributes['name']:
- exception_message = (_('_update_volume_status: '
+ exception_message = (_('_update_volume_stats: '
'Could not get system name'))
raise exception.VolumeBackendAPIException(data=exception_message)
attributes = self._execute_command_and_parse_attributes(ssh_cmd)
if not attributes:
LOG.error(_('Could not get pool data from the storage'))
- exception_message = (_('_update_volume_status: '
+ exception_message = (_('_update_volume_stats: '
'Could not get storage pool data'))
raise exception.VolumeBackendAPIException(data=exception_message)