[one-users] Problems Creating an Ubuntu Based Virtual Machine
Malicious Scientist
scientist.malicious at gmail.com
Wed Oct 31 13:38:17 PDT 2012
Hello Community,
I am performing a fresh install of OpenNebula 3 on Ubuntu 12.04.1 for
testing and learning purposes. I'm using the distro packages. I think the
installation is OK, the problem are the configuration files for the images,
networks, virtual machines, etc. I want to use a qcow2 image of Ubuntu
created by ubuntu-vm-builder. Is it possible? I'll repeat the steps that I
took for the sake of completeness.
I'm using Ubuntu 12.04.1. For this testbed, I'm using a single machine that
will act as the controller and single host. The network bridge is
configured properly like this:
auto br0
iface br0 inet static
address 192.168.1.50
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameserver 8.8.8.8
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
As you can see, it's a local network installation. I installed the
OpenNebula packages with apt-get:
root at netune:~# apt-get install opennebula opennebula-node opennebula-tools
opennebula-common
Now as 'oneadmin', I added 'netune' (my machine) as the sole host:
oneadmin at netune:~$ onehost create netune im_kvm vmm_kvm tm_ssh dummy
ID: 5
oneadmin at netune:~$ onehost list
ID NAME RVM TCPU FCPU ACPU TMEM FMEM AMEM STAT
5 netune 0 200 173 200 1.9G 596.6M 1.9G on
I also configured SSH to allow login without password. After that, I
created a virtual network:
oneadmin at netune:~$ cat vnet01.template
NAME = "LAN"
TYPE = FIXED
BRIDGE = br0
LEASES = [IP=192.168.1.246]
LEASES = [IP=192.168.1.247]
LEASES = [IP=192.168.1.248]
oneadmin at netune:~$ onevnet create vnet01.template
ID: 6
oneadmin at netune:~$ onevnet list
ID USER GROUP NAME TYPE BRIDGE LEASES
6 oneadmin oneadmin LAN F br0 0
Now, the creation of the OS image. As I mentioned before, I used the
ubuntu-vm-builder command:
root at netune:~# ubuntu-vm-builder kvm precise --domain ubuntuvirtual --dest
ubuntuvirtual --arch amd64 --hostname ubuntuvirtual --mem 256 --user storm
--pass storm --ip 192.168.1.246 --mask 255.255.255.0 --net 192.168.1.0
--bcast 192.168.1.255 --gw 192.168.1.1 --dns 8.8.8.8 --mirror
http://ubuntu-archive.locaweb.com.br/ubuntu --components main,universe
--addpkg acpid --addpkg vim --addpkg openssh-server --addpkg avahi-daemon
--libvirt qemu:///system ;
(lots of output)
root at netune:~# ls ubuntuvirtual/
tmpfpcs0v.qcow2
root at netune:~# cp ubuntuvirtual/tmpfpcs0v.qcow2 /tmp/ubuntuvirtual.qcow2
root at netune:~# ls -l /tmp/ubuntuvirtual.qcow2
-rw-r--r-- 1 root root 627834880 Out 31 16:35 /tmp/ubuntuvirtual.qcow2
Executing 'kvm /tmp/ubuntuvirtual.qcow2' brings the virtual machine up with
kvm, all the configuration passed as parameters for ubuntu-vm-builder are
built into the image. After that, I registered the image for OpenNebula:
oneadmin at netune:~$ cat image01.template
NAME = "Ubuntu"
PATH = /tmp/ubuntuvirtual.qcow2
TYPE = OS
PUBLIC = YES
DESCRIPTION = "Ubuntu basic installation"
oneadmin at netune:~$ oneimage create image01.template
ID: 0
oneadmin at netune:~$ oneimage list
ID USER GROUP NAME SIZE TYPE REGTIME PER STAT
RVMS
0 oneadmin oneadmin Ubuntu 0M OS 10/31 16:45:01 No
lock 0
With the network and image set, I created the virtual machine:
oneadmin at netune:~$ cat vm01.template
NAME = ubuntu
MEMORY = 256
CPU = 0.1
DISK = [ IMAGE_ID = 0 ]
DISK = [
TYPE = swap,
SIZE = 1024 ]
NIC = [ NETWORK_ID = 6, IP = 192.168.1.246 ]
GRAPHICS = [
TYPE = "vnc",
LISTEN = "0.0.0.0" ]
oneadmin at netune:~$ onevm create vm01.template
ID: 12
oneadmin at netune:~$ onevm list
ID USER GROUP NAME STAT CPU MEM
HOSTNAME TIME
12 oneadmin oneadmin ubuntu runn 0 0K netune 00
00:03:14
The VM is running. But I cannot access through the network, it doesn't
answer icmp requests on the designed IP (192.168.1.246). I tried VNC using
virsh and vncviewer:
root at netune:~# virsh
virsh # list
Id Nome Estado
----------------------------------
1 one-12 executando
virsh # vncdisplay 1
:12
root at netune:~# vncviewer 127.0.0.1:12
The screen capture is on the link below. What I see is that the system does
not find a bootable device. The message is very clear: "No bootable
device."
http://tinypic.com/r/2uqoeia/6
Question:
1) Can I use a qcow2 image created like described above?
2) Is the file vm01.template correct?
Thanks for your attention.
[]'s
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20121031/37acfd4a/attachment.htm>
More information about the Users
mailing list