Exemple #1
0
 def commit_snapshots(self):
     for device in self.params["device_tag"].split():
         device_params = self.params.object_params(device)
         snapshot_tags = device_params["snapshot_tags"].split()
         self.device_node = self.get_node_name(device)
         device = self.get_node_name(snapshot_tags[-1])
         backup_utils.block_commit(self.main_vm, device)
Exemple #2
0
 def _commit_snapshots(device, base_node=None, top_node=None):
     arguments = {}
     if base_node:
         arguments.update({"base-node": base_node})
     if top_node:
         arguments.update({"top-node": top_node})
     backup_utils.block_commit(self.main_vm, device, **arguments)
Exemple #3
0
 def commit_snapshots(self):
     device = self.params.get("device_tag")
     device_params = self.params.object_params(device)
     snapshot_tags = device_params["snapshot_tags"].split()
     self.device_node = self.get_node_name(device)
     options = ["base-node", "top-node", "speed"]
     arguments = self.params.copy_from_keys(options)
     arguments["base-node"] = self.get_node_name(device)
     device = self.get_node_name(snapshot_tags[-1])
     arguments["top-node"] = device
     backup_utils.block_commit(self.main_vm, device, **arguments)
 def commit_snapshots(self):
     for device in self.params["device_tag"].split():
         device_params = self.params.object_params(device)
         snapshot_tags = device_params["snapshot_tags"].split()
         self.device_node = self.get_node_name(device)
         device = self.get_node_name(snapshot_tags[-1])
         try:
             backup_utils.block_commit(self.main_vm, device)
         except AssertionError as e:
             if self.params["qmp_error_msg"] not in str(e):
                 self.test.fail(str(e))
         else:
             self.test.fail("Commit to non-enough space success")
Exemple #5
0
 def commit_snapshots(self):
     device = self.params.get("device_tag")
     device_params = self.params.object_params(device)
     snapshot_tags = device_params["snapshot_tags"].split()
     self.device_node = self.get_node_name(device)
     options = ["base-node", "top-node", "speed", "backing-file"]
     arguments = self.params.copy_from_keys(options)
     arguments["base-node"] = self.get_node_name(device)
     backing_file = self.params.object_params(snapshot_tags[-2])
     self.backing_file = storage.get_image_filename(backing_file,
                                                    data_dir.get_data_dir())
     arguments["backing-file"] = self.backing_file
     arguments["top-node"] = self.get_node_name(snapshot_tags[-2])
     device = self.get_node_name(snapshot_tags[-1])
     backup_utils.block_commit(self.main_vm, device, **arguments)
     self.main_vm.destroy()
Exemple #6
0
 def boot_and_commit_snapshot(self):
     vm_name = self.params["main_vm"]
     vm_params = self.params.object_params(vm_name)
     images = self.params.objects("images")
     vm_params["images"] = " ".join(images)
     env_process.preprocess_vm(self.test, vm_params, self.env, vm_name)
     self.main_vm = self.env.get_vm(vm_name)
     self.pre_test()
     device = self.params.get("device_tag")
     device_params = self.params.object_params(device)
     snapshot_tags = device_params["snapshot_tags"].split()
     self.device_node = self.get_node_name(device)
     options = ["base-node", "top-node", "speed"]
     arguments = self.params.copy_from_keys(options)
     device = self.get_node_name(snapshot_tags[-1])
     backup_utils.block_commit(self.main_vm, device, **arguments)
Exemple #7
0
 def commit_snapshots(self):
     if self.is_blockdev_mode():
         options = ["base-node", "top-node", "speed"]
         arguments = self.params.copy_from_keys(options)
         arguments["base-node"] = self.get_node_name(
             self.params["base_tag"])
         arguments["top-node"] = self.get_node_name(self.params["top_tag"])
         device = self.get_node_name(self.snapshot_tags[-1])
     else:
         options = ["base", "top", "speed"]
         arguments = self.params.copy_from_keys(options)
         base_image = self.get_image_by_tag(self.params["base_tag"])
         top_image = self.get_image_by_tag(self.params['top_tag'])
         arguments["base"] = base_image.image_filename
         arguments["top"] = top_image.image_filename
         device = self.device_node
     backup_utils.block_commit(self.main_vm, device, **arguments)
 def commit_snapshots(self):
     job_id_list = []
     for device in self.params["device_tag"].split():
         device_params = self.params.object_params(device)
         snapshot_tags = device_params["snapshot_tags"].split()
         self.device_node = self.get_node_name(device)
         options = ["base-node", "top-node", "speed"]
         arguments = self.params.copy_from_keys(options)
         arguments["base-node"] = self.get_node_name(device)
         arguments["top-node"] = self.get_node_name(snapshot_tags[-2])
         device = self.get_node_name(snapshot_tags[-1])
         if len(self.params["device_tag"].split()) == 1:
             backup_utils.block_commit(self.main_vm, device, **arguments)
         else:
             commit_cmd = backup_utils.block_commit_qmp_cmd
             cmd, args = commit_cmd(device, **arguments)
             job_id = args.get("job-id", device)
             job_id_list.append(job_id)
             self.main_vm.monitor.cmd(cmd, args)
     for job_id in job_id_list:
         job_utils.wait_until_block_job_completed(self.main_vm, job_id)
 def commit_snapshots_on_data_images(self):
     """commit snapshots onto data images"""
     commit_options = {}
     for idx, snap_node in enumerate(self._snap_nodes):
         backup_utils.block_commit(self.main_vm, snap_node,
                                   **commit_options)