我是服务器和虚拟机的新手,想知道两者之间的区别
virsh destroy
和
virsh undefine
答案1
让我们来看看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.
这表明这destroy
是一种非常不礼貌地关闭域的方法,而undefine
只是将其转换为临时域或删除其配置。