

@atomic.action_timer('cinder.create_volume')
def _create_volume(self, size, **kwargs):
    'Create one volume.\n\n        Returns when the volume is actually created and is in the "Available"\n        state.\n\n        :param size: int be size of volume in GB, or\n                     dictionary, must contain two values:\n                         min - minimum size volumes will be created as;\n                         max - maximum size volumes will be created as.\n        :param kwargs: Other optional parameters to initialize the volume\n        :returns: Created volume object\n        '
    if isinstance(size, dict):
        size = random.randint(self['min'], size['max'])
    client = cinder_wrapper.wrap(self._clients.cinder, self)
    volume = client.create_volume(size, **kwargs)
    time.sleep(CONF.benchmark.cinder_volume_create_prepoll_delay)
    volume = bench_utils.wait_for(volume, ready_statuses=['available'], update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.cinder_volume_create_timeout, check_interval=CONF.benchmark.cinder_volume_create_poll_interval)
    return volume

dataset/ETHPy150Open openstack/rally/rally/plugins/openstack/scenarios/cinder/utils.py CinderScenario._create_volume/VarMisuse@41/215 `size`->`self`