To my opinion there is nothing confusing about de semantics:
virsh shutdown => try to shut down the guest gracefully (normally you want to use
this)
virsh destroy => kill the guest!! The term 'destroy' implies something
aggressive. Normally you don't want to use destroy unless you know what you're
doing. If you don't know what you are doing, most of the times, this command is
invoced on trying to undefined a guest (like in your case). Which probably results in
doing nothing. I think this is a rather monkey-proof choice of semantics...
Virsh undefined => remove the guest definition from the host (storage will remain)
To be less polite: RTFM => use 'virsh help' and 'virsh help {command}'
to investigate the commands...
Dominique.
-----Oorspronkelijk bericht-----
Van: libvirt-users-bounces(a)redhat.com [mailto:libvirt-users-bounces@redhat.com] Namens
Kashyap Chamarthy
Verzonden: dinsdag 14 juli 2015 13:22
Aan: KARR, DAVID
CC: libvirt-users(a)redhat.com
Onderwerp: Re: [libvirt-users] So why does "destroy" not actually destroy?
On Tue, Jul 14, 2015 at 12:51:31AM +0000, KARR, DAVID wrote:
I thought it odd that if I have a running VM and I do "virsh
destroy"
it results in a VM that is "shut off". To ACTUALLY destroy a VM, you
have to follow that with "undefine". Could someone elaborate on how
we ended up with these slightly confusing semantics?
I asked this question in 2011[1]. Quoting the two responses from that thread.
Michal Privoznik:
"Libvirt has this philosophy to be backward compatible and therefore
not to change old API including virsh commands. But as time flies,
some APIs are consumed by new ones (virDomainCreateLinux is now just
alias for virDomainCreateXML). So changing this is not feasible way.
What might be, is to create less invasive aliases. But we can't make
'destroy' command to go away."
Also see response from Eric Blake[2] (and others on that thread) on that
thread:
[1]
https://www.redhat.com/archives/libvir-list/2011-June/msg00620.html
-- "Request to rename 'destroy' to something milder"
[2]
https://www.redhat.com/archives/libvir-list/2011-June/msg00656.html
--
/kashyap
_______________________________________________
libvirt-users mailing list
libvirt-users(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users