Design considerations for setting up a KVM server virtualization solution
Surveys indicate that 70% of online businesses adopt server virtualization solutions to reduce their costs . But many times, the virtualization software costs outweigh this cost-benefit. That is where open source server virtualization technologies make a difference.
Choosing the right virtualization technology includes review of factors such as cost, features, security and performance. Recently we were contacted by a hosting provider who wanted to sell cheap VPS plans to SMBs. In this post we’ll discuss our design considerations to implement a server virtualization solution that was affordable, feature-rich, easily scalable and secure.
Server virtualization – our design considerations
KVM is an open source virtualization technology that supports all key virtualization tasks such as fast provisioning, high availability, live migration and resource management. As per IBM’s pricing analysis, KVM-based solution offers 42% savings over proprietary software such as VMware , for Linux-based environments.
But unlike VMware that comes as a complete package for virtualization management, KVM provides only a hypervisor to manage VMs. To configure a management framework over KVM hypervisor, we installed oVirt, an open source solution. oVirt provided an easy-to-manage interface with which we managed our environment and configured KVM to perform virtualization tasks.
Here is a run-down of the top features we implemented in our virtualization solution:
1. Easy scalability
‘Scalability on demand’ was a key feature we needed in our solution. We wanted to spin out virtual machines quickly whenever new users signed up. This is known as horizontal scaling, where we add more machines into the existing pool.
When each VM demands more resources, we had to easily expand CPU, disk space or RAM, without adding more physical machines. This is termed as vertical scaling. With KVM’s memory ballooning technique, it was possible to release memory from one guest to another. For instance, in a RHEL 7 Server with KVM, memory in a guest machine could be scaled up from 512 MB to 4000 GB .
Adding more resources for increasing the processing power, often helps to improve performance. But adding too much resources without proper capacity planning can lead to wastage. Based on hardware specifications and customer requirements, we compiled a capacity plan to allot resources among pools of VMs and managed them using KVM hypervisor.
2. High performance
Virtualization always come with a slight performance overhead due to hardware emulation and running another OS on top. Performance metrics compiled by Standard Performance Evaluation Corp. ( SPEC®) , showed that KVM gave a better performance than VMware in the same category. Even after spinning out a number of VMs to achieve high-density, we could find that the KVM hypervisor performed without any bottle-necks.
Using the clustering technology, we grouped virtual servers into clusters. Resources were allocated to each cluster and managed among VMs in a cluster. This design helped us to ensure high uptime for applications and data. For instance, when one VM went down, we could easily off-load its data and applications to other VMs in the cluster.
To maintain a stable virtual environment, we limited user accounts to a certain number of transactions per second. We implemented Quality of Service (QoS) to ensure that a single account didn’t use up all the resources in the server. We configured QoS for I/O, network and CPU, by making use of Linux control groups feature in KVM. This ensured that every account got their fair share.
3. Support for guest OS
To cater to different business application requirements, our server virtualization had to run multiple virtual machines for both Linux or Windows images. Though based on Linux, KVM provides support for both Linux and Windows guests using para-virtualization. We installed and configured different OS in VMs based on their hosting plan.
We then created and managed templates of these VMs for fast deployment. These templates have pre-configured OS and applications customized for different businesses such as WordPress hosting, Photo hosting, Email services, etc. By creating templates for the most common businesses and all hosting plans, we could reduce the time taken for provisioning and setup of VPS instances.
4. Security considerations
With different user businesses running on each guest, security of the VMs was a major concern for us. As KVM was built on top of Linux kernel, it used Security Enhanced Linux (SELinux) feature to ensure access control in the VMs. We configured custom firewall rules in the VMs to ensure isolation between multiple tenants in our virtualized environment.
In this post we discussed how we used features of KVM and oVirt to configure a feature-rich and affordable design for hosting SMBs. We configured capacity plan, QoS, clustering, templates and custom firewalls to implement high performance, easy scalability, fast deployment and security in our design.
Server virtualization systems based on open source solutions such as KVM, is now used extensively in production environments, and proven to be stable and efficient. But many SMBs are hesitant to choose open source technologies because of lack of product support and complexity in the initial setup. Bobcares helps such businesses by designing, deploying, customizing and maintaining a virtualized infrastructure that is custom tailored to meet their goals.
- 2015 State of Virtualization and Storage Management survey by ActualMedia
- IBM’s pricing calculations of KVM Vs VMware
- KVM resource limits
- SPEC® performance matrix