I have a simple KVM virtual lab which uses a Synology as the storage backend. Originally, I was just working with the simple storage model where each target points to one LUN which is being used by one guest VM. But then I ran into Synology's limit (for my relatively low-end model) of 10 total targets and 10 total LUN's.

So, is a reasonable way around this? I would need to have multiple servers using the same iSCSI LUN. Is this possible? If so how, and is this a widely used practice?

  • 1
    in ESXi and Hyper-V you'd simply use a single LUN/iSCSI target to create a data store for your hypervisor, and then you'd provision chunks of that data store for the virtual hard drive for each virtual machine. Does KVM use the concept of a data store for the hypervisor? – joeqwerty Nov 15 '16 at 19:07
  • @joeqwerty I'm not sure I'll have to look into that. – Sean Lynch Nov 15 '16 at 19:33
  • 1
    @joeqwerty It works pretty much exactly the same with KVM. Only a data store is called a "storage pool". You use a single LUN to create a storage pool, and then VM hard drive images will be stored there. – Michael Hampton Nov 15 '16 at 19:46
  • Exactly like @Michael Hampton wrote, but KVM AFAIK doesn't have storage pools, libvirtd has those. – Michal Sokolowski Nov 17 '16 at 1:07

If you want to use block devices with iSCSI for KVM, get around this limitation and still keep things simple, you could use LVM2.

If you don't need to share logical volumes across hypervisors, then you can do this using vanilla LVM2 (without clustering via cLVM). Using this, you would provide one larger LUN to each hypervisor and join that to a new "volume group" via either the vgcreate command, or by defining pools via libvirt. A volume group serves as an elastic storage pool for each hypervisor, providing logical volumes which behave like partitions with extra features, such as being able to be moved or resized with little effort..

In the interest of effort deduplication, this RHEL Storage Administrators Guide details how to do this via common graphical means and by the shell via virsh.

  • 1
    Thank you. This makes sense.. But what if I did want to share the logical volumes across hypervisors? For instance, if I have multiple virtualization servers and want to enable VM migration, I'd need to be able to share them in this way. – Sean Lynch Nov 15 '16 at 20:29
  • 1
    If you want to enable live migration while still using block devices as disk images, you'll need to use cLVM to handle metadata consistency, locking, and volume group management. cLVM requires that you set up a Linux HA cluster to handle quorum and resource states. It's a lot more complicated than using something like NFS, which people typically opt for in this situation. If you want to live migrate VMs, I would seriously suggest NFS with qcow2 machine images for the sake of simplicity. It performs really well, and the qcow2 images have useful features such as inline snapshots. – Spooler Nov 15 '16 at 21:54

If you really need the live migration and true HA, a single Synology unit is simply not enough. It would turn into a single point of failure in your case. Also, Synology is a great solution for storing backups or being a file server, but it's not really a good fit for the primary production storage.

There are a lot of software-defined solutions that can help you building a proper redundant storage for your cluster. For example, you can take a pair of hypervisor hosts, fill them with required amount of storage an use something from this list:

HPE VSA - Linux based HA storage solution. Requires 2 physical nodes and 1 witness.

StarWind Virtual SAN - Windows based HA storage solution. Requires 2 nodes.

Unity VSA - Linux based HA storage solution. Requires 3 nodes.

All of above solutions also have free versions available.

Instead of building HA cluster from scratch with KVM, DRBD, cLVM and Pacemaker (or whatever you prefer), I would recommend you taking a look at Citrix XenServer which is free and has most of the necessary features already pre-installed and ready to use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.