Creates a new server instance.  This call blocks until the server is
        created and available for normal use, or :attr:`timeout_s` has elapsed.

        :param str basename:  An identifier for the server.  A random postfix
            will be appended to this basename to work around OpenStack Nova
            REST API limitations.

        :param str disk_image_id:  The identifier of the base disk image to use
            as the rootfs.

        :param str instance_type:  The name of an OpenStack instance type, or
            *flavor*.  This is specific to the OpenStack provider installation.

       :param str ssh_key_name:  The name of the ssh key to inject into the
            target server's ``authorized_keys`` file.  The key must already
            have been registered with the OpenStack Nova provider.

        :param tags:  Up to 5 key-value pairs of arbitrary strings to use as
            *tags* for the server instance.
        :type tags:  :class:`Mapping`

        :param str availability_zone:  The name of the availability zone in
            which to place the server.

        :param float timeout_s:  The number of seconds to poll for an active
            server before failing.  Defaults to ``0`` (i.e. Expect server to be
            active immediately).

        :param bool floating_ip:  Allocate a floating IP (in
            openstack 13.5 this doesn't happen automatically, so only
            don't do it if you know what you're doing)


        :rtype:  :class:`dict`

def create_server(self, basename, disk_image_id, instance_type,
            ssh_key_name, tags=None, availability_zone=None,
            timeout_s=DEFAULT_TIMEOUT_S, floating_ip=True,
            **kwargs):
        """
        Creates a new server instance.  This call blocks until the server is
        created and available for normal use, or :attr:`timeout_s` has elapsed.

        :param str basename:  An identifier for the server.  A random postfix
            will be appended to this basename to work around OpenStack Nova
            REST API limitations.

        :param str disk_image_id:  The identifier of the base disk image to use
            as the rootfs.

        :param str instance_type:  The name of an OpenStack instance type, or
            *flavor*.  This is specific to the OpenStack provider installation.

       :param str ssh_key_name:  The name of the ssh key to inject into the
            target server's ``authorized_keys`` file.  The key must already
            have been registered with the OpenStack Nova provider.

        :param tags:  Up to 5 key-value pairs of arbitrary strings to use as
            *tags* for the server instance.
        :type tags:  :class:`Mapping`

        :param str availability_zone:  The name of the availability zone in
            which to place the server.

        :param float timeout_s:  The number of seconds to poll for an active
            server before failing.  Defaults to ``0`` (i.e. Expect server to be
            active immediately).

        :param bool floating_ip:  Allocate a floating IP (in
            openstack 13.5 this doesn't happen automatically, so only
            don't do it if you know what you're doing)


        :rtype:  :class:`dict`

        """
        nova = self.nova
        name = self.provider.gen_component_name(basename)
        log.info('Launching server %s... this could take a while...' % name)
        flavor = nova.flavors.find(name=instance_type)
        server = nova.servers.create(
                name,
                disk_image_id,
                flavor,
                key_name=ssh_key_name,
                meta=tags,
                availability_zone=availability_zone,
                **kwargs
                )

        def find_active():
            s = nova.servers.get(server.id)
            if s and s.status == 'ACTIVE':
                return s

        instance = poll_with_timeout(timeout_s, find_active, 5)
        if not instance:
            raise TimeoutError(
                    'Server %s failed to launch within allotted time.'
                    % server.id
                    )

        if floating_ip:
            log.info('Creating floating ip for %s', name)
            floating_ip = nova.floating_ips.create()
            server.add_floating_ip(floating_ip)
            log.info('Created floating ip %s for %s', floating_ip.ip, name)

        return server_to_dict(instance)