[opensuse-virtual] how to know one domain is defined or not
Hi experts I want to write a script to determine one domain named "vm1" is defined or not, if defined, I will undefine it. The question is how could I know it define or not ? Lei -- To unsubscribe, e-mail: opensuse-virtual+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-virtual+owner@opensuse.org
On 17.01.2013 10:37, lei yang wrote:
Hi experts
I want to write a script to determine one domain named "vm1" is defined or not, if defined, I will undefine it.
The question is how could I know it define or not ?
either you can 'virsh list --persistent --all | grep $vm' or you can try 'virsh undefine $vm' which will throw an error if there's no such domain as $vm. Michal -- To unsubscribe, e-mail: opensuse-virtual+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-virtual+owner@opensuse.org
Thanks, works for me Lei On Thu, Jan 17, 2013 at 10:01 PM, Michal Privoznik <mprivozn@redhat.com> wrote:
virsh list --persistent --all -- To unsubscribe, e-mail: opensuse-virtual+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-virtual+owner@opensuse.org
participants (2)
-
lei yang
-
Michal Privoznik