<preface p2 by Ruiy,我就在开头简单奇葩两句!>
老周被查,涉及到政治问题,我先就不聊了,但Ruiy叹那,都查到七*务了,土党唱哪一出!
能基本玩转OpenNebula都认为它很奇葩!比它小岁吧的openStack就比较单纯(dev Language aspect,人家功能可是一个 “牛”字,概之,OpenStack的设计初衷和市场定位PublicCloud),one适合在vDCs中生存,虚机的allInfo 都设计到接口,因此在one中可一般可看到虚机的详细创建调度,操作日志,见GUI.相对在openstack中关于虚机的很多信息几乎不能从接口API中来get!但可以从log中挖,哎,也只能委屈你Dev工程师帅锅,其实在大型projects中无API的二次开发一般是无法开展的,要是你开展下去了,那Ruiy只能说 放弃了Dev底线,追求实现require functations;
One很简单,是真的太简单了,至少从arch-er角度,话又说回来了,能玩转则简单,玩不转...!
libvirtd 的URL;
messagebus 的ENDPOINT URL?
实际玩了,才能知道是否能装,简单玩转了,你后续还需要一股作气玩转你该玩转的,你想玩转的,不然就泄气了,啥求泄气了可都不好玩,至少没弹性了;
<preface,building your cloudVDC together with Ruiy,hypervisor use kvm,xen,esx5>
<一,openNebula述>
openNebula is the open-source industry standard for data center virtualization,offering a simple but feature-rich and flexible solution to build and manage enterprise clouds and virtualized data centers.openNebula is designed to be simple;
simple to install,update and operate by the admins,and simple to use by end users,build and manage enterprise cloud and virtualized data centers;
introductory guide gives an overview of openNebula and summarizes its main benefits for the different stakeholders involved in a cloud computing infrastructure;
being focused on simplicity,we integrate with existing technologies whenever possible;
OpenNebula works with Ceph,GlusterFS,Open vSwitch LDAP;
KEY features;
interface provided
1,cloud interface for cloud consumers,like the OCCI and EC2 query and ebs interfaces,and a simple sun-stone cloud user that can be used as a self-service portal;
2,administrator interfaces for cloud advanced users and operators,like a unix-like command line interface and th powerful sunstone GUI
3,extensible low-level API for cloud integrator in ruby,java and XMLRPC API
4,a marketplace for appliance builders with a catalog of virtual appliance ready to run in OpenNebula environments;
OpenNebula offer to cloud consumers?
powerful,scalable and secure multi-tenant cloud platform for fast delivery and elasticity of virtual resources.
Image catalogs:OpenNebula allows to store disk images in catalog(termed datastores)
Network catalogs:virtual networks can be also be organised in network catalog,and provide means to interconnect virtual machines;
VM Template catelog:the template catalog system allows to register virtual machine definitions in the system,to be instantiated later as virtual machine instances;
Virtual Resource control and monitoring:once a template is instantiated to a virtual machine,there are a number of operations that can be performed to control lifecycle of the virtual machine instances,such as migration(live and cloud),stop,resume,cancle,poweroff,ETC;
Multi-tier cloud application control and monitoring:openNebula allows to define,execute and manage multi-tiered elastic applications,or services composed of interconnected virtual machines with deployment dependencies between them and auto-scaling rules;
NetWork catalog(private dev net,public net,HPC infiniBand,private production)
Images catalog()
Template catelog(web server front-end,database component,load balancer)
OpenNebula offer to cloud operators
Users and Groups:OpenNebula features advanced multi-tenancy with powerful users and groups management,fine-grained ACLS for resource allocation,and resource quota management to track and limit computing,storage and networking utilization
Virtualization:various hypervisors are supported in the virtualization manager,with the ability to control the complete lifecycle of Virtual Machines and multiple hypervisors in the same cloud infrastructure
hosts:the host manager provides complete functionality for the management of the physical hosts in the cloud;
Monitoring:
OpenNebula offer to cloud builder?
OpenNebula offer to cloud integrators?
Understanding OpenNebula!
Infrastructure Perspective?
Organizational Perspective
Quickstart:OpenNebula on CentOS 6 and kvm
Frontend and Nodes:
Frontend server will execute the OpenNebula services,and the Nodes will be used to execute virtual machines;
Nodes will be used to execute virtual machines.
Packages layout:
openNebula-server:OpenNebula daemons
OpenNebula:OpenNebula CLI commands
opennebula-java:OpenNebula java API
opennebula-node-kvm: Installs dependencies required by OpenNebula in the nodes
opennebula-gate:Send information from Virtual Machines to OpenNebula
opennebula-flow:Manage OpenNebula Services
opennebula-content:Package for OpenNebula Guests
opennebula-common and opennebula-ruby opennebula-occi which is RESTful service to manage the cloud
opennebula-sunstone;
OpenNebula components repo
http://downloads.opennebula.org/repo/CentOS/6/stable/x86_64/
<ONE实战,Install frontEnd>
1,SELINUX /etc/sysconfig/selinux
2,epel repo
3,OpenNebula repository
cat << EOT > /etc/yum.repos.d/opennebula.repo
[opennebula]
name=opennebula
baseurl=http://downloads.opennebula.org/repo/CentOS/6/stable/x86_64
enabled=1
gpgcheck=0
EOT
yum clean all && yum makecache;
4,install required packages
5,configure and start the services
two main processes that must be started,the main OpenNebula daemon:oned and the graphical user interface:sunstone
sunstone listen only in the loopback interface by default for security reasons,to change it edit /etc/one/sunstone-server.conf and change:host 127.0.0.1 to host:0.0.0.0
service opennebula/opennebula-sunstone start
6,configure NFS
warning:ship this section if you are using a single server for both the frontend and worker node roles
export /var/lib/one/ from the frontend to the worker nodes,to do so add the following to the /etc/exports file in the frontend
/var/lib/one/ * (rw,sync,no_subtree_check,root_squash)
7,configure ssh public Key
OpenNebula will need to SSH passwordlessly from any node (including the frontend) to any other node
Add the following sinppet to ~/.ssh/config as oneadmin so it doesn't prompt to add the keys to the known_hosts file:
su - oneadmin
cat << EOT > ~/.ssh/config
Host *
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
EOT
$ hmod 600 ~/.ssh/config
<installation OpenNebula Node>
add OpenNebula repository
cat << EOT >/etc/yum.repos.d/opennebula.repo
[opennebula]
name = opennebula
baseurl = http://downloads.opennbula.org/repo/Centos/6/stable/x86_64
enabled=1
gpgcheck=0
EOT
切换到su -l oneadmin
在oneadmin用户主目录下修改 config 配置实用mysql存储 one的配置信息;
8,configure the Network
Warning:Backup all the files that are modified in this section before making changes to them;
eth0 connected to bridge
configure NFS
Warning:skip this section if you are using a single server for both the frontend and worker node roles
mount the datastores export,add the following to your /etc/fstab
OpenNebulaFrontendIP.:/var/lib/one /var/lib/one nfs soft,intr,rsize=8192,wsize=8192,noauto
Warning:
<basic usage,>
Waning:All the operations in this section can be done using sunstone instead of the command line,point your browser to:http://frontend:9869
default password for oneadmin user be found in ~/.one/one_auth which is randomly generated on every installtion
to interact with OpenNebula,you have to do it from the oneadmin account in the frontend.we will assume all the following commands are performed from that account.to login as oneadmin execute su - oneadmin
1,adding a host
to start running VMs,you should first register a worker node for OpenNebula
issure this commannd for one of your nodes
adding virtual resources
once it's working you need to create a network ,an image and a virtual machine template
to create networks,we need to create first a network template file mynetwork.one
oneimage create
oneimage create --name "Centos-6.5_x86_64" --path "http://appliances.c12g.com/Centos-6.5/centos6.5.qcow2.gz" --driver qcow2 --datastore default;
will need to wait unitl the image is ready to be used.monitor its state by running oneimage list
in order to dynamically add ssh to virtual machines we must add our ssh key to the user template,by editing the user template
<注,tips by Ruiy>
one CLI操作总结
<一,添加物理机节点,跑opennebula-node-kvm>
1,在one cloud Platform CLI 添加物理机
onehost create "被添加物理机,即computer Nodes 的ip,是运行one cloud 的opennebula-node-kvm components" -i kvm -v kvm -n dummy;
调试instructor,
onehost list
日志 /var/log/one/oned.log
<二,添加虚拟资源>
创造虚拟网络
1,编辑网络模板文件
Ruiy.one文件,信息内容如下:
NAME = "private"
TYPE = FIXED
BRIDGE = bro
LEASES = [ IP= ]
LEASES = [ IP= ]
使用onevnet + 上面创建的网络模板文件创建虚拟网络
onevnet create Ruiy.one
2,创建镜像
oneimage create --name "CentOS-6.5_x86_64" --path "http://appliances.c12g.com/CentOS-6.5/centos6.5.qcow2.gz" --driver qcow2 --datastore qcow2 --datastore default
3,创建虚机模板(按跑服务 or 资源配置性能......)
onetemplate create --name "Centos-6.5" --cpu 1 -vcpu 1 --memory 512 --arch x86_64 --disk "Centos-6.5_x86_64" --nic "private" --vnc --ssh;
<注,>
当image state 为running才能使用,此处因为我们使用的镜像资源是网络的(支持本地iso/img镜像资源),需要先下载下来,查看命令为oneimage list;
4,dynamiclaay add ssh keys to virtual machines >>we must add our ssh key to the user template,by editing the user template
su -l oneadmin && cat ~/.ssh/id_dsa.pub
EDITOR=vi oneuser update oneadmin
添加SSH_PUBLIC_KEY="此处的内容是刚刚cat ~/.ssh/id_dsa.pub的内容信息,使用cat ~/.ssh/id_dsa.pub的当前用户必须是oneadmin"
<三,运行虚机>
在云计算中实例化一个虚机模板就相当于运行虚机
1,onetemplate instantiate "Centos-6.5" --name "by Ruiy VMs"
此处的第三个参数是在你用onetemplate 命令创建模板的时候所取 的名字,你可以使用onetemplate list查看下以存在的模板
execute onevm list and watch the virtual machine going from PENDING to PROLOG to RUNNING,
if the vm fails,check the resource in the log /var/log/one/<VM_ID>/vm.log
onehost list;