diff --git a/ChangeLog b/ChangeLog index aacb6c5dd5..2ebe580dca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu May 21 15:20:22 BST 2009 Daniel P. Berrange + + * docs/drvqemu.html[.in], docs/drvxen.html[.in]: Add docs on + use of new domain XML conversions + Thu May 21 15:16:22 BST 2009 Daniel P. Berrange * src/qemu_driver.c, src/qemu_conf.c, src/qemu_conf.h: Add new diff --git a/docs/drvqemu.html b/docs/drvqemu.html index 3147d2e5ab..20fff47040 100644 --- a/docs/drvqemu.html +++ b/docs/drvqemu.html @@ -130,12 +130,28 @@

QEMU/KVM hypervisor driver

+

The libvirt QEMU driver can manage any QEMU emulator from version 0.8.1 or later. It can also manage anything that provides the same QEMU command line syntax and monitor interaction. This includes KVM, and Xenner.

-

Deployment pre-requisites

+

+ Deployment pre-requisites +

  • QEMU emulators: The driver will probe /usr/bin for the presence of qemu, qemu-system-x86_64, @@ -153,7 +169,9 @@ node. If both are found, then Xen paravirtualized guests can be run using the KVM hardware acceleration.
-

Connections to QEMU driver

+

+ Connections to QEMU driver +

The libvirt QEMU driver is a multi-instance driver, providing a single system wide privileged driver (the "system" instance), and per-user @@ -169,6 +187,93 @@ qemu://example.com/system (remote access, TLS/x509) qemu+tcp://example.com/system (remote access, SASl/Kerberos) qemu+ssh://root@example.com/system (remote access, SSH tunnelled) + +

+ Import and export of libvirt domain XML configs +

+

The QEMU driver currently supports a single native + config format known as qemu-argv. The data for this format + is expected to be a single line first a list of environment variables, + then the QEMu binary name, finally followed by the QEMU command line + arguments

+

+ Converting from QEMU args to domain XML +

+

+ The virsh domxml-from-native provides a way to convert an + existing set of QEMU args into a guest description using libvirt Domain XML + that can then be used by libvirt. +

+
$ cat > demo.args <<EOF
+LC_ALL=C PATH=/bin HOME=/home/test USER=test \
+LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 \
+-nographic -monitor pty -no-acpi -boot c -hda \
+/dev/HostVG/QEMUGuest1 -net none -serial none \
+-parallel none -usb
+EOF
+$ virsh domxml-from-native qemu-argv demo.args
+<domain type='qemu'>
+  <uuid>00000000-0000-0000-0000-000000000000</uuid>
+  <memory>219136</memory>
+  <currentMemory>219136</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+    </disk>
+  </devices>
+</domain>
+    
+

NB, don't include the literral \ in the args, put everything on one line

+

+ Converting from domain XML to QEMU args +

+

+ The virsh domxml-to-native provides a way to convert a + guest description using libvirt Domain XML, into a set of QEMU args + that can be run manually. +

+
$ cat > demo.xml <<EOF
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory>219200</memory>
+  <currentMemory>219200</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+    </disk>
+  </devices>
+</domain>
+EOF
+$ virsh domxml-to-native qemu-argv demo.xml
+  LC_ALL=C PATH=/usr/bin:/bin HOME=/home/test \
+  USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
+  -no-kqemu -m 214 -smp 1 -name QEMUGuest1 -nographic \
+  -monitor pty -no-acpi -boot c -drive \
+  file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -net none \
+  -serial none -parallel none -usb
     

Example domain XML config diff --git a/docs/drvqemu.html.in b/docs/drvqemu.html.in index 9ec050160c..e4c3d03765 100644 --- a/docs/drvqemu.html.in +++ b/docs/drvqemu.html.in @@ -2,13 +2,15 @@

QEMU/KVM hypervisor driver

+
    +

    The libvirt QEMU driver can manage any QEMU emulator from version 0.8.1 or later. It can also manage anything that provides the same QEMU command line syntax and monitor interaction. This includes KVM, and Xenner.

    -

    Deployment pre-requisites

    +

    Deployment pre-requisites

    • @@ -32,7 +34,7 @@
    -

    Connections to QEMU driver

    +

    Connections to QEMU driver

    The libvirt QEMU driver is a multi-instance driver, providing a single @@ -52,6 +54,96 @@ qemu+ssh://root@example.com/system (remote access, SSH tunnelled) +

    Import and export of libvirt domain XML configs

    + +

    The QEMU driver currently supports a single native + config format known as qemu-argv. The data for this format + is expected to be a single line first a list of environment variables, + then the QEMu binary name, finally followed by the QEMU command line + arguments

    + +

    Converting from QEMU args to domain XML

    + +

    + The virsh domxml-from-native provides a way to convert an + existing set of QEMU args into a guest description using libvirt Domain XML + that can then be used by libvirt. +

    + +
    $ cat > demo.args <<EOF
    +LC_ALL=C PATH=/bin HOME=/home/test USER=test \
    +LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 \
    +-nographic -monitor pty -no-acpi -boot c -hda \
    +/dev/HostVG/QEMUGuest1 -net none -serial none \
    +-parallel none -usb
    +EOF
    +$ virsh domxml-from-native qemu-argv demo.args
    +<domain type='qemu'>
    +  <uuid>00000000-0000-0000-0000-000000000000</uuid>
    +  <memory>219136</memory>
    +  <currentMemory>219136</currentMemory>
    +  <vcpu>1</vcpu>
    +  <os>
    +    <type arch='i686' machine='pc'>hvm</type>
    +    <boot dev='hd'/>
    +  </os>
    +  <clock offset='utc'/>
    +  <on_poweroff>destroy</on_poweroff>
    +  <on_reboot>restart</on_reboot>
    +  <on_crash>destroy</on_crash>
    +  <devices>
    +    <emulator>/usr/bin/qemu</emulator>
    +    <disk type='block' device='disk'>
    +      <source dev='/dev/HostVG/QEMUGuest1'/>
    +      <target dev='hda' bus='ide'/>
    +    </disk>
    +  </devices>
    +</domain>
    +    
    + +

    NB, don't include the literral \ in the args, put everything on one line

    + +

    Converting from domain XML to QEMU args

    + +

    + The virsh domxml-to-native provides a way to convert a + guest description using libvirt Domain XML, into a set of QEMU args + that can be run manually. +

    + +
    $ cat > demo.xml <<EOF
    +<domain type='qemu'>
    +  <name>QEMUGuest1</name>
    +  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
    +  <memory>219200</memory>
    +  <currentMemory>219200</currentMemory>
    +  <vcpu>1</vcpu>
    +  <os>
    +    <type arch='i686' machine='pc'>hvm</type>
    +    <boot dev='hd'/>
    +  </os>
    +  <clock offset='utc'/>
    +  <on_poweroff>destroy</on_poweroff>
    +  <on_reboot>restart</on_reboot>
    +  <on_crash>destroy</on_crash>
    +  <devices>
    +    <emulator>/usr/bin/qemu</emulator>
    +    <disk type='block' device='disk'>
    +      <source dev='/dev/HostVG/QEMUGuest1'/>
    +      <target dev='hda' bus='ide'/>
    +    </disk>
    +  </devices>
    +</domain>
    +EOF
    +$ virsh domxml-to-native qemu-argv demo.xml
    +  LC_ALL=C PATH=/usr/bin:/bin HOME=/home/test \
    +  USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
    +  -no-kqemu -m 214 -smp 1 -name QEMUGuest1 -nographic \
    +  -monitor pty -no-acpi -boot c -drive \
    +  file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -net none \
    +  -serial none -parallel none -usb
    +    
    +

    Example domain XML config

    QEMU emulated guest on x86_64

    diff --git a/docs/drvxen.html b/docs/drvxen.html index 4eba769a5b..49449617c8 100644 --- a/docs/drvxen.html +++ b/docs/drvxen.html @@ -130,11 +130,27 @@

    Xen hypervisor driver

    +

    The libvirt Xen driver provides the ability to manage virtual machines on any Xen release from 3.0.1 onwards.

    -

    Deployment pre-requisites

    +

    + Deployment pre-requisites +

    The libvirt Xen driver uses a combination of channels to manage Xen virtual machines. @@ -163,7 +179,9 @@ the /etc/xen directory. It is important not to place any other non-config files in this directory. -

    Connections to Xen driver

    +

    + Connections to Xen driver +

    The libvirt Xen driver is a single-instance privileged driver, with a driver name of 'xen'. Some example conection URIs for @@ -175,6 +193,88 @@ xen://example.com/ (remote access, TLS/x509) xen+tcp://example.com/ (remote access, SASl/Kerberos) xen+ssh://root@example.com/ (remote access, SSH tunnelled) + +

    + Import and export of libvirt domain XML configs +

    +

    The Xen driver currently supports two native + config formats. The first known as xen-xm is the format + used by the XM tool for files in /etc/xen. The second + known as xen-sxpr, is the format used for interacting + with the XenD's legacy HTTP RPC service.

    +

    + Converting from XM config files to domain XML +

    +

    + The virsh domxml-from-native provides a way to convert an + existing set of XM config files into a guest description using libvirt Domain XML + that can then be used by libvirt. +

    +
    $ virsh -c xen:/// domxml-from-native xen-xm rhel5.cfg
    +<domain type='xen'>
    +  <name>rhel5pv</name>
    +  <uuid>8f07fe28-753f-2729-d76d-bdbd892f949a</uuid>
    +  <memory>2560000</memory>
    +  <currentMemory>307200</currentMemory>
    +  <vcpu>4</vcpu>
    +  <bootloader>/usr/bin/pygrub</bootloader>
    +  <os>
    +    <type arch='x86_64' machine='xenpv'>linux</type>
    +  </os>
    +  <clock offset='utc'/>
    +  <on_poweroff>destroy</on_poweroff>
    +  <on_reboot>restart</on_reboot>
    +  <on_crash>restart</on_crash>
    +  <devices>
    +    <disk type='file' device='disk'>
    +      <driver name='tap' type='aio'/>
    +      <source file='/var/lib/xen/images/rhel5pv.img'/>
    +      <target dev='xvda' bus='xen'/>
    +    </disk>
    +    <disk type='file' device='disk'>
    +      <driver name='tap' type='qcow'/>
    +      <source file='/root/qcow1-xen.img'/>
    +      <target dev='xvdd' bus='xen'/>
    +    </disk>
    +    <interface type='bridge'>
    +      <mac address='00:16:3e:60:36:ba'/>
    +      <source bridge='xenbr0'/>
    +    </interface>
    +    <console type='pty'>
    +      <target port='0'/>
    +    </console>
    +    <input type='mouse' bus='xen'/>
    +    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'/>
    +  </devices>
    +</domain>
    +    
    +

    + Converting from domain XML to XM config files +

    +

    + The virsh domxml-to-native provides a way to convert a + guest description using libvirt Domain XML, into the XM config file + format. +

    +
    # virsh  -c xen:/// domxml-to-native xen-xm rhel5pv.xml
    +name = "rhel5pv"
    +uuid = "8f07fe28-753f-2729-d76d-bdbd892f949a"
    +maxmem = 2500
    +memory = 300
    +vcpus = 4
    +bootloader = "/usr/bin/pygrub"
    +kernel = "/var/lib/xen/boot_kernel.0YK-cS"
    +ramdisk = "/var/lib/xen/boot_ramdisk.vWgrxK"
    +extra = "ro root=/dev/VolGroup00/LogVol00 rhgb quiet"
    +on_poweroff = "destroy"
    +on_reboot = "restart"
    +on_crash = "restart"
    +sdl = 0
    +vnc = 1
    +vncunused = 1
    +vnclisten = "0.0.0.0"
    +disk = [ "tap:aio:/var/lib/xen/images/rhel5pv.img,xvda,w", "tap:qcow:/root/qcow1-xen.img,xvdd,w" ]
    +vif = [ "mac=00:16:3e:60:36:ba,bridge=virbr0,script=vif-bridge,vifname=vif5.0" ]
         

    Example domain XML config diff --git a/docs/drvxen.html.in b/docs/drvxen.html.in index 3dc36afabb..7af9966b81 100644 --- a/docs/drvxen.html.in +++ b/docs/drvxen.html.in @@ -2,12 +2,14 @@

    Xen hypervisor driver

    +
      +

      The libvirt Xen driver provides the ability to manage virtual machines on any Xen release from 3.0.1 onwards.

      -

      Deployment pre-requisites

      +

      Deployment pre-requisites

      The libvirt Xen driver uses a combination of channels to manage Xen @@ -44,7 +46,7 @@ -

      Connections to Xen driver

      +

      Connections to Xen driver

      The libvirt Xen driver is a single-instance privileged driver, @@ -60,6 +62,89 @@ xen+ssh://root@example.com/ (remote access, SSH tunnelled) +

      Import and export of libvirt domain XML configs

      + +

      The Xen driver currently supports two native + config formats. The first known as xen-xm is the format + used by the XM tool for files in /etc/xen. The second + known as xen-sxpr, is the format used for interacting + with the XenD's legacy HTTP RPC service.

      + +

      Converting from XM config files to domain XML

      + +

      + The virsh domxml-from-native provides a way to convert an + existing set of XM config files into a guest description using libvirt Domain XML + that can then be used by libvirt. +

      + +
      $ virsh -c xen:/// domxml-from-native xen-xm rhel5.cfg
      +<domain type='xen'>
      +  <name>rhel5pv</name>
      +  <uuid>8f07fe28-753f-2729-d76d-bdbd892f949a</uuid>
      +  <memory>2560000</memory>
      +  <currentMemory>307200</currentMemory>
      +  <vcpu>4</vcpu>
      +  <bootloader>/usr/bin/pygrub</bootloader>
      +  <os>
      +    <type arch='x86_64' machine='xenpv'>linux</type>
      +  </os>
      +  <clock offset='utc'/>
      +  <on_poweroff>destroy</on_poweroff>
      +  <on_reboot>restart</on_reboot>
      +  <on_crash>restart</on_crash>
      +  <devices>
      +    <disk type='file' device='disk'>
      +      <driver name='tap' type='aio'/>
      +      <source file='/var/lib/xen/images/rhel5pv.img'/>
      +      <target dev='xvda' bus='xen'/>
      +    </disk>
      +    <disk type='file' device='disk'>
      +      <driver name='tap' type='qcow'/>
      +      <source file='/root/qcow1-xen.img'/>
      +      <target dev='xvdd' bus='xen'/>
      +    </disk>
      +    <interface type='bridge'>
      +      <mac address='00:16:3e:60:36:ba'/>
      +      <source bridge='xenbr0'/>
      +    </interface>
      +    <console type='pty'>
      +      <target port='0'/>
      +    </console>
      +    <input type='mouse' bus='xen'/>
      +    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'/>
      +  </devices>
      +</domain>
      +    
      + +

      Converting from domain XML to XM config files

      + +

      + The virsh domxml-to-native provides a way to convert a + guest description using libvirt Domain XML, into the XM config file + format. +

      + +
      # virsh  -c xen:/// domxml-to-native xen-xm rhel5pv.xml
      +name = "rhel5pv"
      +uuid = "8f07fe28-753f-2729-d76d-bdbd892f949a"
      +maxmem = 2500
      +memory = 300
      +vcpus = 4
      +bootloader = "/usr/bin/pygrub"
      +kernel = "/var/lib/xen/boot_kernel.0YK-cS"
      +ramdisk = "/var/lib/xen/boot_ramdisk.vWgrxK"
      +extra = "ro root=/dev/VolGroup00/LogVol00 rhgb quiet"
      +on_poweroff = "destroy"
      +on_reboot = "restart"
      +on_crash = "restart"
      +sdl = 0
      +vnc = 1
      +vncunused = 1
      +vnclisten = "0.0.0.0"
      +disk = [ "tap:aio:/var/lib/xen/images/rhel5pv.img,xvda,w", "tap:qcow:/root/qcow1-xen.img,xvdd,w" ]
      +vif = [ "mac=00:16:3e:60:36:ba,bridge=virbr0,script=vif-bridge,vifname=vif5.0" ]
      +    

      Example domain XML config