File tree 2 files changed +49
-0
lines changed
2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ - multihost:
2
+ type = multihost
3
+ vms = ' '
4
+ start_vm = no
5
+ kill_vm = no
6
+ nodes = node1
7
+ multihost = yes
8
+ storage_type = nfs
9
+ force_create_image = yes
10
+ remove_image = yes
11
+ images = top
12
+ image_chain_top = base top
13
+ image_name_base = base
14
+ image_name_top = top
15
+ image_format_base = luks
16
+ image_secret_base = redhat
17
+ image_format_top = qcow2
18
+ preallocated_base = metadata
19
+ image_cluster_size = 1M
Original file line number Diff line number Diff line change
1
+ from virttest .vt_imgr import imgr
2
+
3
+
4
+ def run (test , params , env ):
5
+ images = dict ()
6
+ for image_tag in params .objects ("images" ):
7
+ images [image_tag ] = imgr .query_virt_image (image_tag )
8
+ imgr .update_virt_image (images [image_tag ], {"backup" : {}})
9
+ test .log .info (
10
+ "after backup: %s: %s" ,
11
+ image_tag ,
12
+ imgr .get_virt_image_info (images [image_tag ]),
13
+ )
14
+ imgr .update_virt_image (images [image_tag ], {"restore" : {}})
15
+ test .log .info (
16
+ "after restore: %s: %s" ,
17
+ image_tag ,
18
+ imgr .get_virt_image_info (images [image_tag ]),
19
+ )
20
+
21
+ for image_id in images .values ():
22
+ test .log .info ("source: %s: %s" , image_id , imgr .get_virt_image_info (image_id ))
23
+ cloned_image_id = imgr .clone_virt_image (image_id )
24
+ test .log .info (
25
+ "cloned: %s: %s" , cloned_image_id , imgr .get_virt_image_info (cloned_image_id )
26
+ )
27
+ imgr .update_virt_image (cloned_image_id , {"destroy" : {}})
28
+ imgr .destroy_virt_image_object (cloned_image_id )
29
+ imgr .update_virt_image (image_id , {"destroy" : {}})
30
+ imgr .destroy_virt_image_object (image_id )
You can’t perform that action at this time.
0 commit comments