New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qvm-backup-restore does not allow restoring a single VM #2983

Closed
artemist opened this Issue Aug 6, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@artemist

artemist commented Aug 6, 2017

Qubes OS version (e.g., R3.2):

4.0-rc1


Expected behavior:

qvm-backup-restore -d <source> <file> vmname restores only the vm vmname, and makes no other changes

Actual behavior:

qvm-backup-restore -d <source> <file> vmname restores the vm vmname along with vms with a version which is also on the host. These new vms have the original name + '1' as the name.

Steps to reproduce the behavior:

Install all VMs from a backup, then delete one and install it again.

General notes:

This seems to be since restore_info.values() in this line of qvm_backup_restore.py returns the list of new names of the VMs, as opposed to the old ones. I fixed this when I needed to restore by using vm.name.rstrip('1') instead of vm.name, but this is not a long-term solution.

@blackpit73

This comment has been minimized.

Show comment
Hide comment
@blackpit73

blackpit73 Aug 9, 2017

can be tested easily as follows:

#-- test preparation
qvm-create -l yellow backuptest-1-vm
qvm-create -l yellow backuptest-2-vm
echo -n passphrase >test.passphrase

#-- create backup with backuptest-1-vm and backuptest-2-vm
qvm-backup --passphrase-file test.passphrase --yes pwd backuptest-1-vm backuptest-2-vm

#-- should only restore backuptest-1-vm, not backuptest-2-vm
qvm-backup-restore --rename-conflicting --passphrase-file test.passphrase qubes-2017-08-09T165253 backuptest-1-vm

-----------------+-------+-----------+-----------+--------+
name | type | template | netvm | label |
-----------------+-------+-----------+-----------+--------+
backuptest-2-vm | AppVM | fedora-25 | (default) | yellow | <-- Will be renamed to 'backuptest-2-vm1'
backuptest-1-vm | AppVM | fedora-25 | (default) | yellow | <-- Will be renamed to 'backuptest-1-vm1'

==> backuptest-2-vm will be restored as backuptest-2-vm1, although only backuptest-1-vm should be restored (at least from my expectation).

can be tested easily as follows:

#-- test preparation
qvm-create -l yellow backuptest-1-vm
qvm-create -l yellow backuptest-2-vm
echo -n passphrase >test.passphrase

#-- create backup with backuptest-1-vm and backuptest-2-vm
qvm-backup --passphrase-file test.passphrase --yes pwd backuptest-1-vm backuptest-2-vm

#-- should only restore backuptest-1-vm, not backuptest-2-vm
qvm-backup-restore --rename-conflicting --passphrase-file test.passphrase qubes-2017-08-09T165253 backuptest-1-vm

-----------------+-------+-----------+-----------+--------+
name | type | template | netvm | label |
-----------------+-------+-----------+-----------+--------+
backuptest-2-vm | AppVM | fedora-25 | (default) | yellow | <-- Will be renamed to 'backuptest-2-vm1'
backuptest-1-vm | AppVM | fedora-25 | (default) | yellow | <-- Will be renamed to 'backuptest-1-vm1'

==> backuptest-2-vm will be restored as backuptest-2-vm1, although only backuptest-1-vm should be restored (at least from my expectation).

@blackpit73

This comment has been minimized.

Show comment
Hide comment
@blackpit73

blackpit73 Aug 9, 2017

The line https://github.com/QubesOS/qubes-core-admin-client/blob/master/qubesadmin/tools/qvm_backup_restore.py#L250 should be
corrected to using the original name ==> vm_info.vm.name for vm_info in restore_info.values(),
I'll commit a patch in my fork.

The line https://github.com/QubesOS/qubes-core-admin-client/blob/master/qubesadmin/tools/qvm_backup_restore.py#L250 should be
corrected to using the original name ==> vm_info.vm.name for vm_info in restore_info.values(),
I'll commit a patch in my fork.

marmarek added a commit to marmarek/qubes-core-admin-client that referenced this issue Sep 4, 2017

marmarek added a commit to marmarek/qubes-core-admin-client that referenced this issue Sep 4, 2017

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status Sep 14, 2017

Closed

core-admin-client v4.0.6 (r4.0) #208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment