def convert_to_kb(unit, size):
    '''
    Converts the given size to KB based on the unit, returns a long integer.

    unit
        Unit of the size eg. GB; Note: to VMware a GB is the same as GiB = 1024MiB
    size
        Number which represents the size
    '''
    if unit.lower() == 'gb':
        # vCenter needs long value
        target_size = int(size * 1024 * 1024)
    elif unit.lower() == 'mb':
        target_size = int(size * 1024)
    elif unit.lower() == 'kb':
        target_size = int(size)
    else:
        raise salt.exceptions.ArgumentValueError('The unit is not specified')
    return {'size': target_size, 'unit': 'KB'}
Converts the given size to KB based on the unit, returns a long integer.

    unit
        Unit of the size eg. GB; Note: to VMware a GB is the same as GiB = 1024MiB
    size
        Number which represents the size