'Create a server using tempest lib
All the parameters are the ones used in Compute API
Args:
flavor_ref(str): The flavor of the server to be provisioned.
image_ref(str):  The image of the server to be provisioned.
key_name(str): SSH key to to be used to connect to the
provisioned server.
networks(list): List of dictionaries where each represent
an interface to be attached to the server. For network
it should be {\'uuid\': network_uuid} and for port it should
be {\'port\': port_uuid}
name(str): Name of the server to be provisioned.
security_groups(list): List of dictionaries where
the keys is \'name\' and the value is the name of
the security group. If it\'s not passed the default
security group will be used.'

def create_server(self, flavor_ref, image_ref, key_name, networks, name=None, security_groups=None):

    name = (name or data_utils.rand_name('server-test'))
    if (not security_groups):
        security_groups = [{'name': 'default'}]
    server = self.os_primary.servers_client.create_server(name=name, flavorRef=flavor_ref, imageRef=image_ref, key_name=key_name, networks=networks, security_groups=security_groups)
    self.addCleanup(test_utils.call_and_ignore_notfound_exc, waiters.wait_for_server_termination, self.os_primary.servers_client, server['server']['id'])
    self.addCleanup(test_utils.call_and_ignore_notfound_exc, self.os_primary.servers_client.delete_server, server['server']['id'])
    return server
