How to use the command qmrestore (with examples)

How to use the command qmrestore (with examples)

The qmrestore command is used to restore QemuServer vzdump backups. It allows users to restore virtual machine backups, overwrite existing virtual machines, restore from specific storage, and start virtual machines immediately from backups.

Use case 1: Restore virtual machine from given backup file on the original storage

Code:

qmrestore path/to/vzdump-qemu-100.vma.lzo 100

Motivation: This use case is useful when there is a need to restore a specific virtual machine from a backup file on the original storage. It is commonly used in disaster recovery scenarios.

Explanation:

  • path/to/vzdump-qemu-100.vma.lzo is the path to the backup file that needs to be restored.
  • 100 is the ID of the virtual machine that needs to be restored.

Example output:

Restoring VM 100 from file: '/path/to/vzdump-qemu-100.vma.lzo'

Use case 2: Overwrite existing virtual machine from a given backup file on the original storage

Code:

qmrestore path/to/vzdump-qemu-100.vma.lzo 100 --force true

Motivation: This use case is helpful when there is a need to restore a virtual machine and overwrite an existing virtual machine with the same ID. It is commonly used when there is a need to revert to a previous state of the virtual machine.

Explanation:

  • path/to/vzdump-qemu-100.vma.lzo is the path to the backup file that needs to be restored.
  • 100 is the ID of the virtual machine that needs to be restored.
  • --force true is an optional argument that forces the restoration and overwrites the existing virtual machine.

Example output:

Overwriting VM 100 with file: '/path/to/vzdump-qemu-100.vma.lzo'

Use case 3: Restore virtual machine from a given backup file on specific storage

Code:

qmrestore path/to/vzdump-qemu-100.vma.lzo 100 --storage local

Motivation: This use case is useful when there is a need to restore a virtual machine from a backup file on a specific storage rather than the original storage. It provides flexibility to restore backups based on the available storage.

Explanation:

  • path/to/vzdump-qemu-100.vma.lzo is the path to the backup file that needs to be restored.
  • 100 is the ID of the virtual machine that needs to be restored.
  • --storage local is an optional argument that specifies the storage where the backup file is located.

Example output:

Restoring VM 100 from file: '/path/to/vzdump-qemu-100.vma.lzo' using storage 'local'

Use case 4: Start virtual machine immediately from the backup while restoring in the background (only on Proxmox Backup Server)

Code:

qmrestore path/to/vzdump-qemu-100.vma.lzo 100 --live-restore true

Motivation: This use case is beneficial when there is a need to start a virtual machine immediately from a backup and restore it in the background. It is commonly used to minimize downtime during the restoration process.

Explanation:

  • path/to/vzdump-qemu-100.vma.lzo is the path to the backup file that needs to be restored.
  • 100 is the ID of the virtual machine that needs to be restored.
  • --live-restore true is an optional argument that starts the virtual machine immediately from the backup while restoring it in the background. This option is only available on Proxmox Backup Server.

Example output:

Starting VM 100 from file: '/path/to/vzdump-qemu-100.vma.lzo' with live restore

Conclusion:

The qmrestore command is a powerful tool for restoring QemuServer vzdump backups. It provides various use cases to restore virtual machines from backup files, overwrite existing virtual machines, restore from specific storage, and start virtual machines immediately from backups. Depending on the requirements, users can choose the appropriate use case to perform the necessary restoration tasks efficiently.

Related Posts

Using ssh-keygen (with examples)

Using ssh-keygen (with examples)

The ssh-keygen command is a versatile tool that allows users to generate and manage SSH keys used for authentication, password-less logins, and other purposes.

Read More
How to use the command 'goldeneye.py' (with examples)

How to use the command 'goldeneye.py' (with examples)

GoldenEye is a HTTP Denial-of-Service (DoS) test tool that allows users to test the performance of a specific website by conducting a simulated DoS attack.

Read More
How to use the command "kosmorro" (with examples)

How to use the command "kosmorro" (with examples)

“kosmorro” is a command-line tool that allows users to compute the ephemerides and events for a given date at a specified position on Earth.

Read More