个人工具
119.28.94.63
该IP地址的讨论
登录
查看“UbuntuHelp:OpenNebula”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:OpenNebula”的源代码
来自Ubuntu中文
←
UbuntuHelp:OpenNebula
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/OpenNebula}} {{Languages|UbuntuHelp:OpenNebula}} == Description == [http://opennebula.org/ OpenNebula] is an open source virtual infrastructure engine that enables the dynamic deployment and re-placement of virtualized services (groups of interconnected virtual machines) within and across sites. [http://opennebula.org/ OpenNebula] extends the benefits of virtualization platforms from a single physical resource to a pool of resources, decoupling the server not only from the physical infrastructure but also from the physical location. {{http://opennebula.org/files/front-page.png}} [http://opennebula.org/ OpenNebula] can be primarily used as a virtualization tool to manage your virtual infrastructure in the data-center or cluster. This application is usually referred as private cloud, and with [http://opennebula.org/ OpenNebula] you can also dynamically scale it to multiple external clouds, so building a hybrid cloud. When combined with a Cloud interface, [http://opennebula.org/ OpenNebula] can be used as engine for public clouds, providing a scalable and dynamic management of the back-end infrastructure. So, do you want to transform your rigid and compartimentalized infrastructure, into a flexible and agile platform where you can dynamically deploy new services and adjust their capacity?. If the answer is yes, you want to build what is nowadays called a private cloud. == Setting up a Private Cloud in 5 steps == In this mini-howto, you will learn to setup such private cloud in 5 steps with Ubuntu and [http://opennebula.org/ OpenNebula] . We assume that your infrastructure follows a classical cluster-like architecture, with a front-end (cluster01, in the howto) and a set of worker nodes (cluster02 and cluster03). First you’ll need to add the following PPA if you are running Ubuntu 8.04 LTS (Hardy) or Ubuntu 8.10 (Intrepid), you should be fine if you are running Ubuntu 9.04 (Jaunty Jackalope): <pre><nowiki> deb http://ppa.launchpad.net/opennebula-ubuntu/ppa/ubuntu intrepid main </nowiki></pre> If everything is set up correctly you could see the OpenNebula packages: <pre><nowiki> $ apt-cache search opennebula libopennebula-dev - OpenNebula client library - Development libopennebula1 - OpenNebula client library - Runtime opennebula - OpenNebula controller opennebula-common - OpenNebula common files opennebula-node - OpenNebula node </nowiki></pre> OK, then. Here we go with the recipe: === Step 1 : Front-end installation === '''[Front-end (cluster01)]''' Install the opennebula package. As you may see from the output of the apt-get command performs several configuration steps: creates a oneadmin account, generates a rsa key pair, and starts the OpenNebula daemon: <pre><nowiki> $ sudo apt-get install opennebula Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: opennebula-common The following NEW packages will be installed: opennebula opennebula-common 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded. Need to get 280kB of archives. After this operation, 1352kB of additional disk space will be used. Do you want to continue [Y/n]? … Setting up opennebula-common (1.2-0ubuntu1~intrepid1) … … Adding system user `oneadmin’ (UID 107) … Adding new user `oneadmin’ (UID 107) with group `nogroup’ … Generating public/private rsa key pair. … Setting up opennebula (1.2-0ubuntu1~intrepid1) … oned and scheduler started </nowiki></pre> === Step 2 : Add the cluster nodes to the system === '''[Front-end (cluster01)]''' In this case, we’ll be using KVM and no shared storage. This simple configuration should work out-of-the-box with Ubuntu: <pre><nowiki> $ onehost add cluster02 im_kvm vmm_kvm tm_ssh Success! ... $ onehost add cluster03 im_kvm vmm_kvm tm_ssh Success! ... </nowiki></pre> === Step 3 : Configure ssh access === [Front-end (cluster01)] You need to add the cluster nodes to the known hosts list for the oneadmin user: <pre><nowiki> $ sudo -u oneadmin ssh cluster02 The authenticity of host 'cluster02 (192.168.16.2)' can't be established. RSA key fingerprint is 37:41:a5:0c:e0:64:cb:03:3d:ac:86:b3:44:68:5c:f9. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'cluster02,192.168.16.2' (RSA) to the list of known hosts. oneadmin@cluster02's password: </nowiki></pre> === Step 4 : Install the nodes === '''[Worker Node (cluster02,cluster03)]''' Install the OpenNebula Node package: <pre><nowiki> $ sudo apt-get install opennebula-node Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: opennebula-common The following NEW packages will be installed: opennebula-common opennebula-node ... Setting up opennebula-node (1.2-0ubuntu1~intrepid1) ... Adding user `oneadmin' to group `libvirtd' ... Adding user oneadmin to group libvirtd Done. </nowiki></pre> Note that oneadmin is also created at the nodes (no need for NIS here) and added to the libvirtd, so it can manage the VMs. === Step 5 : Setting authorization === '''[Worker Node (cluster02,cluster03)]''' Trust the oneadmin user at the ssh scope, just copy the command from the onehost output ;) : <pre><nowiki> $ sudo tee /var/lib/one/.ssh/authorized_keys << EOT > ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAm9n0E4bS9K8NUL2bWh4F78LZWDo8uj2VZiAeylJzct …7YPgr+Z4+lhOYPYMnZIzVArvbYzlc7HZxczGLzu+pu012a6Mv4McHtrzMqHw== oneadmin@cluster01 > EOT </nowiki></pre> You may want to check that you can login the cluster nodes from the front-end, using the oneadmin account without being asked for a password: <pre><nowiki> $ sudo -u oneadmin ssh cluster02 </nowiki></pre> You are done! You have your own cloud up and running! Now, you should be able to see your nodes ready to start VMs: <pre><nowiki> $ onehost list HID NAME RVM TCPU FCPU ACPU TMEM FMEM STAT 0 cluster02 0 100 100 100 963992 902768 on 1 cluster03 0 100 100 100 963992 907232 on </nowiki></pre> You may want to check the [http://opennebula.org/doku.php?id=documentation OpenNebula documentation|] for further information on configuring the system or to learn how to specify virtual machines. == How to launch a VM == First, you need to prepare a virtual network for our VM. Create a text file vmnet.template containing the following to create a virtual network with just one IP (change it accordingly to your LAN address): <pre><nowiki> NAME = "Private LAN" TYPE = FIXED BRIDGE = eth0 LEASES = [IP=130.10.0.1] </nowiki></pre> <pre><nowiki> $ onevnet create vmnet.template </nowiki></pre> You can verify the correct creation of the network using again the '''onevnet''' command, first listing all the available virtual networks with '''onevnet''' list and then showing details for the recently created virtual network with '''onevnet''' show: <pre><nowiki> $ onevnet list NID NAME TYPE SIZE BRIDGE 0 Public VLAN 1 eth0 $ onevnet show "Private LAN" NID : 0 UID : 0 Network Name : Private LAN Type : Fixed Size : 1 Bridge : eth0 ....: Template :.... BRIDGE=eth0 LEASES=IP=130.10.0.1,MAC=50:20:20:20:20:20 ....: Leases :.... IP = 130.10.0.1 MAC = 50:20:20:20:20:20 USED = 0 VID = -1 </nowiki></pre> Once you have created the virtual network, we can then submit a VM to OpenNebula, by using onevm. We are going to build a VM template to submit the image we had placed in the /opt/nebula/images directory. The following will do: <pre><nowiki> NAME = vm-example CPU = 0.5 MEMORY = 128 OS = [ kernel = "/boot/vmlinuz-2.6.18-4-xen-amd64", initrd = "/boot/initrd.img-2.6.18-4-xen-amd64", root = "sda1" ] DISK = [ source = "/opt/nebula/images/disk.img", target = "sda1", readonly = "no" ] DISK = [ type = "swap", size = 1024, target = "sdb"] NIC = [ NETWORK = "Private LAN" ] </nowiki></pre> Save it in your home and name it myfirstVM.template. Once you have tailored the requirements to your needs (specially, CPU and MEMORY fields), ensuring that the VM fits into at least one of both hosts, lets submit the VM (assuming you are currently in your home folder): <pre><nowiki> $ onevm submit myfirstVM.template </nowiki></pre> This should come back with an ID, that you can use to identify the VM for monitoring and controlling, again through the use of the '''onevm''' command: <pre><nowiki> $ onevm list </nowiki></pre> The output should look like: <pre><nowiki> ID NAME STAT CPU MEM HOSTNAME TIME 0 one-0 runn 0 65536 aquila01 00 0:00:02 </nowiki></pre> == What next? == * More information: [http://opennebula.org/doku.php?id=documentation Documentation, Guides and Use Cases] * To configure OpenNebula to launch an EC2 instance, go [http://opennebula.org/doku.php?id=documentation:rel1.2:ec2g here] * To configure OpenNebula with Haizea to use advanced scheduling features (including Advance Reservations), go [http://haizea.cs.uchicago.edu/manual/node31.html here] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Http://opennebula.org/files/front-page.png
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:OpenNebula
。