I’ve been on the hunt for a hobby dedicated server for a terraform project, where I’m intending to use the libvirt provider and found one awesome provider that offers amazingly great prices.
At oneprovider.com, they offer dedicated servers for great prices and they offer a huge number of locations. So I decided to give them a go and ordered a dedicated server in Amsterdam, Netherlands:
I went for a 4GB DDR3 RAM, Atom C2350 2 Cores CPU with 128GB SSD and 1Gbps unmetered bandwidth for $7.30 a month, which is super cheap and more than enough for a hobby project:
I’ve been using them for the last week and super impressed.
What are we doing
As part of my Terraform project, I would like to experiment with the libvirt provisioner to provision KVM instances, I need a dedicated server with KVM installed, and in this guide we will install KVM and create a dedicated user that we will use with Terraform.
Once your server is provisioned, SSH to your dedicated server and install
cpu-checker to ensure that we are able to install KVM:
1 2 3
On a client pc, generate the SSH key that we will use to authenticate with on our KVM host:
Back on the server, create the user and prepare the ssh directory:
1 2 3
On the client PC where you generated your SSH key, copy the public key:
Paste your public key to the servers authorized_keys file:
Update the content below with the correct permissions:
1 2 3
Install KVM on the host:
Add our dedicated user to the libvirt group:
Create the directory where we will store our vm’s disks:
And apply ownership permissions for our user and group:
I ran into a permission denied issue using terraform and the dedicated user, and to resolve I had to ensure that the
security_driver is set to
and update the following:
Then restart libvirtd:
Switch to the
And list domains using
1 2 3
That’s it, now we have a KVM host that allows us to provision VM’s. In the next post we will install terraform and the libvirt provisioner for terraform to provision a vm and use ansible to deploy software to our vm.