def ex_provision_node(self, **kwargs):

        node = kwargs['node']

        if 'image' in kwargs:
            image = kwargs['image']
        else:
            image = node.extra['image']

        params = {
            'mbpkgid': node.id,
            'image': image,
            'fqdn': node.name,
            'location': node.extra['location'],
        }

        auth = kwargs['auth']

        ssh_key = None
        password = None
        if isinstance(auth, NodeAuthSSHKey):
            ssh_key = auth.pubkey
            params['ssh_key'] = ssh_key
        elif isinstance(auth, NodeAuthPassword):
            password = auth.password
            params['password'] = password

        if not ssh_key and not password:
            raise HostVirtualException(
                500, "SSH key or Root password is required")

        try:
            result = self.connection.request(API_ROOT + '/cloud/server/build',
                                             data=json.dumps(params),
                                             method='POST').object
            return bool(result)
        except HostVirtualException:
            self.ex_cancel_package(node)
Provision a server on a VR package and get it booted
dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/hostvirtual.py/HostVirtualNodeDriver.ex_provision_node