I am new to servers and vms wanted to know the difference between
Let’s take a look into
destroy domain Immediately terminate the domain domain. This doesn't give the domain OS any chance to react, and it's the equivalent of ripping the power cord out on a physical machine. In most cases you will want to use the shutdown command instead. However, this does not delete any storage volumes used by the guest, and if the domain is persistent, it can be restarted later. undefine domain Undefine a domain. If the domain is running, this converts it to a transient domain, without stopping it. If the domain is inactive, the domain configuration is removed.
This indicates that
destroy is a way to shutdown a domain quite ungracefully, while
undefine just converts it to a transient one or removes its configuration.