'Create requested volume'

def create_volume(self, volume):

    LOG.debug('X-IO    create_volume    called.')
    ctxt = context.get_admin_context()
    type_id = volume['volume_type_id']
    extra_specs = self._get_extra_specs(ctxt, type_id)
    LOG.debug('Volume    %(volume_name)s    extra_specs    %(extra_specs)s', {'volume_name': volume['name'], 'extra_specs': extra_specs})
    qos = self._get_qos_specs(ctxt, type_id)
    url = ('/storage/arrays/%s/volumes' % self._get_ise_globalid())
    resp = self._send_cmd('POST', url, {'name': volume['name'], 'size': volume['size'], 'pool': extra_specs['pool'], 'redundancy': extra_specs['raid'], 'affinity': extra_specs['affinity'], 'alloctype': extra_specs['alloctype'], 'IOPSmin': qos['minIOPS'], 'IOPSmax': qos['maxIOPS'], 'IOPSburst': qos['burstIOPS']})
    if (resp['status'] != 201):
        LOG.error('Failed    to    create    volume:    %(name)s    (%(status)s)', {'name': volume['name'], 'status': resp['status']})
        RaiseXIODriverException()
    args = {}
    args['name'] = volume['name']
    args['status_string'] = OPERATIONAL_STATUS
    retries = self.configuration.ise_completion_retries
    vol_info = self._wait_for_completion(self._help_wait_for_status, args, retries)
    if (OPERATIONAL_STATUS in vol_info['string']):
        LOG.info('Volume    %s    created', volume['name'])
    else:
        LOG.error('Failed    to    create    volume    %s.', volume['name'])
        RaiseXIODriverException()
    return
