Obtains a new handle of type PHT_VIRTUAL_MACHINE.
PRL_RESULT PrlSrv_CreateVm( PRL_HANDLE hServer, PRL_HANDLE_PTR phVm );
PrlApiVm.h
PRL_RESULT. Possible values:
PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed.
PRL_ERR_SUCCESS - function completed successfully.
Obtaining a new PHT_VIRTUAL_MACHINE handle is the first step when creating a virtual machine. The second step is setting the virtual machine configuration parameters. The final step is calling the PrlVm_Reg function, which will create a new virtual machine.
// Create a new virtual machine handle // (assumes hServer is a valid handle obtained using PrlSrv_Create, // and a successful Virtuozzo Service login was made using PrlSrv_Login). PRL_HANDLE hNewVm; ret = PrlSrv_CreateVm(hServer, &hNewVm); if (PRL_FAILED(ret)) { printf("PrlSvr_CreateVm call failed with: %s.\n", PRL_RESULT_TO_STRING(ret)); return ret; } printf("PrlSvr_CreateVm completed successfully.\n");