Storage options: Difference between revisions

From Xen
Jump to navigationJump to search
(Start with a discussion of guest disk storage considerations)
 
No edit summary
 
(3 intermediate revisions by 3 users not shown)
Line 11: Line 11:
Using a block device based storage configuration, such as LVM, allows you to take advantage of the ''blkback'' driver which performs better than the drivers which support disk image storage (e.g. ''blktap'' or ''qdisk''). Disk image based solutions typically offer slower performance but are more flexible in some areas (e.g. snapshotting, master/gold image deployments)
Using a block device based storage configuration, such as LVM, allows you to take advantage of the ''blkback'' driver which performs better than the drivers which support disk image storage (e.g. ''blktap'' or ''qdisk''). Disk image based solutions typically offer slower performance but are more flexible in some areas (e.g. snapshotting, master/gold image deployments)


It is possible to mix and match the two approachs, for example by setting up the system using LVM and creating a single large Logical Volume with a file system to contain disk images.
It is possible to mix and match the two approaches, for example by setting up the system using LVM and creating a single large Logical Volume with a file system to contain disk images.


It is recommended to plan for LVM when installing your host and to use it where possible.
It is recommended to plan for LVM when installing your host and to use it where possible.
Line 17: Line 17:
====Linux Logical Volume Manager (LVM)====
====Linux Logical Volume Manager (LVM)====


In order to use ''Logical Volumes'' (LVs) as guest disks you should be sure to set aside enough of your physical disk space to create an LVM ''Volume Group'' (VG) to contain your disk images. This means that at installation time you will need to setup your partitioning scheme with a large partition configuration for use as an LVM ''Physical Volume'' (PV).
In order to use ''Logical Volumes'' (LVs) as guest disks you should be sure to set aside enough of your physical disk space to create a LVM ''Volume Group'' (VG) to contain your disk images. This means that at installation time you will need to setup your partitioning scheme with a large partition configuration for use as an LVM ''Physical Volume'' (PV).


You may also be able to use LVM for you host OS root partition, swap etc depending on the domain 0 OS. There is no particular harm in storing these host level volumes in the same VG as you intend to use for guest storage.
You may also be able to use LVM for your host OS root partition, swap, etc depending on the domain 0 OS. There is no particular harm in storing these host level volumes in the same VG as you intend to use for guest storage.


For a system which is to be a dedicated Xen host primarily used to run guests (i.e. only minimal services in domain 0) a good rule of thumb is to set aside 4-8GB (depending on host OS) for the domain 0 root filesystem, plus some amount of swap space and if necessary a small ''/boot'' partition and to leave the rest of the disk (or PV) spare to serve as guest storage.
For a system which is to be a dedicated Xen Project host primarily used to run guests (i.e. only minimal services in domain 0) a good rule of thumb is to set aside 4-8GB (depending on host OS) for the domain 0 root filesystem, plus some amount of swap space and if necessary a small ''/boot'' partition and to leave the rest of the disk (or PV) spare to serve as guest storage.


====File Backed Storage====
====File Backed Storage====


There are fewer install time consideration with file backend storage since you can, if you like, just use the large root filesystem of your domain 0 install.
There are fewer install time considerations with file backend storage since you can, if you like, just use the large root filesystem of your domain 0 install.


However even if you intend to use solely file backed storage you should consider configuring LVM with a single large Logical Volume in order to give yourself flexibility in the future.
However even if you intend to use solely file backed storage you should consider configuring LVM with a single large Logical Volume in order to give yourself flexibility in the future.
Line 37: Line 37:
[[Category:Users]]
[[Category:Users]]
[[Category:Beginners]]
[[Category:Beginners]]
[[Category:Performance]]
[[Category:Fundamentals]]

Latest revision as of 23:34, 17 April 2014

This document lists some common considerations for when you are instaling a host OS with the intention of running Xen.

Guest Storage

Before installing a host (domain 0) OS it is useful to consider where you are intending to store the guest OS disk images. This is especially important if you are intending to store the guest disk images locally.

Local Storage

There are two main choices for local storage of guest disk images. You can either use a tool such a Linux's LVM to carve up your physical disk into multiple block devices, each of which can be used as a guest disk, or you can store guest disk images as files (using either raw, qcow2 or vhd format) on a local filesystem.

Using a block device based storage configuration, such as LVM, allows you to take advantage of the blkback driver which performs better than the drivers which support disk image storage (e.g. blktap or qdisk). Disk image based solutions typically offer slower performance but are more flexible in some areas (e.g. snapshotting, master/gold image deployments)

It is possible to mix and match the two approaches, for example by setting up the system using LVM and creating a single large Logical Volume with a file system to contain disk images.

It is recommended to plan for LVM when installing your host and to use it where possible.

Linux Logical Volume Manager (LVM)

In order to use Logical Volumes (LVs) as guest disks you should be sure to set aside enough of your physical disk space to create a LVM Volume Group (VG) to contain your disk images. This means that at installation time you will need to setup your partitioning scheme with a large partition configuration for use as an LVM Physical Volume (PV).

You may also be able to use LVM for your host OS root partition, swap, etc depending on the domain 0 OS. There is no particular harm in storing these host level volumes in the same VG as you intend to use for guest storage.

For a system which is to be a dedicated Xen Project host primarily used to run guests (i.e. only minimal services in domain 0) a good rule of thumb is to set aside 4-8GB (depending on host OS) for the domain 0 root filesystem, plus some amount of swap space and if necessary a small /boot partition and to leave the rest of the disk (or PV) spare to serve as guest storage.

File Backed Storage

There are fewer install time considerations with file backend storage since you can, if you like, just use the large root filesystem of your domain 0 install.

However even if you intend to use solely file backed storage you should consider configuring LVM with a single large Logical Volume in order to give yourself flexibility in the future.

Remote Storage

If you intend to store guest disk images remotely (e.g. on the network using NFS or iSCSI) then there isn't much to be considered at host OS installation time.