crc-org / crc

CRC is a tool to help you run containers. It manages a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes
https://crc.dev
Apache License 2.0
1.26k stars 242 forks source link

[BUG] Cleanup function not working when using the latest libvirt driver #4228

Closed adrianriobo closed 4 months ago

adrianriobo commented 5 months ago

Testing nightly bits we build a custom version of libvirt driver (head from main branch) when used within crc to create the VMs now we are hitting an issue on cleanup function.

This is due to clenaup be implemented directly invoking a virsh commmand which now needs some extra parameter.

Current output for the issue

[cloud-user@rhel-crcqe ~]$ crc cleanup
INFO Removing vsock configuration                 
INFO Removing 'crc' network from libvirt          
INFO Removing /etc/NetworkManager/dnsmasq.d/crc.conf file 
INFO Removing /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf file 
INFO Removing crc daemon systemd socket units     
INFO Removing crc daemon systemd service          
INFO Removing crc's virtual machine               
INFO Removing crc libvirt storage pool            
INFO Removing CRC Specific entries from user's known_hosts file 
INFO Removing hosts file records added by CRC     
INFO Removing pull secret from the keyring        
INFO Removing older logs                          
Failed to undefine 'crc' VM

Also after that issue we are not able to start a new VM as crc setup ends successfully but crc start ends on an error:

INFO Creating CRC VM for OpenShift 4.16.0-rc.4... 
Error creating machine: Error in driver during machine creation: virError(Code=9, Domain=20, Message='operation failed: domain 'crc' already exists with uuid f1e079f6-2366-46c1-ba35-883aea7e1a74')
anjannath commented 4 months ago

fixed in #4229