Create an EBS volume to an availability zone.

    ..

    zone_name
        (string) – The Availability zone name of the EBS volume to be created.
    size
        (int) –  The size of the new volume, in GiB. If you're creating the
                 volume from a snapshot and don't specify a volume size, the
                 default is the snapshot size.
    snapshot_id
        (string) –  The snapshot ID from which the new volume will be created.
    volume_type
        (string) -  The type of the volume. Valid volume types for AWS can be found here:
                    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
    iops
        (int) - The provisioned IOPS you want to associate with this volume.
    encrypted
        (bool) - Specifies whether the volume should be encrypted.
    kms_key_id
        (string) - If encrypted is True, this KMS Key ID may be specified to
                   encrypt volume with this key
                   e.g.: arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef
    wait_for_creation
        (bool) - Whether or not to wait for volume creation to complete.

    returns
        (string) - created volume id on success, error message on failure.

    CLI Example:

    .. code-block:: bash

        salt-call boto_ec2.create_volume us-east-1a size=10
        salt-call boto_ec2.create_volume us-east-1a snapshot_id=snap-0123abcd

def create_volume(zone_name, size=None, snapshot_id=None, volume_type=None,
                  iops=None, encrypted=False, kms_key_id=None, wait_for_creation=False,
                  region=None, key=None, keyid=None, profile=None):
    '''
    Create an EBS volume to an availability zone.

    ..

    zone_name
        (string) – The Availability zone name of the EBS volume to be created.
    size
        (int) –  The size of the new volume, in GiB. If you're creating the
                 volume from a snapshot and don't specify a volume size, the
                 default is the snapshot size.
    snapshot_id
        (string) –  The snapshot ID from which the new volume will be created.
    volume_type
        (string) -  The type of the volume. Valid volume types for AWS can be found here:
                    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
    iops
        (int) - The provisioned IOPS you want to associate with this volume.
    encrypted
        (bool) - Specifies whether the volume should be encrypted.
    kms_key_id
        (string) - If encrypted is True, this KMS Key ID may be specified to
                   encrypt volume with this key
                   e.g.: arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef
    wait_for_creation
        (bool) - Whether or not to wait for volume creation to complete.

    returns
        (string) - created volume id on success, error message on failure.

    CLI Example:

    .. code-block:: bash

        salt-call boto_ec2.create_volume us-east-1a size=10
        salt-call boto_ec2.create_volume us-east-1a snapshot_id=snap-0123abcd

    '''
    if size is None and snapshot_id is None:
        raise SaltInvocationError(
            'Size must be provided if not created from snapshot.'
        )
    ret = {}
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    try:
        vol = conn.create_volume(size=size, zone=zone_name, snapshot=snapshot_id,
                                 volume_type=volume_type, iops=iops, encrypted=encrypted,
                                 kms_key_id=kms_key_id)
        if wait_for_creation and not _wait_for_volume_available(conn, vol.id):
            timeout_msg = 'Timed out waiting for the volume status "available".'
            log.error(timeout_msg)
            ret['error'] = timeout_msg
        else:
            ret['result'] = vol.id
    except boto.exception.BotoServerError as error:
        ret['error'] = __utils__['boto.get_error'](error)
    return ret