Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-65105

The guest have nvram cannot be undefine with --replace option

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-10.0
    • virt-manager / Common
    • No
    • Moderate
    • rhel-sst-virtualization
    • ssg_virtualization
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

      Please provide the package NVR for which the bug is seen:
      virt-install-4.1.0-7.el10.noarch

      How reproducible is this bug?:
      100%

      Steps to reproduce

      1. Create 2 guests.
      # virsh list --all
       Id   Name    State
      ------------------------
       -    test2   shut off
       -    test3   shut off
      2.  Run virt-clone with --replace option.
      # virt-clone -o test3 -n test2 --replace --auto-clone --debug
      3.  Check the result.
      [Mon, 28 Oct 2024 23:22:29 virt-clone 53351] DEBUG (cloner:569) Duplicate failed: Could not remove old vm 'test2': Requested operation is not valid: cannot undefine domain with nvram
      [Mon, 28 Oct 2024 23:22:29 virt-clone 53351] DEBUG (cli:256)   File "/usr/bin/virt-clone", line 8, in <module>
          virtclone.runcli()
        File "/usr/share/virt-manager/virtinst/virtclone.py", line 209, in runcli
          fail(main_e)
        File "/usr/share/virt-manager/virtinst/cli.py", line 256, in fail
          log.debug("".join(traceback.format_stack()))
      
      [Mon, 28 Oct 2024 23:22:29 virt-clone 53351] ERROR (cli:257) Could not remove old vm 'test2': Requested operation is not valid: cannot undefine domain with nvram
      [Mon, 28 Oct 2024 23:22:29 virt-clone 53351] DEBUG (cli:259) 
      Traceback (most recent call last):
        File "/usr/share/virt-manager/virtinst/virtclone.py", line 203, in runcli
          sys.exit(main())
                   ^^^^^^
        File "/usr/share/virt-manager/virtinst/virtclone.py", line 194, in main
          cloner.start_duplicate(cli.get_meter())
        File "/usr/share/virt-manager/virtinst/cloner.py", line 555, in start_duplicate
          _replace_vm(self.conn, self._new_guest.name)
        File "/usr/share/virt-manager/virtinst/cloner.py", line 46, in _replace_vm
          raise RuntimeError(msg) from None
      RuntimeError: Could not remove old vm 'test2': Requested operation is not valid: cannot undefine domain with nvram
      

      Expected results
      The guest with nvram should be undefined successfully and the virt-clone can be success.

              rhn-engineering-colerobinson Cole Robinson
              xiaodwan@redhat.com Xiaodai Wang
              virt-maint virt-maint
              virt-bugs virt-bugs
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: