Skip to content

Commit

Permalink
Add nvram option for undefine vm
Browse files Browse the repository at this point in the history
With crc-org/machine-driver-libvirt@a130898
now `nvram` is added to domain template and as part of undefine it we
need to use this flag otherwise following error occur during `crc
cleanup` if domain is present.

```
Code=55, Domain=10, Message='Requested operation is not valid: cannot undefine domain with nvram'
```

This pr even work with current template where no `<nvram />` present.
  • Loading branch information
praveenkumar committed Jun 13, 2024
1 parent 2b23a06 commit b853643
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/crc/preflight/preflight_checks_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ func removeCrcVM() error {
return fmt.Errorf("Failed to destroy 'crc' VM")
}
}
_, stderr, err := crcos.RunWithDefaultLocale("virsh", "--connect", "qemu:///system", "undefine", constants.DefaultName)
_, stderr, err := crcos.RunWithDefaultLocale("virsh", "--connect", "qemu:///system", "undefine", "--nvram", constants.DefaultName)
if err != nil {
logging.Debugf("%v : %s", err, stderr)
return fmt.Errorf("Failed to undefine 'crc' VM")
Expand Down

0 comments on commit b853643

Please sign in to comment.