def _parse_create_args(client, args):
    """Converts CLI arguments to args for VSManager.create_instance.

    :param dict args: CLI arguments
    """
    data = {}

    if args.get('quantity'):
        data['quantity'] = int(args.get('quantity'))
    if args.get('postinstall'):
        data['provisionScripts'] = [args.get('postinstall')]
    if args.get('complex_type'):
        data['complexType'] = args.get('complex_type')

    if args.get('fqdn'):
        servers = []
        for name in args.get('fqdn'):
            fqdn = name.split(".", 1)
            servers.append({'hostname': fqdn[0], 'domain': fqdn[1]})
        data['hardware'] = servers

    if args.get('image'):
        if args.get('image').isdigit():
            image_mgr = ImageManager(client)
            image_details = image_mgr.get_image(args.get('image'), mask="id,globalIdentifier")
            data['imageTemplateGlobalIdentifier'] = image_details['globalIdentifier']
        else:
            data['imageTemplateGlobalIdentifier'] = args['image']

    userdata = None
    if args.get('userdata'):
        userdata = args['userdata']
    elif args.get('userfile'):
        with open(args['userfile'], 'r') as userfile:
            userdata = userfile.read()
    if userdata:
        for hardware in data['hardware']:
            hardware['userData'] = [{'value': userdata}]

    # Get the SSH keys
    if args.get('key'):
        keys = []
        for key in args.get('key'):
            resolver = SshKeyManager(client).resolve_ids
            key_id = helpers.resolve_id(resolver, key, 'SshKey')
            keys.append(key_id)
        data['sshKeys'] = keys

    return data
Converts CLI arguments to args for VSManager.create_instance.

    :param dict args: CLI arguments