'Create nodes with the given names.
:param reactor: The reactor.
:param name: The names of the nodes.
:type name: list of str
:param str distribution: The name of the distribution to
install on the nodes.
:param dict metadata: Metadata to associate with the nodes.
:return: A list of ``Deferred``s each firing with an INode
when the corresponding node is created.   The list has
the same order as :param:`names`.'

def create_nodes(self, reactor, names, distribution, metadata={}):

    size = self._default_size
    disk_size = 8
    action = start_action(action_type=u'flocker:provision:aws:create_nodes', instance_count=len(names), distribution=distribution, image_size=size, disk_size=disk_size, metadata=metadata)
    with action.context():
        disk1 = EBSBlockDeviceType()
        disk1.size = disk_size
        disk1.delete_on_termination = True
        diskmap = BlockDeviceMapping()
        diskmap['/dev/sda1'] = disk1
        images = self._connection.get_all_images(filters={'name': IMAGE_NAMES[distribution]})
        instances = self._run_nodes(count=len(names), image_id=images[0].id, size=size, diskmap=diskmap)
        def make_node(ignored, name, instance):
            return AWSNode(name=name, _provisioner=self, _instance=instance, distribution=distribution)
        results = []
        for (name, instance) in izip_longest(names, instances):
            if (instance is None):
                results.append(fail(Exception('Could    not    run    instance')))
            else:
                node_metadata = metadata.copy()
                node_metadata['Name'] = name
                d = self._async_get_node(reactor, instance, node_metadata)
                d = DeferredContext(d)
                d.addCallback(make_node, name, instance)
                results.append(d.result)
        action_completion = DeferredContext(DeferredList(results))
        action_completion.addActionFinish()
        return results
