import base64
import httplib
import json
-import math
import random
import socket
import string
from cinder import exception
from cinder.openstack.common import log as logging
from cinder.openstack.common import timeutils
+from cinder import units
from cinder.volume.drivers.san.san import SanISCSIDriver
from cinder.volume import qos_specs
from cinder.volume import volume_types
sf_qos_keys = ['minIOPS', 'maxIOPS', 'burstIOPS']
cluster_stats = {}
- GB = math.pow(2, 30)
-
def __init__(self, *args, **kwargs):
super(SolidFireDriver, self).__init__(*args, **kwargs)
self.configuration.append_config_values(sf_opts)
params = {'volumeID': int(sf_vol['volumeID']),
'name': 'UUID-%s' % v_ref['id'],
- 'newSize': int(new_size * self.GB),
+ 'newSize': int(new_size * units.GiB),
'newAccountID': sfaccount['accountID']}
data = self._issue_api_request('CloneVolume', params)
params = {'name': 'UUID-%s' % volume['id'],
'accountID': None,
'sliceCount': slice_count,
- 'totalSize': int(volume['size'] * self.GB),
+ 'totalSize': int(volume['size'] * units.GiB),
'enable512e': self.configuration.sf_emulate_512,
'attributes': attributes,
'qos': qos}
params = {
'volumeID': sf_vol['volumeID'],
- 'totalSize': int(new_size * self.GB)
+ 'totalSize': int(new_size * units.GiB)
}
data = self._issue_api_request('ModifyVolume',
params, version='5.0')