def METHOD_NAME(test, params, env):
    """
    Test start Vm with nbd disk with setting rerror_policy.
    1.Prepare test environment,destroy or suspend a VM.
    2.Prepare test xml.
    3.Perform test operation.
    4.Recover test environment.
    5.Confirm the test result.
    """
    vm_name = params.get("main_vm")
    vm = env.get_vm(vm_name)
    # Disk specific attributes.
    rerror_policy_value = params.get("rerror_policy_value")
    image_path = params.get("virt_disk_device_source")
    cleanup_files.append(image_path)
    hotplug = "yes" == params.get("virt_device_hotplug")
    status_error = "yes" == params.get("status_error")
    define_error = "yes" == params.get("define_error", "no")
    # Back up xml file.
    if vm.is_alive():
        vm.destroy(gracefully=False)
    vmxml_backup = vm_xml.VMXML.new_from_inactive_dumpxml(vm_name)
    try:
        # Get server hostname.
        nbd_server_host = process.METHOD_NAME('hostname', ignore_status=False, shell=True, verbose=True).stdout_text.strip()
        # Create NbdExport object
        nbd = NbdExport(image_path, image_size="100M")
        nbd.start_nbd_server()
        # Create disk XML as required
        vmxml = vm_xml.VMXML.new_from_dumpxml(vm_name)
        disk_xml_obj = create_customized_nbd_disk(params, nbd_server_host)
        if not hotplug:
            # Sync VM xml.
            vmxml.add_device(disk_xml_obj)
            vmxml.sync()
        vm.start()
        vm.wait_for_login().close()
    except virt_vm.VMStartError as e:
        if status_error:
            LOG.debug("VM failed to start as expected."
                      "Error: %s", str(e))
        else:
            test.fail("VM failed to start."
                      "Error: %s" % str(e))
    except xcepts.LibvirtXMLError as xml_error:
        if not define_error:
            test.fail("Failed to define VM:\n%s" % str(xml_error))
    except Exception as ex:
        test.fail("unexpected exception happen: %s" % str(ex))
    else:
        if rerror_policy_value == "ignore":
            check_dmeg_and_domblkerror(params, vm, test, check_error_msg=False)
        elif rerror_policy_value == "report":
            check_dmeg_and_domblkerror(params, vm, test, check_error_msg=True)
        elif rerror_policy_value == "stop":
            process.METHOD_NAME("pidof qemu-nbd && killall qemu-nbd",
                        ignore_status=True, shell=True)
            if not vm.pause():
                test.fail("VM should be paused if rerror_policy='stop'")
    finally:
        try:
            if nbd:
                nbd.cleanup()
        except Exception as ndbEx:
            LOG.info("Clean up nbd failed: %s", str(ndbEx))
        # Recover VM
        LOG.info("Restoring vm...")
        if vm.is_alive():
            vm.destroy(gracefully=False)
        vmxml_backup.sync()
        # Clean up images
        for file_path in cleanup_files:
            if os.path.exists(file_path):
                os.remove(file_path)