Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Feature .qcow2 file #6

Open
servebeer opened this issue Aug 14, 2023 · 10 comments
Open

Feature .qcow2 file #6

servebeer opened this issue Aug 14, 2023 · 10 comments

Comments

@servebeer
Copy link

Thanks for the script as this saved me a lot of time! There are two features that I would like to see added:

  1. Built-in support for Windows VMs that contain TPMs. Currently, you have to manually rename the image files.
  2. Built-in support for non-img image files (i.e. qcow2)

Thanks!
Jon

@Emilien-Lambert
Copy link
Owner

Hi @servebeer.

I currently don't own any Unraid servers, so I don't have the option of testing the script if I make any changes.

The modification to rename files is quite simple, so I'll add it as soon as I have a moment.

On the other hand, the modification to manage qcow2 images is perhaps a little more complex.
I have no idea whether the restoration process is the same for qcow2 images.

The simplest thing would be for you to modify the condition in the script to add, accept .qcow2 and if your restore works well, then I'll add this possibility to the script.

if [[ "$BACKUP_FILE" == *".img" ]]; then

@servebeer
Copy link
Author

servebeer commented Aug 14, 2023 via email

@Emilien-Lambert
Copy link
Owner

I've added the 2 improvements, but I can't test it.

Please try the script from this branch:
feature-qcow2

If you confirm that it restores "-tpm" files without errors and that it works correctly with ".qcow2" files, I'll put the improvement on the main branch.

@Emilien-Lambert
Copy link
Owner

Hi @servebeer did you have time to try the modification I made for you?

@servebeer
Copy link
Author

@Emilien-Lambert , sorry for the delay. I have been battling AT&T over Internet issues recently. They are supposed to come on-prem today and fix it. If so, I will look into this tomorrow and let you know how it works out.

@servebeer
Copy link
Author

I believe that it is now working. Here are the latest logs...

2023-09-10 04:33:48 information: skip_vm_shutdown is false and use_snapshots is 1. skipping vm shutdown procedure. OpenManage is shut off. can_backup_vm set to y.
2023-09-10 04:33:48 information: actually_copy_files is 1.
2023-09-10 04:33:48 information: can_backup_vm flag is y. starting backup of OpenManage configuration, nvram, and vdisk(s).
2023-09-10 04:33:48 information: copy of OpenManage.xml to /mnt/user/vmbackup/OpenManage/20230910_0300_OpenManage.xml complete.
2023-09-10 04:33:48 information: OpenManage does not appear to have an nvram file. skipping.
2023-09-10 04:33:48 information: unable to perform snapshot for disk /mnt/user/domains/OpenManage/20230730_0300_openmanage_enterprise.qcow2 on OpenManage. falling back to traditional backup. use_snapshots is 1. vm_state is shut off. vdisk_type is qcow2.
2023-09-10 04:39:37 information: copy of /mnt/user/domains/OpenManage/20230730_0300_openmanage_enterprise.qcow2 to /mnt/user/vmbackup/OpenManage/20230910_0300_20230730_0300_openmanage_enterprise.qcow2.zst complete.
2023-09-10 04:39:37 information: backup of /mnt/user/domains/OpenManage/20230730_0300_openmanage_enterprise.qcow2 vdisk to /mnt/user/vmbackup/OpenManage/20230910_0300_20230730_0300_openmanage_enterprise.qcow2.zst complete.
2023-09-10 04:39:37 information: beginning copy of extra files in path: /mnt/user/domains/OpenManage for VM OpenManage.
2023-09-10 04:39:37 information: copy of backup of /mnt/user/domains/OpenManage//20230730_0300_OpenManage.xml file to /mnt/user/vmbackup/OpenManage//20230910_0300_20230730_0300_OpenManage.xml starting.
2023-09-10 04:39:37 information: copy of /mnt/user/domains/OpenManage//20230730_0300_OpenManage.xml to /mnt/user/vmbackup/OpenManage//20230910_0300_20230730_0300_OpenManage.xml complete.
2023-09-10 04:39:37 information: /mnt/user/domains/OpenManage/20230730_0300_openmanage_enterprise.qcow2 on OpenManage is a vdisk. skipping file.
2023-09-10 04:39:37 information: the extensions of the vdisks that were backed up are qcow2.
2023-09-10 04:39:37 information: vm_state is shut off. vm_original_state is shut off. not starting OpenManage.
2023-09-10 04:39:37 information: backup of OpenManage to /mnt/user/vmbackup/OpenManage completed.
2023-09-10 04:39:37 information: cleaning out backups older than 180 days in location ONLY if newer files exist in /mnt/user/vmbackup/OpenManage/
2023-09-10 04:39:37 information: did not find any config files to remove.
2023-09-10 04:39:38 information: did not find any nvram files to remove.
2023-09-10 04:39:38 information: did not find any vdisk image files to remove.
2023-09-10 04:39:38 information: did not find any vm log files to remove.
2023-09-10 04:39:38 information: cleaning out backups over 2 in location /mnt/user/vmbackup/OpenManage/
2023-09-10 04:39:38 information: removed '/mnt/user/vmbackup/OpenManage/20230903_0300_20230730_0300_OpenManage.xml' config file.
2023-09-10 04:39:38 information: removed '/mnt/user/vmbackup/OpenManage/20230903_0300_OpenManage.xml' config file.
2023-09-10 04:39:38 information: did not find any nvram files to remove.
2023-09-10 04:39:39 information: removed '/mnt/user/vmbackup/OpenManage/20230827_0300_20230730_0300_openmanage_enterprise.qcow2.zst' vdisk image file.
2023-09-10 04:39:39 information: removed '/mnt/user/vmbackup/OpenManage/20230827_0300_unraid-vmbackup.log' vm log file.

@Emilien-Lambert
Copy link
Owner

Uh, what are the logs for? Because my script doesn't write those kind of logs.
When you run the script, does it finish correctly, with no errors?

@servebeer
Copy link
Author

The logs came from here: /SETTINGS/VM Backup/SHOW LOG. Am I confusing a built-in feature with your script?

@Emilien-Lambert
Copy link
Owner

I think I have. In fact, I'm not the author of the plugin that lets you create backups from the Unraid interface. In fact, the person(s) who made the backup plugin created the tools that allow you to back up, but not to restore the backup. (No idea why this wasn't done.) Anyway, the normal way to restore a backup is to execute a number of commands and move, rename etc, the backup files manualy.

I simply created a script that automates this. Now, it seems that your backup isn't working for a configuration reason unknown to me.

If you didn't get an error log in the terminal or you ran ./vm_backup_restoration.sh

This means that the backup files have been correctly moved. Now if the VM etc doesn't start, the problem is probably with the plugin itself.

To do this, I suggest you ask your question in the forum dedicated to the plugin. The people in charge of the plugin will certainly have some solutions to suggest, concerning your configuration with .qcow2 files. Here

@servebeer
Copy link
Author

servebeer commented Sep 19, 2023 via email

@Emilien-Lambert Emilien-Lambert changed the title Feature Requests Feature .qcow2 file Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants