Article ID: 6369, created on May 25, 2009, last review on May 7, 2014

  • Applies to:
  • Virtuozzo hypervisor 4.0
  • Virtuozzo hypervisor 4.0 for Mac Bare Metal

Resolution

1. Backing up:

The following SDK options are used to automate Parallels Server Bare Metal virtual machines backup:

PrlSrv_GetBackupTree, (
        PRL_HANDLE hSourceServer,
        PRL_CONST_STR sVmUuid,
        PRL_CONST_STR sTargetHost,
        PRL_UINT32 nTargetPort,
        PRL_CONST_STR sTargetSessionId,
        PRL_UINT32 backup_flags,
        PRL_UINT32 reserved_flags,
        PRL_BOOL force_operation
                 )
hSourceServer – A handle of type PHT_SERVER identifying the source Parallels Service.
sVmUuid – A virtual machine uuid
sTargetHost – The name of the target host machine.
nTargetPort – The port number on the target host.
sTargetSessionId – The target Parallels Service session ID.
backup_flags – Flags that specify backup type and etc. Acceptable flags:
   PBT_FULL – full backup
   PBT_INCREMENTAL – incremental backup
   PBT_DIFFERENTAL – differential backup
   PVMSL_LOW_SECURITY
   PVMSL_NORMAL_SECURITY
   PVMSL_HIGH_SECURITY
reserved_flags – Reserved flags.
force_operation – Specifies to process VM backup action without asking any additional questions from the Parallels Service side (non-interactive clients should use this option).
\<BackupItem\> - root element of a branch containing information about an individual backup. The element has an attribute "Uuid" containing the backup ID. The ID is required when performing other operations on a backup.
\<DateTime\> - the backup creation date and time.
\<Type> - backup type {full, incremental, differential}
\<Size> - Backup size in kbytes.

2. Backup listing:

PrlSrv_GetBackupTree, (
        PRL_HANDLE hSourceServer,
        PRL_CONST_STR sVmUuid,
        PRL_CONST_STR sTargetHost,
        PRL_UINT32 nTargetPort,
        PRL_CONST_STR sTargetSessionId,
        PRL_UINT32 backup_flags,
        PRL_UINT32 reserved_flags,
        PRL_BOOL force_operation
                 )
hSourceServer – A handle of type PHT_SERVER identifying the source Parallels Service.
sVmUuid – A virtual machine uuid
sTargetHost – The name of the target host machine.
nTargetPort – The port number on the target host.
sTargetSessionId – The target Parallels Service session ID.
backup_flags – Flags that specify backup type and etc. Acceptable flags:
   PBT_FULL – full backup
   PBT_INCREMENTAL – incremental backup
   PBT_DIFFERENTAL – differential backup
   PVMSL_LOW_SECURITY
   PVMSL_NORMAL_SECURITY
   PVMSL_HIGH_SECURITY
reserved_flags – Reserved flags.
force_operation – Specifies to process VM backup action without asking any additional questions from the Parallels Service side (non-interactive clients should use this option).
Returns 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.
Dispatcher replies to this call with VM UUID and backup UUID.
It’s possible to get backup tree from PHT_JOB.

XML output looks like:
<BackupTree>
   <VmItem>
      <Uuid>{0a898c0e-5bf9-45f9-8c59-6d822a1790b8}</Uuid>
      <Name>test11</Name>
      <BackupItem>
         <Uuid>{a4726b38-745e-4447-9459-58b80780a8b1}</Uuid>
         <Host>tvs-win.sw.ru</Host>
         <ServerUuid>{dc99ed27-9bbf-4bc3-8f0e-33d39b9826b1}</ServerUuid>
   <DateTime>2009-05-11 12:50:35</DateTime>
         <Creator>root</Creator>
         <Size>582176343</Size>
         <Type>f</Type>
        <Description>Some text</Description>
      </BackupItem>

\<BackupItem\> - root element of a branch containing information about an individual backup. The element has an attribute "Uuid" containing the backup ID. The ID is required when performing other operations on a backup.
\<DateTime\> - the backup creation date and time.
\<Type> - backup type {full, incremental, differential}
\<Size> - Backup size in kbytes.

3. Restoring:

Use the SDK options listed to restore previously backed up VM:

PrlSrv_RestoreVmBackup (
        PRL_HANDLE hSourceServer,
        PRL_CONST_STR sVmUuid,
        PRL_CONST_STR sBackupUuid,
        PRL_CONST_STR sTargetHost,
        PRL_UINT32 nTargetPort,
        PRL_CONST_STR sTargetSessionId,
        PRL_CONST_STR sTargetVmHomePath,
        PRL_UINT32 restore_flags,
        PRL_UINT32 reserved_flags,
        PRL_BOOL force_operation
                   )
hSourceServer - A handle of type PHT_SERVER identifying the source Parallels Service.
sVmUuid – A virtual machine uuid
sBackupUuid - A backup uuid
sTargetHost – The name of the target host machine.
nTargetPort - The port number on the target host.
sTargetSessionId - The target Parallels Service session ID.
sTargetVmHomePath - Home directory of the target virtual machine.
restore_flags - Flags that specify restore type and etc. Acceptable flags:
   PVMSL_LOW_SECURITY
   PVMSL_NORMAL_SECURITY
   PVMSL_HIGH_SECURITY
reserved_flags - Reserved flags.
force_operation - Specifies to process VM backup action without asking any additional questions from the Parallels Service side (non-interactive clients should use this option).

a26b38f94253cdfbf1028d72cf3a498b d245cfd276e66749824316e20bfd8ade 0fe456bdc1f41aefe37dd2554a60437e 2897d76d56d2010f4e3a28f864d69223

Email subscription for changes to this article
Save as PDF