File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77from concurrent .futures import ThreadPoolExecutor
88
9+ from lib .host import Host
910from lib .pool import NotAMasterHostError , Pool
11+ from lib .tools .tasks .snapshot import create_snapshot
1012
1113from .. import logger
1214
@@ -26,7 +28,7 @@ def update_pools(inventory: dict) -> None:
2628 inventory_hosts = inventory ["hosts" ]
2729 # init related pools
2830 pools = []
29- nested_hosts = []
31+ nested_hosts : list [ Host ] = []
3032 for h in inventory_hosts :
3133 try :
3234 p = Pool (h )
@@ -49,3 +51,9 @@ def update_pools(inventory: dict) -> None:
4951 # repos are the same as the primary (master)
5052 repos = inventory_hosts [p .master .hostname_or_ip ]["enablerepos" ]
5153 executor .submit (h .update , repos )
54+
55+ # Snapshot creation
56+ # get ids of VMs for parent host
57+ vm_uuids = [h .get_system_uuid () for h in nested_hosts ]
58+ parent_pool = Pool (inventory ["parent" ]) # mandatory for getting an host instance
59+ create_snapshot (parent_pool .master , vm_uuids )
You can’t perform that action at this time.
0 commit comments