Collapse All
Virtuozzo Virtualization SDK C API Reference
ContentsIndex
PreviousUpNext
PrlSrv_CreateVm Function
PHT_SERVER  Example

Obtains a new handle of type PHT_VIRTUAL_MACHINE.

Syntax
PRL_RESULT PrlSrv_CreateVm(
    PRL_HANDLE hServer, 
    PRL_HANDLE_PTR phVm
);
File

PrlApiVm.h

Parameters

hServer
A handle of type PHT_SERVER identifying the Virtuozzo Service.
phVm
[out] A pointer to a variable that receives the handle.

Returns

PRL_RESULT. Possible values: 

PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed. 

PRL_ERR_SUCCESS - function completed successfully. 

 

Remarks

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.

Example
// 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");
Links
Copyright ©2016-2017 Parallels International GmbH. All rights reserved.