Skip to content
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

The script does not delete the cloned VM #67

Open
mfhunruh opened this issue Feb 6, 2021 · 3 comments · May be fixed by #72
Open

The script does not delete the cloned VM #67

mfhunruh opened this issue Feb 6, 2021 · 3 comments · May be fixed by #72

Comments

@mfhunruh
Copy link

mfhunruh commented Feb 6, 2021

Hello!
Thanks a lot for your script!

I have a problem where the script is ignoring the deletion of the cloned VM.

oVirt vesrion: 4.4.4-7.el8

My config:

[config]
vm_names: ["VM1"]
vm_middle=_BACKUP
snapshot_description=Snapshot for backup script
server=https://ovirt.example.org/ovirt-engine/api
username=svc@internal
password=password
export_domain=vmdisks_backup_01
timeout=10
cluster_name=CLUSTER
datacenter_name=DC01
backup_keep_count=
backup_keep_count_by_number=3
dry_run=False
vm_name_max_length=64
use_short_suffix=False
storage_domain=vmdisks_storage_01
storage_space_threshold=0.1
logger_fmt=%(asctime)s: %(message)s
logger_file_path=
persist_memorystate=False

Command:

# ./backup.py -c config.cfg -d

Logs:

2021-02-07 01:23:38,135: Start backup for: VM1
2021-02-07 01:23:38,184: The storage domain vmdisks_backup_01 is in state active
2021-02-07 01:23:38,255: Search backup snapshots matching Description="Snapshot for backup script"
2021-02-07 01:23:38,358: Snapshot creation started ...
2021-02-07 01:23:39,006: Snapshot operation(creation) in progress ...
2021-02-07 01:23:39,007: Snapshot id=a5d2af3b-0f7e-4729-b678-e0c7b7fb4cf2 status=locked
2021-02-07 01:23:59,647: Snapshot created
2021-02-07 01:24:09,909: Clone into VM (VM1_BACKUP_20210207_012338) started ...
2021-02-07 01:29:25,567: Cloning into VM (VM1_BACKUP_20210207_012338) in progress ...                                                                                                 [309/1056]
2021-02-07 01:33:49,119: Cloning finished
2021-02-07 01:33:49,119: Search backup snapshots matching Description="Snapshot for backup script"
2021-02-07 01:33:49,523: Found backup snapshot to delete. Description: Snapshot for backup script, Created on: 2021-02-07 01:23:38.590000+03:00
2021-02-07 01:33:50,014: Snapshot deletion started ...
2021-02-07 01:33:50,841: Snapshot operation(deletion) in progress ...
2021-02-07 01:33:50,841: Snapshot id=a5d2af3b-0f7e-4729-b678-e0c7b7fb4cf2 status=locked
2021-02-07 01:34:21,637: Snapshots deleted
2021-02-07 01:34:21,638: Looking for old backup to delete matching ^VM1_BACKUP*, keeping max 3 images...
2021-02-07 01:34:23,085: Found 0 old backup images in export_domain.
2021-02-07 01:34:23,121: Export of VM (VM1_BACKUP_20210207_012338) started ...
2021-02-07 01:36:57,040: Exporting finished
2021-02-07 01:36:57,089: Duration: 32:37 minutes
2021-02-07 01:36:57,089: VM exported as VM1_BACKUP_20210207_012338
2021-02-07 01:36:57,090: Backup done for: VM1
2021-02-07 01:36:57,091: All backups done  

And after the script finishes, I see a virtual machine with the _BACKUP <...> prefix in the VM list, as well as its disks in the original storage domain

Please help

@sergey-chubik
Copy link

The script does not delete the VM due to the changes made in the last Commit in vmtools.py

@wefixit-AT
Copy link
Owner

Thanks for the report. If you have time can you please create a pull request.
Currently I'm totally busy (24/7). If anybody read this I'm searching employees around Lower Austria, more information's on https://blog.wefixit.at

@slavonnet
Copy link
Contributor

slavonnet commented Dec 27, 2021

vmtools.py
in del func need replace double "_" to single "_" in regexp

@slavonnet slavonnet linked a pull request Jan 5, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants