1

I am new to servers and vms wanted to know the difference between

virsh destroy

and

virsh undefine
1

Let’s take a look into man virsh:

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.

  • Thanks for the answer.Is there any command that deletes a vm and removes the configuration file in a single go.. – Dheeraj Chelaramani Jun 29 '18 at 7:50
  • @DheerajChelaramani If this answer solved your issue, please take a moment and accept it by clicking on the check mark to the left. That will mark the question as answered and is the way thanks are expressed on the Stack Exchange sites. If you have another question, please ask it by clicking the Ask Question button. – dessert Jun 29 '18 at 7:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.