Collapse All
Virtuozzo Virtualization SDK C API Reference
PrlVm_RegEx Function

Creates a new virtual machine and registers it with the Virtuozzo Service.

    PRL_HANDLE hVm, 
    PRL_CONST_STR sVmParentPath, 
    PRL_UINT32 nFlags



A handle of type PHT_VIRTUAL_MACHINE identifying the virtual machine.
Optional. Name and path of the parent directory where the virtual machine directory should be created. If this parameter is omitted (null pointer or empty string is passed), the new virtual machine directory will be created in the default directory for this Virtuozzo Service.
Flags set which specifies way of virtual machine creation. Use PACF_NON_INTERACTIVE_MODE flag here instead of deprecated bNonInteractiveMode parameter. Other bitset of flags - from enum PRL_CREATE_DISK_IMAGE_FLAGS


A handle of type PHT_JOB containing the results of this asynchronous operation or PRL_INVALID_HANDLE if there's not enough memory to instantiate the job object.


The steps involved in creating a typical virtual machine are:

  1. Obtain a handle to a new virtual machine object using the PrlSrv_CreateVm function.
  2. Populate the object with the desired configuration data.
  3. Choose a name for the virtual machine and set it using the PrlVmCfg_SetName function.
  4. Create and register the new machine with a Virtuozzo Service using the PrlVm_Reg function. This step will create the necessary virtual machine files on the host and will add the machine to the Virtuozzo Service VM registry. The directory containing the virtual machine files will have the same name as the name you've chosen for your virtual machine. The directory will be created in the default VM root directory for this Virtuozzo Service. If you would like to create the virtual machine directory in a different location, you may specify the desired parent directory name and path.
To get the return code from the PHT_JOB object, use the PrlJob_GetRetCode function. Possible values are: 

PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed. 

PRL_ERR_SUCCESS - function completed successfully. 

Copyright ©2016-2017 Parallels International GmbH. All rights reserved.