ENGLISH | JAPANESE |
And for work sharing, CJ work on VMWare node, and I work on KVM for comparison. We made main node (cloud-core) together.
This is working log for Buliding KVM Node on Ubuntu 10.4 for ViSLAB Cloud ( I called it ).
(sorry japanese page only)
Network : DHCP
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 client install.
cloud-node-006:~# apt-get install nfs-common
mount share area.
cloud-node-006:~# mount cloud-core:/var/nfs_share /mnt
You can access modified file from /mnt/warpper.
(It is depents on ViSLAB Network Environment)
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
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
Then We can update our server. So do it first.
cloud-node-006:~# apt-get update cloud-node-006:~# apt-get upgrade
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.
cloud-node-006:~# apt-get install kvm libvirt-bin
cloud-node-006:~# apt-get install opennebula-node
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..
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 /etc/network/interface.
cloud-node-006:~# vi /etc/network/interface.
or
cloud-node-006:~# cp /mnt/wraper/interface /etc/network/interface
auto eth0 iface eth0 inet dhcp
# auto eth0 # iface eth0 inet dhcp auto br0 iface br0 inet dhcp pre-up ifconfig eth0 down pre-up ifconfig eth0 0.0.0.0 promisc up pre-up brctl addbr br0 pre-up brctl addif br0 eth0 pre-up ifconfig eth0 up post-down ifconfig eth0 down post-down brctl delif br0 eth0
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.
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.
CAUTION : Those works do at oneadmin@Cloud-Core
append new node.
oneadmin@cloud-core:~$ onehost add cloud-node-006 im_kvm vmm_kvm tm_ssh
cloud-node-006 is KVM node, so "im_kvm", "vmm_kvm" and "tm_ssh" are selected.
Copy SSH's Public Key to new nodes.
oneadmin@cloud-core:~$ cp .ssh/id_rsa.pub /var/nfs_share/wrapper
But, It has been already do. So there are nothing to do.
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.
CAUTION : Those works do at root@cloud-node-006 again. I do not know, but if use following warpper, then it work..
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.
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.
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.
libvirt-bin service do not auto start ( see : reason ). so I must start this service after rebooting...
cloud-node-006:~# service libvirt-bin start