def validate_pool_settings(namespace, parser):
    """Custom parsing to enfore that either PaaS or IaaS instances are configured
    in the add pool request body.
    """
    if not namespace.json_file:
        if namespace.node_agent_sku_id and not namespace.image:
            raise ValueError('Missing required argument: --image')
        if namespace.image:
            try:
                namespace.publisher, namespace.offer, namespace.sku = (
                    namespace.image.split(':', 2))
                try:
                    namespace.sku, namespace.version = namespace.sku.split(':',
                        1)
                except ValueError:
                    pass
            except ValueError:
                if '/' not in namespace.image:
                    message = """Incorrect format for VM image. Should be in the format: 
'publisher:offer:sku[:version]' OR a URL to an ARM image."""
                    raise ValueError(message)
                namespace.virtual_machine_image_id = namespace.image
            del namespace.image
        groups = ['pool.cloud_service_configuration',
            'pool.virtual_machine_configuration']
        parser.parse_mutually_exclusive(namespace, True, groups)
        paas_sizes = ['small', 'medium', 'large', 'extralarge']
        if namespace.vm_size and namespace.vm_size.lower(
            ) in paas_sizes and not namespace.os_family:
            message = (
                'The selected VM size is incompatible with Virtual Machine Configuration. Please swap for the equivalent: Standard_A1 (small), Standard_A2 (medium), Standard_A3 (large), or Standard_A4 (extra large).'
                )
            raise ValueError(message)
        if namespace.auto_scale_formula:
            namespace.enable_auto_scale = True
