def create_disk(kwargs=None, call=None):
    if call != 'function':
        raise SaltCloudSystemExit(
            'The create_disk function must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    name = kwargs.get('disk_name', None)
    image = kwargs.get('image', None)
    location = kwargs.get('location', None)
    size = kwargs.get('size', None)
    snapshot = kwargs.get('snapshot', None)

    if location is None:
        log.error(
            'A location (zone) must be specified when creating a disk.'
        )
        return False

    if name is None:
        log.error(
            'A disk_name must be specified when creating a disk.'
        )
        return False

    if 'size' is None and 'image' is None and 'snapshot' is None:
        log.error(
            'Must specify image, snapshot, or size.'
        )
        return False

    conn = get_conn()

    location = conn.ex_get_zone(kwargs['location'])
    use_existing = True

    salt.utils.cloud.fire_event(
        'event',
        'create disk',
        'salt/cloud/disk/creating',
        {
            'name': name,
            'location': location.name,
            'image': image,
            'snapshot': snapshot,
        },
        transport=__opts__['transport']
    )

    disk = conn.create_volume(
        size, name, location, snapshot, image, use_existing
    )

    salt.utils.cloud.fire_event(
        'event',
        'created disk',
        'salt/cloud/disk/created',
        {
            'name': name,
            'location': location.name,
            'image': image,
            'snapshot': snapshot,
        },
        transport=__opts__['transport']
    )
    return _expand_disk(disk)
Create a new persistent disk. Must specify `disk_name` and `location`.
dataset/ETHPy150Open saltstack/salt/salt/cloud/clouds/gce.py/create_disk