'Creates a virtual machine.
:keyword    name:   String with a name for this new node (required)
:type       name:   ``str``
:keyword    size:   The size of resources allocated to this node .
(required)
:type       size:   :class:`NodeSize`
:keyword    image:  OS Image to boot on node. (required)
:type       image:  :class:`NodeImage`
:rtype: :class:`Node`'

def create_node(self, **kwargs):

    res = self.connection.request('/rest/hosting/network/list').parse_body()
    network = res['networks'][0]['uuid']
    data = {'name': str(kwargs['name']), 'package': str(kwargs['image'].id), 'hardware': str(kwargs['size'].id), 'network_uuid': str(network), 'disk': ''}
    d = self.connection._encode_multipart_formdata(data)
    response = self.connection.request('/rest/hosting/vm/', method='PUT', headers=d[0], data=d[1]).parse_body()
    n = Node(id=response['machine_id'], name=data['name'], state=NodeState.PENDING, public_ips=[], private_ips=[], driver=self)
    return n
