13

Is it possible to import an XML file into libvirt without having libvirt boot the virtual machine?

If I do:

virsh create centos63.xml

Then libvirt will import the XML file and immediately try to boot the image, and this isn't what I want.

(I have several scripts that take as argument a libvirt domain that corresponds to a VM that is not currently running, which is why I want to do this).

1 Answer 1

20

Yes, it is possible:

virsh # help define
  NAME
    define - define (but don't start) a domain from an XML file

  SYNOPSIS
    define <file>

  DESCRIPTION
    Define a domain.

  OPTIONS
    [--file] <string>  file containing an XML domain description
1
  • 6
    In addition it's worth noting that "virsh create" is creating a transient domain that will disappear when the VM is stopped, while "virsh define" is creating a persistent domain. See VM_lifecycle for more info. Jul 11, 2013 at 5:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .