... <devices> <filesystem type='template'> <source name='my-vm-template'/> <target dir='/'/> </filesystem> <filesystem type='mount' accessmode='passthrough'> <driver type='path' wrpolicy='immediate'/> <source dir='/export/to/guest'/> <target dir='/import/from/host'/> <readonly/> </filesystem> ... </devices> ...
Figure 20.24. Devices - filesystems
filesystemattribute has the following possible values:
='mount'- Specifies the host physical machine directory to mount in the guest virtual machine. This is the default type if one is not specified. This mode also has an optional sub-element
driver, with an attribute
='handle'. The driver block has an optional attribute
wrpolicythat further controls interaction with the host physical machine page cache; omitting the attribute reverts to the default setting, while specifying a value immediate means that a host physical machine writeback is immediately triggered for all pages touched during a guest virtual machine file write operation
='template'- Specifies the OpenVZ filesystem template and is only used by OpenVZ driver.
='file'- Specifies that a host physical machine file will be treated as an image and mounted in the guest virtual machine. This filesystem format will be autodetected and is only used by LXC driver.
='block'- Specifies the host physical machine block device to mount in the guest virtual machine. The filesystem format will be autodetected and is only used by LXC driver.
='ram'- Specifies that an in-memory filesystem, using memory from the host physical machine OS will be used. The source element has a single attribute
usagewhich gives the memory usage limit in kibibytes and is only used by LXC driver.
='bind'- Specifies a directory inside the guest virtual machine which will be bound to another directory inside the guest virtual machine. This element is only used by LXC driver.
accessmodewhich specifies the security mode for accessing the source. Currently this only works with type='mount' for the QEMU/KVM driver. The possible values are:
passthrough- Specifies that the source is accessed with the User's permission settings that are set from inside the guest virtual machine. This is the default access mode if one is not specified.
mapped- Specifies that the source is accessed with the permission settings of the hypervisor.
squash- Similar to
'passthrough', the exception is that failure of privileged operations like
chownare ignored. This makes a passthrough-like mode usable for people who run the hypervisor as non-root.
<source>- Specifies that the resource on the host physical machine that is being accessed in the guest virtual machine. The
nameattribute must be used with
<type='template'>, and the
dirattribute must be used with
usageattribute is used with
<type='ram'>to set the memory limit in KB.
target- Dictates where the source drivers can be accessed in the guest virtual machine. For most drivers this is an automatic mount point, but for QEMU-KVM this is merely an arbitrary string tag that is exported to the guest virtual machine as a hint for where to mount.
readonly- Enables exporting the file sydtem as a readonly mount for guest virtual machine, by default
read-writeaccess is given.
space_hard_limit- Specifies the maximum space available to this guest virtual machine's filesystem
space_soft_limit- Specifies the maximum space available to this guest virtual machine's filesystem. The container is permitted to exceed its soft limits for a grace period of time. Afterwards the hard limit is enforced.