1 | ========================================= |
---|
2 | opennebula Debian package |
---|
3 | ========================================= |
---|
4 | |
---|
5 | initial setup |
---|
6 | ----------------------------------------- |
---|
7 | |
---|
8 | 'opennebula' Debian package contains OpenNebula Controller which will |
---|
9 | manage all nodes from your cloud. After installation of this package, |
---|
10 | OpenNebula daemon is not ready to startup and will print: |
---|
11 | ------------------- |
---|
12 | You should have ONE_AUTH set the first time you start |
---|
13 | OpenNebula as it is used to set the credentials for |
---|
14 | the adminitrator user. |
---|
15 | ------------------- |
---|
16 | |
---|
17 | You have to choose an password for internal oneadmin OpenNebula user |
---|
18 | (ie. != from opennebula account). |
---|
19 | |
---|
20 | root@controller> su - oneadmin |
---|
21 | oneadmin@controller> vi $HOME/.one/one_auth |
---|
22 | ------------------- |
---|
23 | oneadmin:<password> |
---|
24 | ------------------- |
---|
25 | |
---|
26 | You can then start OpenNebula daemon and scheduler by issuing : |
---|
27 | |
---|
28 | root@controller> /etc/init.d/opennebula start |
---|
29 | |
---|
30 | |
---|
31 | Add a new host (node) in OpenNebula pool |
---|
32 | ----------------------------------------- |
---|
33 | |
---|
34 | 1. Install 'opennebula-node' debian package in destination host |
---|
35 | |
---|
36 | root@node01> apt-get install opennebula-node |
---|
37 | |
---|
38 | 2. Copy controller ssh key to node01 |
---|
39 | |
---|
40 | root@controller> su - oneadmin |
---|
41 | oneadmin@controller> cat $HOME/.ssh/id_rsa.pub |
---|
42 | <COPY YOUR CONTROLLER SSH PUBKEY> |
---|
43 | |
---|
44 | root@node01> su - oneadmin |
---|
45 | oneadmin@node01> vi $HOME/.ssh/authorized_keys |
---|
46 | <PAST YOUR CONTROLLER SSH PUBKEY> |
---|
47 | |
---|
48 | 3. Test an connection from controller to node01 |
---|
49 | |
---|
50 | root@controller> su - oneadmin |
---|
51 | oneadmin@controller> ssh oneadmin@node01 |
---|
52 | The authenticity of host 'node01 (192.168.0.2)' can't be established. |
---|
53 | RSA key fingerprint is []. |
---|
54 | Are you sure you want to continue connecting (yes/no)? [yes] |
---|
55 | Warning: Permanently added 'node01,192.168.0.2' (RSA) to the list of known hosts. |
---|
56 | oneadmin@node01> |
---|
57 | |
---|
58 | 4. Add this host into OpenNebula pool |
---|
59 | |
---|
60 | oneadmin@controller> onehost add node01 im_kvm vmm_kvm tm_ssh |
---|
61 | |
---|
62 | 5. Check node registration on controller |
---|
63 | |
---|
64 | oneadmin@controller> onehost list |
---|
65 | ID NAME CLUSTER RVM TCPU FCPU ACPU TMEM FMEM STAT |
---|
66 | 0 node01 default 0 400 388 400 3.9G 2.5G on |
---|
67 | |
---|
68 | |
---|
69 | Sample setup |
---|
70 | ----------------------------------------- |
---|
71 | Here is a sample setup which is adapted from |
---|
72 | <http://www.opennebula.org/documentation:rel2.0:vmg> |
---|
73 | It's based on a simple and small image of TTYLinux <http://minimalinux.org/ttylinux/> |
---|
74 | |
---|
75 | Download a tarball from OpenNebula project : |
---|
76 | |
---|
77 | oneadmin@controller> cd |
---|
78 | oneadmin@controller> mkdir one-templates |
---|
79 | oneadmin@controller> cd one-templates |
---|
80 | oneadmin@controller> wget http://dev.opennebula.org/attachments/download/170/ttylinux.tar.gz |
---|
81 | oneadmin@controller> tar xvzf ttylinux.tar.gz |
---|
82 | |
---|
83 | Then, create a first virtual network (using virbr0 as bridge by default) : |
---|
84 | |
---|
85 | oneadmin@controller> vi small_network.net |
---|
86 | ------------------- |
---|
87 | NAME = "Small network" |
---|
88 | TYPE = FIXED |
---|
89 | # virbr0 = bridge device used by libvirt /etc/libvirt/qemu/networks/default.xml |
---|
90 | BRIDGE = virbr0 |
---|
91 | LEASES = [ IP="192.168.122.2"] |
---|
92 | ------------------- |
---|
93 | oneadmin@controller> onevnet create small_network.net |
---|
94 | oneadmin@controller> onevnet list |
---|
95 | ID USER NAME TYPE BRIDGE P #LEASES |
---|
96 | 0 oneadmin Small network Fixed virbr0 N 0 |
---|
97 | |
---|
98 | Finally, you can create the template configuration for this small VM : |
---|
99 | |
---|
100 | oneadmin@controller> vi ttylinux.one |
---|
101 | ------------------- |
---|
102 | NAME = ttylinux |
---|
103 | CPU = 0.1 |
---|
104 | MEMORY = 64 |
---|
105 | DISK = [ |
---|
106 | source = "/var/lib/one/one-templates/ttylinux.img", |
---|
107 | target = "hda", |
---|
108 | readonly = "no" ] |
---|
109 | NIC = [ NETWORK = "Small network" ] |
---|
110 | ------------------- |
---|
111 | oneadmin@controller> onevm create ttylinux.one |
---|
112 | |
---|
113 | VM has been autostarted and deployed on one of your host. |
---|
114 | You can SSH to it (login is root and password is password) : |
---|
115 | |
---|
116 | oneadmin@controller> onevm show ttylinux|grep IP |
---|
117 | IP=192.168.122.2 |
---|
118 | oneadmin@controller> ssh root@192.168.122.2 |
---|
119 | |
---|