Exemplo n.º 1
0
    def _live_snapshot_cap_check(self):
        '''
        Deprecated. It is not recommended to be called in create_snapshot.
        '''
        volume_obj = self.get_target_volume()
        volume_vm = volume_obj.get_target_vm()
        if volume_vm and volume_vm.get_state() == vm_header.RUNNING:
            host = test_lib.lib_find_host_by_vm(volume_vm.get_vm())
            conditions = res_ops.gen_query_conditions('tag', '=', \
                    'capability:liveSnapshot')
            tag_info = test_lib.lib_find_host_tag(host, conditions)
            if tag_info:
                test_util.test_logger('host: %s support live snapshot' % \
                        host.uuid)
                return True
            else:
                test_util.test_fail('host: %s does not support live snapshot' \
                        % host.uuid)
                return False

        return True
    def _live_snapshot_cap_check(self):
        '''
        Deprecated. It is not recommended to be called in create_snapshot.
        '''
        volume_obj = self.get_target_volume()
        volume_vm = volume_obj.get_target_vm()
        if volume_vm and volume_vm.get_state() == vm_header.RUNNING:
            host = test_lib.lib_find_host_by_vm(volume_vm.get_vm())
            conditions = res_ops.gen_query_conditions('tag', '=', \
                    'capability:liveSnapshot')
            tag_info = test_lib.lib_find_host_tag(host, conditions)
            if tag_info:
                test_util.test_logger('host: %s support live snapshot' % \
                        host.uuid)
                return True
            else:
                test_util.test_fail('host: %s does not support live snapshot' \
                        % host.uuid)
                return False

        return True