CrownCloud Wiki

CrownCloud - Internet Services

User Tools

Site Tools


kvm_tips

KVM Tips

Running a KVM based VPS is more or less like running a computer or a dedicated server running Linux, a KVM based VPS runs its own kernel unlike OpenVZ. The possibilities to configure and run your KVM based VPS are infinite, you can run literally any operating system and kernel (yes! you can compile latest kernels and run them as well).

There are a few things to keep in mind though when running a KVM based VPS, which we've listed below.

Keeping your OS upto date always

Keeping your OS upto date is always a good thing, on KVM or OpenVZ. But since your KVM VPS runs it's own kernel it's far more important to keep it's kernel too upto date. Updating your operating system takes a few minutes to do and should be done regularly.

  • If on CentOS/any RHEL based OS:
    • yum update (if on CentOS/any RHEL based OS)
  • If on Debian/Ubuntu:
    • apt-get update && apt-get dist-upgrade (or sudo apt-get update && sudo apt-get dist-upgrade)

Note: A reboot of the VPS is required after updating the kernel, to boot into the new kernel.

Ensuring your OS is not EOL

EOL stands for End-of-life, this is when your software provider/maintainer doesn't provide any more updates or security fixes for your operating system.

For example, running Ubuntu 13.10 on your VPS might seem like it's new but it's End-of-life and no longer supported by Ubuntu. https://wiki.ubuntu.com/Releases

Running a end-of-life/EOL operating system can cause a good amount of issues, both security wise and stability wise. Security wise you may not get latest fixes to kernels and other key parts of your operating system installed and stability wise running a old kernel is going to cause issues for sure.

The older your operating system gets without having ran any updates, the higher chances of it crashing and causing security related issues as well.

For Ubuntu/Debian you can easily upgrade to newer versions, guides for this can be found easily by looking up on Google.

For CentOS you'll need to reinstall up your operating system if upgrading from CentOS 4 to CentOS 5 or from CentOS 5 to CentOS 6. Though upgrading from CentOS 6 to CentOS 7 has a easy upgrade possibility (like how Ubuntu/Debian has) it hasn't been tested by us yet.

Configuring up swappiness

Swappiness is a neat utility on Linux which helps you set a % after which Linux starts to swap out, usually this value is set to 60% which means that your VPS starts to swap out as soon as it touches 60% of it's RAM usage. This is set by default on Linux and can be a cause of a slow running VPS as well. We advise setting it to a higher value like 80% to ensure that more RAM is used and less Swap, since RAM is much much faster than writing on Swap space.

More on this topic:

Different network adapters

From your VPS control panel you'll notice many different network adapters, Realtek, Intel and VirtIO.

Realtek is the default network adapter since it's supported by most operating systems, but it's limited to 100 Mbit/sec by Realtek which can be an issue when running on our 1 Gbit/sec network.

Intel is the next network adapter which has the most compatibility and works on literally all the operating systems, this adapter can easily use upto 1 Gbit/sec and is the best option.

VirtIO works best on CentOS/RHEL based operating systems, we haven't seen much success running it on Windows, Ubuntu/Debian.

Network adapter Speed Recommended Operating system
Realtek 8139 100 Mbit/sec Any operating system
Intel PRO/1000 1 Gbit/sec Any operating system
VirtIO 1 Gbit/sec CentOS/Fedora/RHEL based OS

Note: Windows needs VirtIO drivers installed prior to using VirtIO as the network driver, if VirtIO network drivers aren't installed Windows will fail to connect to the network, We recommend using Intel Pro/1000 for best performance on Windows. Intel Pro/1000 requires no additional drivers and works right out-of-the-box.

Installing via ISO/CD-ROM

Installing your operating system via ISO/CD-ROM is the best way to begin, this ensures that you get the latest packages and only the packages you want are installed on your VPS. We utilize netinstall ISOs for all our CD-ROM templates where possible which allows you to select the packages you want so you get the most minimal install which keeps your system quick and ensures least RAM usage as well.

  • Sometimes when installing your VPS might randomly turn off, turn off “ACPI”, reboot your VPS from the VPS control panel and re-try the install and it'll work.
  • Unmount the ISO from your VPS once the install has completed, this ensures that you don't boot into the ISO by mistake
  • Change the boot order to “Hard Disk Only” once done with your install.

Using VNC

Access to VNC is provided with all our KVM based VPSes, VNC allows you to access your VPSes monitor/out-of-band like. Which allows you to see / access your VPS if it were like your monitors output from your computer at home, this is very helpful for keeping an eye on your VPSes bootup, logging into your VPS on bootup if it has a encrypted disk, checking for errors on the console (also can be checked via SSH under dmesg) etc

  • It is advisable to use the VNC from the VPS control panel at https://panel.crowncloud.net/ / http://panel.crowncloud.net/
  • We'd advise using the HTML5 based VNC but in the case that it does not work (this happens if your network provider is blocking certain ports) then use the Java based VNC.

Different Disk drivers

From your VPS control panel you'll notice 2 types of disk driver options, IDE and VirtIO.

IDE is the default disk driver since it's supported by literally every operating system, but disk performance on it is limited and further limited if using Windows.

VirtIO is the default disk driver we use for Linux based OS (CentOS/Ubuntu/Debian etc) template installs (via the Reinstall button). VirtIO can be selected from the panel before installing your VPS via ISO to make sure your VPS reads/sets the disk labels correct (VirtIO uses vda/vdX instead of sda/sdX used by IDE). Remember to reboot your VPS once you've enabled VirtIO before starting your install.

We recommend using VirtIO if your VPS runs Windows, VirtIO helps a lot with disk related performance thus leading to a much faster system in general.

VirtIO can be enabled after install as well but this requires you to rename your disk drives under fstab to vda/vdb etc, we recommended only advanced users trying this since it can cause your VPS to stop booting.

Few guides relating to this sub-topic:

Configuring network

All KVM VPSes by default use DHCP to get it's IP address(es). Although, in some cases if your VPS does not get the IP address via DHCP, you can hit “Reconfigure Networking” from the VPS control panel (https://panel.crowncloud.net), do note, this will work only on Linux based VPSes.

For Windows, you'd have to configure the network manually from “Open Network and Sharing Center” like you would on a normal PC at home. But in 99% of the cases, DHCP will work for Windows as well.

Crashing?

KVM VPSes are as close to dedicated servers / bare-metal as it gets. Each KVM based VPS runs it's own kernel and it's own system/software stack. KVM VPSes crashing can be related/originating from a multitude of things but worry not, most of the cases the source of the crashes can be related to the following,

  • Out of memory related crashes (Linux/Windows)
  • Out of disk space related crashes (Linux/Windows)
  • Kernel related errors/crashes (Linux)
dmesg (display message or driver message) is a command on most Unix-like operating systems that prints the message buffer of the kernel.

Most of these errors are easy to find from dmesg logs, these logs can be found by typing the following in your terminal window. (on Linux):

dmesg

dmesg will get you a large output of more than 100 - 200 lines, you can copy the output of dmesg to a share-able link via this command:

dmesg | curl -F 'sprunge=<-' http://sprunge.us

and then paste the output which will be a URL in a support ticket and we'll help you from there.

kvm_tips.txt · Last modified: 2016/01/24 13:39 by speedbus