Powered by SmartDoc
ENGLISHJAPANESE

KVM Node -- Cloud Computing -- (2010/08/21)
Ver. 1.0

2010/08/22
Shun-ichi KURINO
kurino@math.cst.nihon-u.ac.jp
http://edu-gw2.math.cst.nihon-u.ac.jp/~kurino/2010/sydney/sydney.html
Activitiy in Sydneyof Cloud Computing Making of KVM Node

Table of contents

Background

And for work sharing, CJ work on VMWare node, and I work on KVM for comparison. We made main node (cloud-core) together.

Setup KVM Node

This is working log for Buliding KVM Node on Ubuntu 10.4 for ViSLAB Cloud ( I called it ).

Reference

(sorry japanese page only)

Preparation

Hardware

Working ID

Sharing Modified Files

On this setup, we need to modify some files. Of course, by using editor ( like a vi, emacs, etc..), we can do it. But more easy style is copy it from modified file of setuped node. I put modified files in cloud-core:/var/nfs_share/wrapper.

nfs setup

apt-get setup

(It is depents on ViSLAB Network Environment)

Set http_proxy

For proxy access to Web, you must set a http proxy server to "http_proxy" environment variable. This information are in /mnt/wrapper/.bashrc, so we get it.

cloud-node-006:~# mv /root/.bashrc /root/.bashrc.ORIG
cloud-node-006:~# cp /mnt/wrapper/.bashrc /root/.bashrc
cloud-node-006:~# . /root/.bashrc

Using mirror.aarnet.edu.au

Next, we refer ubuntu distributer site (mirror.aarnet.edu.au) for access newest ubuntu packages. This information is in /mnt/wrapper/sources.list.

cloud-node-006:~# mv /etc/apt/sources.list /etc/apt/sources.list.ORIG 
cloud-node-006:~# cp /mnt/wrapper/sources.list /etc/apt

update all pacakage

Then We can update our server. So do it first.

cloud-node-006:~# apt-get update
cloud-node-006:~# apt-get upgrade

CPU Check

We check CPU capability.

cloud-node-006:~# egrep '(vmx|svm)' /proc/cpuinfo

There is no outputs. It means that this CPU does not suport "Virtualization Technology". Alread I know it. Becouse, one of object of this article is using KVM without VT.

Package Install

KVM package

cloud-node-006:~# apt-get install kvm libvirt-bin

OpenNebula Node package

cloud-node-006:~# apt-get install opennebula-node

Remove apparmor package

We need to remove apparmor package.

cloud-node-006:~# apt-get remove apparmor

if it exists then I can not create vm. why ? I don't know..

Network Configuration

We made bridge network for KVM. It's mean that VM join in same network of node's network (192.168.0.0/16). IP address is provde to VM by OpenNebula frontend.

Modify interface file

Modify /etc/network/interface.

cloud-node-006:~# vi /etc/network/interface.

or

cloud-node-006:~# cp /mnt/wraper/interface /etc/network/interface

Restart Network

For active new configuration to node, restart network.

cloud-node-006:~# /etc/init.d/networking restart

CAUTION : ssh connection will be disconnect. So you must login again, if you operation with ssh.

Virtual Host Working Directory

Make new directory (/usr/local/opennebula) in which VM files are copied.

cloud-node-006:~# mkdir -p /usr/local/opennebula
cloud-node-006:~# chown oneadmin /usr/local/opennebula

Because "ONE_LOCATION=/usr/local/opennebula" in oneadmin@Cloud-Core. Usually, It is not need. ONE_LOCATION is unset, and default directory ("/var/lib/one") has been made by opennebula-node package.

Add New Nodes

Add new Node to Cloud-Core

CAUTION : Those works do at oneadmin@Cloud-Core

Append public key to authorized_keys

CAUTION : Those works do at oneadmin@cloud-node-006

oneadmin@cloud-node-006:~$ cat /mnt/warpper/id_rsa.pub >> ~/.ssh/authorized_keys

Then, oneadmin@Cloud-Core can ssh login to oneadmin@cloud-node-006 without password.

Wrapping

CAUTION : Those works do at root@cloud-node-006 again. I do not know, but if use following warpper, then it work..

/usr/bin/virsh

cloud-node-006:~# mv /usr/bin/virsh to /usr/bin/virsh.ORIG
cloud-node-006:~# cp /mnt/wrapper/virsh /usr/bin
cloud-node-006:~# chmod a+x /usr/bin/virsh

This virsh wrapper makes log file in /tmp/virsh.log.

/usr/bin/kvm

cloud-node-006:~# mv /usr/bin/virsh to /usr/bin/kvm.ORIG
cloud-node-006:~# cp /mnt/wrapper/kvm /usr/bin
cloud-node-006:~# chmod a+x /usr/bin/kvm

This kvm/qemu wrapper makes log file in /tmp/vm.log.

/usr/bin/qemu

cloud-node-006:~# mv /usr/bin/virsh to /usr/bin/qemu.ORIG
cloud-node-006:~# ln /usr/bin/kvm /usr/bin/qemu

qemu is same file kvm.

start libvirt-bin service

libvirt-bin service do not auto start ( see : reason ). so I must start this service after rebooting...

cloud-node-006:~# service libvirt-bin start