'Create a new node
:keyword name: Name of created node
:type    name: ``str``
:keyword image: Image used for node
:type    image: :class:`NodeImage`
:keyword size: Size (flavor) used for node
:type    size: :class:`NodeSize`
:keyword location: Location (region) where to create node
:type    location: :class:`NodeLocation`
:keyword ex_keyname: Name of SSH key used
:type    ex_keyname: ``str``
:return: Created node
:rtype : :class:`Node`'

def create_node(self, name, image, size, location, ex_keyname=None):

    action = self._get_project_action('instance')
    data = {'name': name, 'imageId': image.id, 'flavorId': size.id, 'region': location.id}
    if ex_keyname:
        key_id = self.get_key_pair(ex_keyname, location).extra['id']
        data['sshKeyId'] = key_id
    response = self.connection.request(action, data=data, method='POST')
    return self._to_node(response.object)
