Creates a Linode Configuration Profile.

    name
        The name of the VM to create the config for.

    linode_id
        The ID of the Linode to create the configuration for.

    root_disk_id
        The Root Disk ID to be used for this config.

    swap_disk_id
        The Swap Disk ID to be used for this config.

    data_disk_id
        The Data Disk ID to be used for this config.

    .. versionadded:: 2016.3.0

    kernel_id
        The ID of the kernel to use for this configuration profile.

def create_config(kwargs=None, call=None):
    '''
    Creates a Linode Configuration Profile.

    name
        The name of the VM to create the config for.

    linode_id
        The ID of the Linode to create the configuration for.

    root_disk_id
        The Root Disk ID to be used for this config.

    swap_disk_id
        The Swap Disk ID to be used for this config.

    data_disk_id
        The Data Disk ID to be used for this config.

    .. versionadded:: 2016.3.0

    kernel_id
        The ID of the kernel to use for this configuration profile.
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The create_config function must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    name = kwargs.get('name', None)
    linode_id = kwargs.get('linode_id', None)
    root_disk_id = kwargs.get('root_disk_id', None)
    swap_disk_id = kwargs.get('swap_disk_id', None)
    data_disk_id = kwargs.get('data_disk_id', None)
    kernel_id = kwargs.get('kernel_id', None)

    if kernel_id is None:
        # 138 appears to always be the latest 64-bit kernel for Linux
        kernel_id = 138

    required_params = [name, linode_id, root_disk_id, swap_disk_id]
    for item in required_params:
        if item is None:
            raise SaltCloudSystemExit(
                'The create_config functions requires a \'name\', \'linode_id\', '
                '\'root_disk_id\', and \'swap_disk_id\'.'
            )

    disklist = '{0},{1}'.format(root_disk_id, swap_disk_id)
    if data_disk_id is not None:
        disklist = '{0},{1},{2}'.format(root_disk_id, swap_disk_id, data_disk_id)

    config_args = {'LinodeID': linode_id,
                   'KernelID': kernel_id,
                   'Label': name,
                   'DiskList': disklist
                  }

    result = _query('linode', 'config.create', args=config_args)

    return _clean_data(result)