Aug 13, 2014

Automatically assign an IP address to a newly created linux VM guest

So you've created your all new VM guest, uploaded it's image, attached it to a template and started your VM. OpenNebula tells you that the VM has an IP address from your virtual network, but sadly you neither can access the VM via this address, nor is the interface in your linux host configured with the settings from your virtual network.

The solution for this problem is quite easy, install the package one-context:

  1. Download the correct version matching your Linux guest OS's package manager and your OpenNebula version from here: http://dev.opennebula.org/projects/opennebula/files
  2. Install the package in your guest VM
  3. Reboot your guest VM and voila your network is configured

Pro-Tip: Do this before you upload your VM image to OpenNebula


Resolving network issues in OpenNebula / KVM

As we started out running the first VMs with OpenNebula / KVM on Ubuntu Server, we encountered strange network lags. These lags showed up as unresponsive SSH sessions or lagging RDP sessions on Windows hosts.

Finally I found out how to resolve this (at least for us). The solution is to use the RedHat VirtI/O drivers for the network cards.

In OpenNebula, when creating a new template, key in "virtio" in the model field of your network settings:
This enables the virtio driver for the VMs instantiated from that template.

To enbale the driver in Linux / Windows hosts, you need to do different things:

Linux

Easy, you're done ;-) No really, the driver is automatically activated

Windows

  1. Get the latest Windows virtI/O drivers from here: http://www.linux-kvm.org/page/WindowsGuestDrivers/Download_Drivers
  2. Create a new Image from the .iso file located in the downloaded zip from above. Select type CD-ROM.
  3. Attach this image to your template or your VM
  4. RDP into your VM
  5. Check your System Manager in System Settings, their should be an Ethernet device without proper driver (yellow quotation mark attached). Select this device and select to update the driver. When asked select "Choose manually from computer" and browse to the appropriate folder (64bit or 32bit) on the CD-Rom drive in your file explorer.
  6. Install the driver
  7. (Optional) You may want to repeat these steps in case you have other devices with yellow marks on them.

Installing UbuntuServer, KVM and OpenNebula on Mac Pro Cylinder

Here's the How-To for installing the full stack on a Mac Pro Cylinder (2013, latest):

Install Ubuntu on Mac Pro Cylinder

Pre-Requisites: A bootable USB stick or CD-Rom with UbuntuServer 14.04 on it
  1. Boot into OS X
  2. Use the Disk Utility to decrease the size of your main partition (Here's how: OS X Daily). We kept 40 GB for OS X, but that's not a necessity
  3. Download rEFInd from here: http://sourceforge.net/projects/refind/files/0.8.3/refind-bin-0.8.3.zip/download
  4. Unzip in OS X and run install.sh from terminal
  5. Plug in your bootable USB stick
  6. Reboot the Mac
  7. From the rEFInd menu, select to boot from your USB stick
  8. Select Install Ubuntu
  9. When asked manually partition your HDD to feature a swap drive and a main drive. 
  10. When asked which packages to install, select "OpenSSH Server" and "Virtual Machine Host"
  11. Finish installation
  12. Reboot and select to boot into Recovery mode
  13. From the root console install fglrx graphics drivers by issueing the command "apt-get install fglrx"
  14. Reboot into regular Ubuntu. The system should now start up as expected
 Install OpenNebula on Mac Pro Cylinder

Now you've already got KVM and libvirt installed with your Ubuntu Server distribution. The next step is to install OpenNebula and to set it up for libvirt and KVM:

Actually OpenNebula's documentation features an excellent guide on how to set one host up to serve the OpenNebula frontend and to act as a VM host at the same time. Here it is: http://docs.opennebula.org/4.8/design_and_installation/quick_starts/qs_ubuntu_kvm.html