The steps involved in creating a typical virtual machine are:
- Obtain a handle to a new virtual machine object using the PrlSrv_CreateVm function.
- Populate the object with the desired configuration data.
- Choose a name for the virtual machine and set it using the PrlVmCfg_SetName function.
- 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.