Skip to content

Commit 4670b33

Browse files
committed
tools clean: also clean the snapshots
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
1 parent 5e5b010 commit 4670b33

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/tools/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ def cli() -> None:
105105
# subparser - command: clean
106106
subparser_cmd_clean = subparsers.add_parser(
107107
name="clean",
108-
description="Remove all VMs and all VDIs on local storage from target pools",
109-
help="Remove all VMs and all VDIs on local storage from target pools",
108+
description="Remove all VMs, snapshorts and VDIs on local storage from target pools",
109+
help="Remove all VMs, snapshorts and VDIs on local storage from target pools",
110110
)
111111
cmd_clean_excl_grp = subparser_cmd_clean.add_mutually_exclusive_group(required=True)
112112
cmd_clean_excl_grp.add_argument(

lib/tools/tasks/clean.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ def clean_pool(pool: Pool, dry_run: bool) -> None:
5959
'vm-list',
6060
{'is-control-domain': False, 'is-a-template': False},
6161
minimal=True,
62+
)) + safe_split(master.xe(
63+
'vm-list',
64+
{'is-a-snapshot': True},
65+
minimal=True,
6266
))
6367
for vm_uuid in vm_uuids:
6468
vm = VM(vm_uuid, master)

0 commit comments

Comments
 (0)