'Returns the appropriate NUMA configuration for Hyper-V instances,
given the desired instance NUMA topology.
:param instance: instance containing the flavor and it\'s extra_specs,
where the NUMA topology is defined.
:param image_meta: image\'s metadata, containing properties related to
the instance\'s NUMA topology.
:returns: memory amount and number of vCPUs per NUMA node or
(None, None), if instance NUMA topology was not requested.
:raises exception.InstanceUnacceptable:
If the given instance NUMA topology is not possible on Hyper-V.'

def _get_instance_vnuma_config(self, instance, image_meta):

    instance_topology = hardware.numa_get_constraints(instance.flavor, image_meta)
    if (not instance_topology):
        return (None, None)
    memory_per_numa_node = instance_topology.cells[0].memory
    cpus_per_numa_node = len(instance_topology.cells[0].cpuset)
    for cell in instance_topology.cells:
        if (len(cell.cpuset) != cpus_per_numa_node):
            reason = (_('Hyper-V    does    not    support    NUMA    topologies    with    uneven    number    of    processors.    (%(a)s    !=    %(b)s)') % {'a': len(cell.cpuset), 'b': cpus_per_numa_node})
            raise exception.InstanceUnacceptable(reason=reason, instance_id=instance.uuid)
        if (cell.memory != memory_per_numa_node):
            reason = (_('Hyper-V    does    not    support    NUMA    topologies    with    uneven    amounts    of    memory.    (%(a)s    !=    %(b)s)') % {'a': cell.memory, 'b': memory_per_numa_node})
            raise exception.InstanceUnacceptable(reason=reason, instance_id=instance.uuid)
    return (memory_per_numa_node, cpus_per_numa_node)
