Using pbackup and prestore
Along with
prlctl
, you can use the following utilities to create and manage backups of your virtual machines and Containers:
-
pbackup
. This utility is used to create backups of individual virtual machines and Containers or entire Parallels servers.
-
prestore
. This utility is used to manage the existing backups of virtual machines and Containers.
Backing Up Virtual Machines and Containers
The
pbackup
utility is run on the backup server connecting via SSH to the Parallels server and backing up one or more virtual machines and Containers on this server. By default, new Container and virtual machine backups are placed in the
/var/parallels/backups
directory. You can change the default backup directory with the
prlsrvctl set
command.
Let us assume that you want to back up the entire Parallels server (that is, all virtual machines and Containers on this server) with the
test.com
hostname. In this case, you can run the following command on the backup server:
# pbackup test.com
During the command execution, you will be asked to provide the
test.com
credentials. After doing so, the command will back up all virtual machines and Containers on the
test.com
and put
-
all backed up Containers to the backup server
-
all backed up virtual machines to the source server
To save the backed up virtual machines also on the backup server, you should additionally specify the
-n
option. This option is used to indicate the IP address or hostname of the backup server and its credentials:
# pbackup -n root:7ujn6yhb@192.168.10.199 test.com
If you wish to back up not all, but specific virtual machines and Containers from the specified server, use the
–e
or
–x
switches (to include or exclude the specified virtual machines and Containers, respectively). For example:
# pbackup -n root:7ujn6yhb@192.168.10.199 test.com -e 101 MyVM
In this session, only Container 101 and the
MyVM
virtual machine residing on the source server with the
test.com
hostname will be included in the backup, and their backups will be stored on the backup server.
Notes
:
1. A backup server can be any server running Parallels Cloud Server and having sufficient space for storing virtual machine or Container backups.
2. You cannot back up virtual machines with attached physical HDDs, mounted ISO or floppy disk images, etc.
3. For the full list of configuration parameters and command line options for
pbackup
, consult the
Parallels Cloud Server 6.0 Command Line Reference Guide
.
Restoring Backups
To restore any individual virtual machines and Containers or entire Parallels servers, you may want to view first the information about them. This can be done using the
prestore -l
command:
# prestore -l -n test.com test.com
root@test.com's password:
...
Backups for node test.com:
ID Backup_ID Node Date Type Size
101 2011-05-... test.com 2012-05-30 09:42:19 f 18721280
{cd91b90b...} {4ef87485...} test.com 2012-05-16 17:15:47 f 92617398
[
The ID and Backup ID are reduced for better readability.
]
The command output shows that currently only two backups exist for the
test.com
server on the backup server. If you omit the
-n test.com
option, the command will list:
-
all Container backups for the
test.com
server stored on the backup server
-
all virtual machine backups for the
test.com
server stored on the
test.com
server
The information on the backups is presented in the following table:
Column
|
Description
|
ID
|
The ID uniquely identifying the virtual machine or Container.
|
Backup ID
|
The ID assigned to the backup archive. You need to specify this ID when performing any backup-related operations.
|
Node
|
The hostname of the source server.
|
Date
|
The date and time when the backup archive was created.
|
Type
|
The backup type. Currently, you can create two types of backups:
-
A full backup indicated by
f
.
-
An incremental backup indicated by
i
and containing only the files changed since the previous full or incremental backup. This is the default backup type.
|
Size
|
The size of the backup archive, in bytes.
|
To restore Container 101 and the
{cd91b90b-469d-42c6-acf4-fefee09cfa61}
virtual machine, run this command:
# prestore -n test.com -e 101 {cd91b90b-469d-42c6-acf4-fefee09cfa61}
This command will restore the Container and the virtual machine to their source server.
You can also use the
-d
option to restore Container 101 to a Parallels server other than the source server. For example, this command
# prestore -d 192.168.10.199 test.com -e 101
restores Container 101 to the destination server with IP address
192.168.10.199
. If you want to restore all Containers backups for the
test.com
Parallels server, just skip the
-e
option.
Notes:
1. The current version of Parallels Cloud Server supports restoring virtual machines to the source server only.
2. The
prestore
utility can also manage (list, restore, etc.) backups created using the
prlctl backup
command. However, you are highly recommended to use the same utility (either
prlctl
or
prestore
) during the life cycle of a particular backup.
3. For the full list of command line options for
prestore
, refer to the
Parallels Cloud Server 6.0 Command Line Reference Guide
.
|