blob: 88d7a372a748540cb8915abc92734c34018c9870 [file] [log] [blame]
In addition to using normal file images for the emulated storage
devices, QEMU can also use networked resources such as iSCSI devices.
These are specified using a special URL syntax.
iSCSI support allows QEMU to access iSCSI resources directly and use
as images for the guest storage. Both disk and cdrom images are
Syntax for specifying iSCSI LUNs is
By default qemu will use the iSCSI initiator-name
'[:<name>]' but this can also be set from
the command line or a configuration file.
Since version Qemu 2.4 it is possible to specify a iSCSI request
timeout to detect stalled requests and force a reestablishment of the
session. The timeout is specified in seconds. The default is 0 which
means no timeout. Libiscsi 1.15.0 or greater is required for this
Example (without authentication):
.. parsed-literal::
|qemu_system| -iscsi \
-cdrom iscsi:// \
-drive file=iscsi://
Example (CHAP username/password via URL):
.. parsed-literal::
|qemu_system| -drive file=iscsi://user%password@
Example (CHAP username/password via environment variables):
.. parsed-literal::
|qemu_system| -drive file=iscsi://
QEMU supports NBD (Network Block Devices) both using TCP protocol as
well as Unix Domain Sockets. With TCP, the default port is 10809.
Syntax for specifying a NBD device using TCP, in preferred URI form:
Syntax for specifying a NBD device using Unix Domain Sockets;
remember that '?' is a shell glob character and may need quoting:
Older syntax that is also recognized:
Syntax for specifying a NBD device using Unix Domain Sockets
Example for TCP
.. parsed-literal::
|qemu_system| --drive file=nbd:
Example for Unix Domain Sockets
.. parsed-literal::
|qemu_system| --drive file=nbd:unix:/tmp/nbd-socket
QEMU supports SSH (Secure Shell) access to remote disks.
.. parsed-literal::
|qemu_system| -drive file=ssh://user@host/path/to/disk.img
|qemu_system| -drive file.driver=ssh,file.user=user,,file.port=22,file.path=/path/to/disk.img
Currently authentication must be done using ssh-agent. Other
authentication methods may be supported in future.
Sheepdog is a distributed storage system for QEMU. QEMU supports
using either local sheepdog devices or remote networked devices.
Syntax for specifying a sheepdog device
.. parsed-literal::
|qemu_system| --drive file=sheepdog://
See also
GlusterFS is a user space distributed file system. QEMU supports the
use of GlusterFS volumes for hosting VM disk images using TCP, Unix
Domain Sockets and RDMA transport protocols.
Syntax for specifying a VM disk image on GlusterFS volume is
.. parsed-literal::
.. parsed-literal::
|qemu_system| --drive file=gluster://,
|qemu_system| 'json:{"driver":"qcow2",
|qemu_system| -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img,
See also
QEMU supports read-only access to files accessed over http(s) and
Syntax using a single filename:
'http', 'https', 'ftp', or 'ftps'.
Optional username for authentication to the remote server.
Optional password for authentication to the remote server.
Address of the remote server.
Path on the remote server, including any query string.
The following options are also supported:
The full URL when passing options to the driver explicitly.
The amount of data to read ahead with each range request to the
remote server. This value may optionally have the suffix 'T', 'G',
'M', 'K', 'k' or 'b'. If it does not have a suffix, it will be
assumed to be in bytes. The value must be a multiple of 512 bytes.
It defaults to 256k.
Whether to verify the remote server's certificate when connecting
over SSL. It can have the value 'on' or 'off'. It defaults to
Send this cookie (it can also be a list of cookies separated by
';') with each outgoing request. Only supported when using
protocols such as HTTP which support cookies, otherwise ignored.
Set the timeout in seconds of the CURL connection. This timeout is
the time that CURL waits for a response from the remote server to
get the size of the image to be downloaded. If not set, the
default timeout of 5 seconds is used.
Note that when passing options to qemu explicitly, ``driver`` is the
value of <protocol>.
Example: boot from a remote Fedora 20 live ISO image
.. parsed-literal::
|qemu_system_x86| --drive media=cdrom,file=,readonly
|qemu_system_x86| --drive media=cdrom,file.driver=http,file.url=,readonly
Example: boot from a remote Fedora 20 cloud image using a local
overlay for writes, copy-on-read, and a readahead of 64k
.. parsed-literal::
qemu-img create -f qcow2 -o backing_file='json:{"file.driver":"http",, "file.url":"",, "file.readahead":"64k"}' /tmp/Fedora-x86_64-20-20131211.1-sda.qcow2
|qemu_system_x86| -drive file=/tmp/Fedora-x86_64-20-20131211.1-sda.qcow2,copy-on-read=on
Example: boot from an image stored on a VMware vSphere server with a
self-signed certificate using a local overlay for writes, a readahead
of 64k and a timeout of 10 seconds.
.. parsed-literal::
qemu-img create -f qcow2 -o backing_file='json:{"file.driver":"https",, "file.url":"",, "file.sslverify":"off",, "file.readahead":"64k",, "file.timeout":10}' /tmp/test.qcow2
|qemu_system_x86| -drive file=/tmp/test.qcow2