Previous page

Next page

Locate page in Contents

Print this page

Using pctl backup and pctl restore

This section describes how to perform the basic backup-related operations using the pctl utility.

Creating a Virtual Machine and Container Backup

You can use the pctl backup command to back up your virtual machines and Containers. This command is executed on the Source Server and can store the created virtual machine and Container backup on both the Source and Backup Servers. When creating a backup on the Source Server, you only need to specify the name of the virtual machine and Container to back up. For example, you can execute the following command to back up the MyVM virtual machine and store its backup archive on the Source Server:

# pctl backup MyVM

Backing up the VM MyVM

Operation progress 100%

The virtual machine has been successfully backed up with backup ID { 746dba2a-3b10-4ced-9dd6-76a2blcl4a69 }

The command output informs you that the virtual machine backup has been successfully created and assigned ID 746dba2a-3b10-4ced-9dd6-76a2blcl4a69 . You can use this ID when managing the backup archive (e.g. remove the backup).

At the same time, you can run the following command to back up the MyVM virtual machine and store its backup archive on the Backup Server with the IP address of 129.129.10.10 :

# pctl backup MyVM -s root:1qaz2wsx@129.129.10.10

root:1qaz2wsx before the Destination Server IP address denotes the root credentials used to log in to this server. If you do not specify these credentials, you will be asked to do so during the command execution.

All newly created backups are placed to the directory specified as the value of the BACKUP_DIR parameter in the /etc/vzbackup.conf configuration file. By default, this directory is /vz/backups/ ID (where ID is the ID of the respective virtual machine and Container).

Notes :

1. A Backup Server can be any server running the Parallels Server Bare Metal software and having sufficient space for storing virtual machine and Container backups.

2. For more information on the options you can pass to pctl backup , refer to the Parallels Command Line Reference Guide .

Listing the Existing Backups

You can use the pctl backup-list command to view the backups existing on the physical server. For example:

# pctl backup-list

ID Backup_ID Node Date Type Size

{c1dee22f-8667-4870-9e11-278f1398eab0} {209d54a0-e3b8-4a03-9ca8-d4cc7a2a27ca} test.com 2009-06-30 10:19:32 f 411566405

This command lists the backups existing on the Source Server. If you want to list the backups on the Backup Server, you need to specify the IP address of this server.

The command output shows that currently only two backups exist on the Source Server. These backups were created for a virtual machine and Container with the ID of c1dee22f-8667-4870-9e11-278f1398eab0 . The information on the backups is presented in the following table:

Column Name

Description

ID

The ID uniquely identifying the virtual machine and 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 physical server storing the backup archive.

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.

Removing a Virtual Machine and Container Backup

At any time, you can remove a backup that you do not need any more using the pctl backup-delete command. To do this, you need to specify the ID of the backup to remove and the ID of the respective virtual machine and Container. If you do not know these IDs, use the pctl backup-list and check the ID and Backup ID columns. For example:

# pctl backup-list

ID Backup_ID Node Date Type Size

{c1dee22f-8667-4870-9e11-278f1398eab0} {209d54a0-e3b8-4a03-9ca8-d4cc7a2a27ca} test.com 2009-06-30 10:19:32 f 411566405

# pctl backup-delete c1dee22f-8667-4870-9e11-278f1398eab0 -t 209d54a0-e3b8-4a03-9ca8-d4cc7a2a27ca

Delete the VM backup

The VM backup has been successfully removed.

You can also specify the virtual machine and Container name instead of its ID:

# pctl backup-delete MyVM -t 209d54a0-e3b8-4a03-9ca8-d4cc7a2a27ca

If you have several backups of a particular virtual machine and Container and want to delete them all at once, indicate only the virtual machine and Container name or ID:

# pctl backup-delete MyVM

This command removes all backups of the MyVM virtual machine from the local Backup Server. To remove backups stored remotely, you also need to specify the IP address of the remote Server:

# pctl backup-delete MyVM -s root:1qaz2wsx@129.129.10.10

Restore a Virtual Machine and Container

To restore a backup of a virtual machine and Container, you can use the pctl restore command. This command supports restoring backups to the Source Server only. For example, to restore a backup of the MyVM virtual machine stored on the Backup Server with the IP address of 10.10.100.1 , you can run this command on the Source Node:

# pctl restore MyVM -s root:1qaz2wsx@10.10.100.1

If you have two or more backups of the MyVM virtual machine, the latest backup is restored. If you want to restore a particular virtual machine and Container backup, you need to specify the ID of this backup. You can use the pctl backup-list command to list the existing backups and the IDs assigned to them:

# pctl backup-list -s root:1qaz2wsx@10.10.100.1

ID Backup_ID Node Date Type Size

{c1dee22f-8667-4870-9e11-278f1398eab0} {209d54a0-e3b8-4a03-9ca8-d4cc7a2a27ca} test.com 2009-06-30 10:19:32 i 11566405

{c1dee22f-8667-4870-9e11-278f1398eab0} {24a3011c-092e-4f21-bb3b-29ccfe967e92} test.com 2009-05-21 11:12:35 f 356798701

You can now indicate the desired ID after the -t option to tell pctl backup to restore this particular backup. For example, to restore the backup for the virtual machine with the ID of c1dee22f-8667-4870-9e11-278f1398eab0 that was created on the 21st of May, you can execute this command:

# pctl restore -t {c1dee22f-8667-4870-9e11-278f1398eab0} -s root:1qaz2wsx@10.10.100.1