Showing posts with label virtualisation. Show all posts
Showing posts with label virtualisation. Show all posts

Monday, 20 July 2015

Hypervisor Build on MicroServer - Part 2

So I'm assuming you've read the first part and also set up the RAID 5 array

We're going to be using logical volumes & LVM on our RAID 5 array for the storage of the virtual guests
# pvcreate /dev/md0
Physical volume "/dev/md0" successfully created
# vgcreate vg_guests /dev/md0
Volume group "vg_guests" successfully created
Also create a volume to hold the ISOs for building the guests
# lvcreate -L 25G vg_guests -n lv_isos
# mkfs.ext4 /dev/vg_guests/lv_isos

Auto-mount it in /etc/fstab
/dev/mapper/vg_guests-lv_isos /isos ext4 defaults 0 2
Mount and set permissions so 'paul' can upload ISOs directly to it
# mount /isos
# chmod 755 /isos
# chgrp paul /isos


Finally upload some ISOs...

Using virt-manager, connect to the local QEMU
  • Remove the virtual network created inside the Virtual Network tab ; we'll be using my home lan for the guests
  • Add a storage pool for the ISOs so they are available to the guests for mounting
    • Name: ISOs
    • Type: dir Filesystem Directory
    • Target Path: /isos
  • Add a storage pool for the RAID 5 LVM array to hold the virtual guest storage
    • Name: Guests
    • Type: logical: LVM Volume Group
    • Target Path: /dev/vg_guests
    • Source Name: vg_guests

So now we're set up, here's a run through of creating a typical guest:

Before getting into virt-manager create a logical volume for the storage, eg:
# lvcreate -L 10G vg_guests -n lv_myguestname


Now from within virt-manager:
  • Give it a name
  • Use Local install media / Use ISO image / Select an ISO from your ISO storage pool
  • Set OS type & version, set applicable RAM & CPU
  • Select managed or other existing storage & pick your newly created logical volume from the Guests storage pool.
  • You'll notice no networking is available. This is fine just make sure to tick the 'Customize configuration before install' box and this can be added next.
  • Add Hardware and select Network -  Host device eth0: macvtap
  • Select the newly created NIC and make sure source mode is set to Bridge otherwise the interface will not work.

Now hit 'Begin Installation' and install your lovely new guest.

Once built, if it's a Linux guest, configure the virtual serial port as detailed here so console access is via the command line rather than virt-manager.

A point to note about macvtap interfaces. They do not allow guest to hypervisor communication. Guest to guest is fine as is guest to rest of LAN. If you need to communicate with a guest from the hypervisor or vice versa you will need to create bridged interfaces and use those.



Saturday, 27 June 2015

My Virtual Baby Gets A Sibling

You may have seen my earlier post about how I'm finally getting around to doing something with my HP Microserver.

Typical!! No sooner do I start working on it than another great deal comes out for the newer Gen 8 model. Priced at £179 with an £80 cashback promo it was to good a deal to miss. So for the princely sum of £99 the virtual baby now looks like this.



I've transplanted the disks and memory from the old model into this one and will be configuring it up as previously described.

So why did I go for this newer model?
  • Faster Intel processor rather than AMD
  • Built in HP ILO for remote management.
  • Faster SATA controller (6Gb rather than 3Gb albeit only on first 2 disks)
  • It looks sexier, gotta love that blue led strip at the bottom
  • Because I can!!
There are some upgraded features; USB 3 sockets, 2 NICs, easier access to internals but they're less important to me at the moment.

So did I really need to do this? For what I'm going to be using it for, of course not! But for the price how could I say no.



Sunday, 7 June 2015

My New Virtual Baby



I bought one of these little HP MicroServers last year on a cashback promo deal. I've spent a few months fiddling around with it and researching how best to set it up. So here's my thoughts and details of my final configuration.

The server (model N54L)  cost £119 after cashback and came with 4GB memory and no disks.
I bought an extra 4GB on EBay (£44) and a couple of  Western Digital 2TB green hard drives (£57 each) from Amazon.

What do I want to do with it?

My intention was to configure it as a virtualisation host and have a guest running my Logitech Media Server, allowing me to get rid of an ageing Windows PC currently doing this. Further guests could be spun up for other functions I may want in the future.

Performance isn't a key factor for this given what I'm using it for and as I intend to run the guests on Linux the AMD processor seems fine. I did want resilient storage to guard against drive failure and a low power consumption given the machine will be on for long periods of time. The small physical footprint and low noise level is a bonus too.

What configuration to go with, how about vSphere?

First thoughts were to go with a VMware vSphere solution. A basic free version is available with limits on the physical hardware and missing lots of enterprise features, not a problem for this though. The great thing with this is it can run as a bare metal hypervisor and as the server has a bootable internal USB socket I installed it to a USB stick. This means all your disk space is available for your guests.

The MicroServer is a supported configuration and, having used vSphere and Workstation before, it was easy to set up. This would have been a great solution had it not been for a few gotchas.
  • Didn't like having to use the vSphere client to configure it. It's Windows only and also deprecated and doesn't have all the available functionality in it. VMware want you to run vCenter which is WebGui based (yay!) but would consume precious hardware resources as it would run as an additional guest (boo!). Oh yes, and it costs money!!
  • The hypervisor doesn't recognise the internal RAID controller (it's one of those nasty fake ones). Although you can join disks together within vSphere to make a large guest storage pool it can't be made resilient.

 

Hmm, okay - how about something Linux-like?

Being a bit of a RHEL fan I thought how about trying their virtualisation product RHEV, or rather the upstream open source version oVirt. This is based around Linux's kvm virtualisation technology.
Ok so this is a bit trickier to set up but I am familiar with it and am even certified in it (click if you don't believe me)
You can't really do this one on a USB stick so added an additional smaller hard drive I had lying around, installed Centos 6 and put oVirt on top of that. This would leave the other drives for guest storage.

So I quite liked this solution. Based around RHEL / kvm which is great (and totally free) and the administration is done through a web gui. Although I didn't try this bit out I would be able to make use of LVM and Linux RAID to create resilient and extendable storage for the guests. These both play very well with kvm and I have experience from work (and did I mention my awesome certifications haha!)

In the end though I abandoned this solution mainly due to the performance overhead of having to run the oVirt management engine and using an extra disk slot to host the hypervisor. Don't get me wrong oVirt gives you a lot but is really more designed for the enterprise environment. It's what the E stands for in RHEV after all.


And so the winner is?

In the end I've gone with a bit of a hybrid solution that takes the best of both worlds. There will be blog posts to follow on how I set this all up but here's the solution in a nutshell.
  • Centos 6 minimal installation onto a USB stick, booted from the internal USB port.
  • Add virtualisation packages to provide kvm virtualisation
  • Use software raid (mdadm) to create a RAID 5 volume. With only 2 disks I hear you say? Yes, I added the 3rd disk later. Thank you Awesome William Matley for the idea.
  • Use LVM on the RAID 5 volume to provision logical volumes to host each guest. These can be easily extended, cloned and backed up.
  • Administration via ssh and the virsh CLI or virt-manager for the GUI (via X tunnelling). Remote administration via port forwarding on the router.

 So there you have, well done for reading this far. A pretty good virtualisation solution for not a lot of money even if I do say so myself!!