谁来拯救云计算 – 康华

—   云计算的技术路线探讨  BY 康华  from: http://blog.csdn.net/kanghua/article/details/7232191

 

引言

当前的“云计算”一词已经被神话,似乎快成了放之四海皆准的时髦真理,就好比当初言必称“希腊”一般,表面光芒四射,但实际上却无比教条、且越来越令人生厌。

作为“云计算”的一个普通开发者和是推广者,很有必要通过亲身实践,以正视听,希望能让后来者(云计算系统的开发者)少走弯路——有所为、有所不为。

 

前言

我们所要谈论的不是商业领袖们所热衷的云计算概念、云计算市场,而是讨论技术人员眼中云计算具体形态和切实的实现办法。

我们将从需求分析入手、进而讨论设计理念、再具体化到子系统设计和实现中存在的难点问题、最后谈谈云计算对外服务的技术选择。其中有些观点属于业界共识,也不少属于个人看法——难免有所偏颇——真诚欢迎从事云计算开发的朋友积极讨论和批评。

本文试图回答这么几么几问题:

1. 技术人员理想的云计算是什么。

2. 理想和现实的鸿沟是什么。

3. 云计算到底需要什么样的基础架构。

4. 云计算基础架构可能的组成部分。

5. 虚拟机和App engine等云计算的关系。

Continue reading “谁来拯救云计算 – 康华”

oVirt project: Workshop – Beijing – March 21st

From: http://www.ovirt.org/news-and-events/workshop/

Workshop – Beijing – March 21st

To RSVP please email to rsvp@oVirt.org .

During this workshop you’ll learn about the technical background and direction
of the project. You’ll meet the developers, and have an opportunity to use –
yes our first release will be out – and hack on the code right away.

The workshop meeting March 21st, at the IBM Campus and is open to all who want
to use, get involved or learn about the comprehensive open virtualization
management platform. The sessions will cover the technical projects details,
governance, getting involved, usage and much more.

If you have any interest in an Open Virtualization Management platform you need
to be there!

Logistics

When: March 21st, 2012
Location: IBM Campus – Beijing — specific room and will be provided to rsvp
list
Social: Evening March 21st, 2012 — Location To be announced
Coordinators:

  • Karsten Wade kwade@redhat.com

Workshop agenda

This is the final agenda; will be posted here

网络性能测试

我主要做的是Virtual IO, PCI, Network 这几块,提高虚拟机的IO性能。网络性能主要使用netperf,iperf,Ntttcp(win),需要统计吞吐率,CPU利用率,收发包数目,收发字节数,注入中断,IO_exit 等。需要多次测试,调整测试时间,计算平均值,并求标准方差,看看同样环境结果是否稳定,从而确定一些经验值(合理的测试次数,单个测试执行时间等)。

然后对打Patch前后版本的平均值进行比较,评估是否有性能回归bug。顺便给大家推荐一本书[1],大学学的概率论、高数基本都还给老师了,所以还得重新看资料复习。

发程序到社区的时候碰到一个版权问题,NTttcp,微软禁止其他人传播,所以只能提示用户自己去官网下载。我的程序里使用AutoIT脚本自动签订了最终用户许可协议(EULA End User License Agreement),然后在文档、程序、commitlog 里提示如果不同意此协议不要使用此脚本。不清楚是否合法,所以发邮件给内部法律部门咨询了。所以离开自由软件世界是很麻烦的,哈哈。

【1】The Art of Computer Systems Performance Analysis, Raj Jain, 1991.

== average ==
   TCP_STREAM
    size|sessions|throughput|   cpu|normalize|  #tx-pkts|  #rx-pkts|    #tx-byts|    #rx-byts|#re-trans|#tx-intr|#rx-intr|  #io_exit|  #irq_inj|#tpkt/#exit|#rpkt/#irq
     256|       1|   1308.58| 25.68|   610.36|   1144659|   2385825|    75548090|  3428969637|        0|      17| 1055042|    847930|   1073171|       1.35|      2.22
%SD  0.0|     0.0|       0.6| 135.4|    135.4|       0.7|       0.5|         0.7|         0.6|      0.0|     0.0|     0.2|       0.6|       0.2|        0.0|       0.6
     256|       2|   2303.88| 75.86|    30.37|    751786|   3710773|    49625523|  6004979651|        0|      12|  761053|    237602|    807396|       3.17|      4.59
%SD  0.0|     0.0|       2.8|   1.7|      1.0|       2.2|       0.2|         2.2|         2.7|      0.0|     0.0|     0.2|       4.9|       0.1|        2.7|       0.2
     512|       1|   1597.22| 51.31|    31.12|   1344860|   2840991|    88761368|  4181982870|        0|      20|  933259|    691258|    951026|       1.94|      2.99
%SD  0.0|     0.0|       1.9|   1.1|      0.8|       2.9|       1.9|         2.9|         1.8|      0.0|     3.4|     0.3|       2.8|       0.3|        0.4|       1.7
     512|       2|   4885.64| 69.81|    68.28|   1546820|   3311501|   102158968| 12433545874|        0|      27| 1036179|    649578|   1063091|       8.02|      2.97
%SD  0.0|     0.0|      49.4|  37.3|     13.4|     111.0|     101.0|       110.9|        46.8|      0.0|    78.6|    97.2|     136.2|      95.6|      103.2|      10.5
   TCP_RR
    size|sessions|throughput|   cpu|normalize|  #tx-pkts|  #rx-pkts|    #tx-byts|    #rx-byts|#re-trans|#tx-intr|#rx-intr|  #io_exit|  #irq_inj|#tpkt/#exit|#rpkt/#irq
     256|      50|  14433.24| 22.19|   650.52|    288679|    288765|    92951906|    92969020|        0|       4|  288733|    288781|    295057|       1.00|      0.98
%SD  0.0|     0.0|       0.8|   1.2|      2.1|       0.8|       0.8|         0.8|         0.8|      0.0|     0.0|     0.9|       0.8|       1.0|        0.0|       0.0
     256|     100|  14473.61| 22.01|   657.84|    289486|    289595|    93211760|    93224643|        0|       5|  289551|    289594|    295647|       1.00|      0.98
%SD  0.0|     0.0|       0.4|   1.9|      1.5|       0.4|       0.4|         0.4|         0.4|      0.0|     0.0|     0.4|       0.4|       0.5|        0.0|       0.0
     512|      50|  14399.08| 22.79|   631.82|    287996|    288063|   166455616|   166464572|        0|       4|  288036|    288100|    293729|       1.00|      0.98
%SD  0.0|     0.0|       0.2|   0.2|      0.5|       0.2|       0.2|         0.2|         0.2|      0.0|     0.0|     0.2|       0.2|       0.2|        0.0|       0.0
     512|     100|  14280.03| 22.11|   646.46|    285614|    285684|   165079121|   165087633|        0|       5|  285652|    285721|    291826|       1.00|      0.98
%SD  0.0|     0.0|       0.6|   4.0|      4.6|       0.6|       0.6|         0.6|         0.6|      0.0|     0.0|     0.6|       0.6|       0.8|        0.0|       0.0

== average ==
   TCP_STREAM
    size|sessions|throughput|   cpu|normalize|  #tx-pkts|  #rx-pkts|    #tx-byts|    #rx-byts|#re-trans|#tx-intr|#rx-intr|  #io_exit|  #irq_inj|#tpkt/#exit|#rpkt/#irq
     256|       1|   1266.19| 50.80|    24.93|   1119642|   2307593|    73896989|  3317818482|        0|      16| 1012795|    774796|   1030026|       1.44|      2.24
%SD  0.0|     0.0|       3.4|   0.4|      3.8|       2.4|       3.2|         2.4|         3.4|      0.0|     4.3|     3.0|       7.0|       3.0|        4.4|       0.0
     256|       2|   2305.26| 75.81|    30.41|    754533|   3678855|    49804148|  6006610984|        0|      12|  788165|    254245|    835001|       2.98|      4.41
%SD  0.0|     0.0|       0.7|   1.7|      2.4|       7.9|       0.5|         7.9|         0.7|      0.0|    11.8|     6.1|      14.2|       5.7|        6.2|       5.1
     512|       1|   1605.72| 51.13|    31.40|   1337269|   2851899|    88260371|  4202588460|        0|      20|  925052|    699349|    942828|       1.91|      3.02
%SD  0.0|     0.0|       0.9|   0.5|      1.4|       2.1|       0.7|         2.1|         0.9|      0.0|     0.0|     1.2|       2.5|       1.2|        4.4|       0.7
     512|       2|   6122.82| 86.66|    70.66|    381147|   1442374|    25249126| 15405306185|        0|       8|  349795|     23027|    372068|      16.57|      3.87
%SD  0.0|     0.0|       2.5|   0.9|      3.4|       5.4|      11.8|         5.4|         2.4|      0.0|     8.3|     5.6|       3.2|       4.8|        8.5|       6.9
   TCP_RR
    size|sessions|throughput|   cpu|normalize|  #tx-pkts|  #rx-pkts|    #tx-byts|    #rx-byts|#re-trans|#tx-intr|#rx-intr|  #io_exit|  #irq_inj|#tpkt/#exit|#rpkt/#irq
     256|      50|  14515.94| 22.20|   653.98|    290333|    290423|    93484515|    93499043|        0|       4|  290387|    290436|    296923|       1.00|      0.98
%SD  0.0|     0.0|       0.5|   1.6|      2.1|       0.5|       0.5|         0.5|         0.5|      0.0|     0.0|     0.5|       0.5|       0.4|        0.0|       0.0
     256|     100|  14500.78| 21.99|   659.32|    290030|    290113|    93386788|    93396614|        0|       4|  290076|    290140|    295853|       1.00|      0.98
%SD  0.0|     0.0|       0.5|   1.4|      0.9|       0.5|       0.5|         0.5|         0.5|      0.0|    15.7|     0.5|       0.5|       0.7|        0.0|       0.0
     512|      50|  14257.76| 23.48|   607.39|    285169|    285244|   164821878|   164832698|        0|       4|  285219|    285269|    291469|       1.00|      0.98
%SD  0.0|     0.0|       0.9|   1.6|      0.7|       0.9|       0.9|         0.9|         0.9|      0.0|    15.7|     0.9|       0.9|       0.9|        0.0|       0.0
     512|     100|  14338.74| 22.66|   632.92|    286789|    286853|   165757982|   165765159|        0|       4|  286828|    286893|    292733|       1.00|      0.98
%SD  0.0|     0.0|       0.0|   0.1|      0.1|       0.0|       0.0|         0.0|         0.0|      0.0|    15.7|     0.0|       0.0|       0.1|        0.0|       0.0

Thu Dec 29 20:36:53 2011
========================================================================================================================================================================
   TCP_STREAM
    size|sessions|throughput|   cpu|normalize|  #tx-pkts|  #rx-pkts|    #tx-byts|    #rx-byts|#re-trans|#tx-intr|#rx-intr|  #io_exit|  #irq_inj|#tpkt/#exit|#rpkt/#irq
1)   256|       1|   1308.58| 25.68|   610.36|   1144659|   2385825|    75548090|  3428969637|        0|      17| 1055042|    847930|   1073171|       1.35|      2.22
2)   256|       1|   1266.19| 50.80|    24.93|   1119642|   2307593|    73896989|  3317818482|        0|      16| 1012795|    774796|   1030026|       1.44|      2.24
%       |    +0.0|      -3.2| +97.8|    -95.9|      -2.2|      -3.3|        -2.2|        -3.2|     +0.0|    -5.9|    -4.0|      -8.6|      -4.0|       +6.7|      +0.9
1)   256|       2|   2303.88| 75.86|    30.37|    751786|   3710773|    49625523|  6004979651|        0|      12|  761053|    237602|    807396|       3.17|      4.59
2)   256|       2|   2305.26| 75.81|    30.41|    754533|   3678855|    49804148|  6006610984|        0|      12|  788165|    254245|    835001|       2.98|      4.41
%       |    +0.0|      +0.1|  -0.1|     +0.1|      +0.4|      -0.9|        +0.4|        +0.0|     +0.0|    +0.0|    +3.6|      +7.0|      +3.4|       -6.0|      -3.9
1)   512|       1|   1597.22| 51.31|    31.12|   1344860|   2840991|    88761368|  4181982870|        0|      20|  933259|    691258|    951026|       1.94|      2.99
2)   512|       1|   1605.72| 51.13|    31.40|   1337269|   2851899|    88260371|  4202588460|        0|      20|  925052|    699349|    942828|       1.91|      3.02
%       |    +0.0|      +0.5|  -0.4|     +0.9|      -0.6|      +0.4|        -0.6|        +0.5|     +0.0|    +0.0|    -0.9|      +1.2|      -0.9|       -1.5|      +1.0
1)   512|       2|   4885.64| 69.81|    68.28|   1546820|   3311501|   102158968| 12433545874|        0|      27| 1036179|    649578|   1063091|       8.02|      2.97
2)   512|       2|   6122.82| 86.66|    70.66|    381147|   1442374|    25249126| 15405306185|        0|       8|  349795|     23027|    372068|      16.57|      3.87
%       |    +0.0|     +25.3| +24.1|     +3.5|     -75.4|     -56.4|       -75.3|       +23.9|     +0.0|   -70.4|   -66.2|     -96.5|     -65.0|     +106.6|     +30.3
   TCP_RR
    size|sessions|throughput|   cpu|normalize|  #tx-pkts|  #rx-pkts|    #tx-byts|    #rx-byts|#re-trans|#tx-intr|#rx-intr|  #io_exit|  #irq_inj|#tpkt/#exit|#rpkt/#irq
1)   256|      50|  14433.24| 22.19|   650.52|    288679|    288765|    92951906|    92969020|        0|       4|  288733|    288781|    295057|       1.00|      0.98
2)   256|      50|  14515.94| 22.20|   653.98|    290333|    290423|    93484515|    93499043|        0|       4|  290387|    290436|    296923|       1.00|      0.98
%       |    +0.0|      +0.6|  +0.0|     +0.5|      +0.6|      +0.6|        +0.6|        +0.6|     +0.0|    +0.0|    +0.6|      +0.6|      +0.6|       +0.0|      +0.0
1)   256|     100|  14473.61| 22.01|   657.84|    289486|    289595|    93211760|    93224643|        0|       5|  289551|    289594|    295647|       1.00|      0.98
2)   256|     100|  14500.78| 21.99|   659.32|    290030|    290113|    93386788|    93396614|        0|       4|  290076|    290140|    295853|       1.00|      0.98
%       |    +0.0|      +0.2|  -0.1|     +0.2|      +0.2|      +0.2|        +0.2|        +0.2|     +0.0|   -20.0|    +0.2|      +0.2|      +0.1|       +0.0|      +0.0
1)   512|      50|  14399.08| 22.79|   631.82|    287996|    288063|   166455616|   166464572|        0|       4|  288036|    288100|    293729|       1.00|      0.98
2)   512|      50|  14257.76| 23.48|   607.39|    285169|    285244|   164821878|   164832698|        0|       4|  285219|    285269|    291469|       1.00|      0.98
%       |    +0.0|      -1.0|  +3.0|     -3.9|      -1.0|      -1.0|        -1.0|        -1.0|     +0.0|    +0.0|    -1.0|      -1.0|      -0.8|       +0.0|      +0.0
1)   512|     100|  14280.03| 22.11|   646.46|    285614|    285684|   165079121|   165087633|        0|       5|  285652|    285721|    291826|       1.00|      0.98
2)   512|     100|  14338.74| 22.66|   632.92|    286789|    286853|   165757982|   165765159|        0|       4|  286828|    286893|    292733|       1.00|      0.98
%       |    +0.0|      +0.4|  +2.5|     -2.1|      +0.4|      +0.4|        +0.4|        +0.4|     +0.0|   -20.0|    +0.4|      +0.4|      +0.3|       +0.0|      +0.0

KVM Forum 2011

From: http://log.amitshah.net/2011/08/kvm-forum-2011.html by

KVM Forum 2011

This year’s KVM Forum, like last year’s, was co-located with LinuxCon NA.  Vancouver city played the host this year.

The interest in KVM has been rising over the years; from the first Forum in 2008, when we were just about 30 developers in a single room presenting work done and chatting about directions to take (the virtio design was hashed out during this conference), this year there were about 150 attendees, discussing optimising KVM instances and tracing the guests.  That’s a really big leap in three years.

Due to lots and lots of good talk submissions, not all of which could be rejected, the talk slots were reduced to 30 minutes per talk and there were parallel tracks in the afternoon sessions.  This allowed for more talks, but small Q&A sessions, and obviously, having to miss out on some talks due to another talk happening at the same time. All the talks have been video-recorded, though, and they should appear soon on the Forum page.
Continue reading “KVM Forum 2011”

[ANNOUNCE] Native Linux KVM tool

Date: Thu, 31 Mar 2011 20:30:56 +0300
From: Pekka Enberg 
To: linux-kernel@vger.kernel.org
Cc: aarcange@redhat.com, avi@redhat.com, mtosatti@redhat.com,
        kvm@vger.kernel.org, joro@8bytes.org, penberg@cs.helsinki.fi,
        asias.hejun@gmail.com, gorcunov@gmail.com, mingo@elte.hu
Subject: [ANNOUNCE] Native Linux KVM tool

Hi all,

We’re proud to announce the native Linux KVM tool!

The goal of this tool is to provide a clean, from-scratch, lightweight
KVM host tool implementation that can boot Linux guest images (just a
hobby, won't be big and professional like QEMU) with no BIOS
dependencies and with only the minimal amount of legacy device
emulation.

Note that this is a development prototype for the time being: there's no
networking support and no graphics support, amongst other missing
essentials.

It's great as a learning tool if you want to get your feet wet in
virtualization land: it's only 5 KLOC of clean C code that can already
boot a guest Linux image.

Right now it can boot a Linux image and provide you output via a serial
console, over the host terminal, i.e. you can use it to boot a guest
Linux image in a terminal or over ssh and log into the guest without
much guest or host side setup work needed.

1. To try out the tool, clone the git repository:

  git clone git://github.com/penberg/linux-kvm.git

or alternatively, if you already have a kernel source tree:

  git checkout -b kvm/tool
  git pull git://github.com/penberg/linux-kvm.git

2. Compile the tool:

  cd tools/kvm && make

3. Download a raw userspace image:

  wget http://wiki.qemu.org/download/linux-0.2.img.bz2 && bunzip2
linux-0.2.img.bz2

4. Build a kernel with CONFIG_VIRTIO_BLK=y and
CONFIG_SERIAL_8250_CONSOLE=y configuration options. Note: also make sure
you have CONFIG_EXT2_FS or CONFIG_EXT4_FS if you use the above image.

5. And finally, launch the hypervisor:

  ./kvm --image=linux-0.2.img --kernel=../../arch/x86/boot/bzImage

The tool has been written by Pekka Enberg, Cyrill Gorcunov, and Asias
He. Special thanks to Avi Kivity for his help on KVM internals and Ingo
Molnar for all-around support and encouragement!

See the following thread for original discussion for motivation of this
project:

http://thread.gmane.org/gmane.linux.kernel/962051/focus=962620

			Pekka

VT[1] – 古时候的虚拟化

. Architechture of virtual machines – 1973

Click to access goldberg.pdf

. Survey of Virtual Machine Research — R. P. Goldberg, 1974
http://www-cs-students.stanford.edu/~dbfaria/quals/summaries/Goldberg-1974.txt

一次和宫敏博士[1] 吃饭时,他说虚拟化技术是古时候的,计算机领域好多技术都是周期性的被人翻出来,火热一段时间。
提起虚拟化,很多人会立马联想到云计算,虚拟化是云计算的基础架构,跟应用程序于内核的关系一样,两者完全分离的两套东西。现在虚拟化‘新技术’较多的一个原因是,随着PC>性能的提升,x84体系结构开始 移植/翻新/改进 那些‘古时候‘IBM大型机上成熟的虚拟化技术,再加上基于虚拟化特性的新型应用不断增多,比如利用虚拟机迁移功能,实现数据中心
故障机自动恢复、数据整合、降低IT成本,还有一些正对虚拟化的新硬件,比如SRIOV[2] 技术等。
上面给出的第一个paper,为计算机虚拟化技术鉴定了基础,定义了虚拟机的概念、最初目标、进程在虚拟机上执行的模型、硬件虚拟化设计,用嵌套虚拟更加清楚的阐述了虚拟化技
术的原理性。
VMM (virtual machine monitor, 虚拟机监视器) 是一种运行在宿主物理设备和操作系统之间的软件层,允许多个操作系统和应用共享硬件。她是虚拟环境中的元操作系统,可以访>问所有物理设备。VM Monito负责建立虚拟资源与宿主机资源、执行进程与系统资源的映射关系,同时对各个虚拟机之间施加防护,并控制进程在虚拟机上运行。并且paper中提到的>几个较新的软硬件八特性,都已经在其商用机Goldberg HV19中实现。比如嵌套虚拟化,现在x86上也只有amd64实现,而且还是在KVM upstream的实验版本里。
在KVM里面,VM Monitor由kmod结合硬件实现,这样Linux操作系统就成了虚拟化中的Hypervisor[3],是虚拟化技术的核心部分。

[1] http://www.linux-cn.com/html/test/20070412/1341.shtml
[2] http://www.pciexpressdevnet.org/sriov/
[3] http://en.wikipedia.org/wiki/Hypervisor

VT[0] – Kernel-based Virtual Machine

KVM (Kernel-based Virtual Machine, 不是鼠标 Keyboard Video Mouse 切换器)[1] 是Linux内核虚拟化的基础结构之一。她支持提供intel VT-x AMD-V 扩展的x86处理器的天然虚拟化,已经北移植到了S390, PPC, IA64, ARM的移植正在进行中。
从2.6.20起,KVM正式进入Linux当中,她支持多种Linux发行版,BSD,Solaris,Windows等,修改过的qemu还可以运行Mac OS X
。KVM同时也支持Linux和Windows客户机使用Virtio框架,包括虚拟网卡(virtio-nic)和磁盘I/O控制器(virtio-blk),内>存伸缩设备(virtio-balloon),VGA 图形接口(spice), 虚拟串口设备(virito-serial)等。

KVM本身并不执行模拟,而是用户空间程序(QEMU)使用/dev/kvm接口设置客户机的虚拟机地址空间,放置模拟I/O和映射图形显>示到真实主机。正对KVM的修改版本QEMU-KVM独立为一个upstream 项目[2],原来的QEMU [3]到0.10.0才开始支持KVM。

Virtual-Box的虚拟化是模拟技术,跟一些游戏模拟器一样,虚拟机的请求指令会在用户态模拟的硬件(cpu,内存等)上执行>
,这里的CPU可能与主机的体系结构不一样。KVM则是让虚拟机在host正式的cpu上执行,这里所虚拟的CPU是和正式物理CPU一样的。

Xen 的功劳就是把虚拟化技术带到了,开源社区里,从而吸引更多人参与到虚拟化的设计开发、应用、商业运作当中。KVM在xen之后实现,则是避免了xen设计上的一些缺陷,更加简单一些。有两种截然不同的设计思路,一种是把一个东西设计的足够简单,让它没有明显没有复杂问题;另一种是把一个东西设计的足够复杂,让他明显没有简单问题。

关于KVM的使用,最新kernel默认编译了kvm模块,你只需要把kvm 跟 kvm_intel /kvm_amd用modprobe加载就可以,然后就是安装qemu 或者 qemu-kvm,从软件源里应该能下载到。默认使用user-space的网络 (NAT), 如果要使用桥接网络(虚拟机和主机在局域网了里是对等关系),就需要在主机上设置网桥,这个bridge就是一个虚拟的交换机,虚拟机的‘网线‘插在上面。设置完成,需要用qemu-img 创建虚拟机镜像,相当于准备‘硬盘’。然后你可以从cdrom启动安装系统,或者从网络启动使用pxe+tftp安装系统。安装完,就可以正常启动使用虚拟机了,qemu的命令行很繁多,很多新特新都需要在命令行激活,像vhost,virtio-blk,virtio-net等。这里给出一个ubuntu上KVM的设置[4] ,其他系统基本类似,这里就不重复了。

[1] http://www.linux-kvm.org/
[2] http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=summary
[3] http://wiki.qemu.org/Main_Page
[4] http://forum.ubuntu.org.cn/viewtopic.php?t=154792