Cloud from Scratch / ゼロからクラウド構築
-
Upload
marat-zhanikeev -
Category
Technology
-
view
115 -
download
1
description
Transcript of Cloud from Scratch / ゼロからクラウド構築
.
目次のかわりに、今日は
1. クラウド基盤2. データセンター、クラウドエンジニア(CE)の定義
3. (ソフト)ロボット、自動化、OSSの分野4. 演習1: クラウドをゼロから構築してみる5. 演習2: CEになって独自のプロジェクト6. (時間があれば)WRAPUP: クラウドにおけるいくつか課題
を学んでいきます。
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 2/52...
2/52
.
クラウドとは?
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 3/52...
3/52
.
クラウドの定義:標準の見方
• SaaS : Software as a Service →アプリを提供する• SaaS : PaaS : Platform as a Service →ストーレジサービスなどの提供
• IaaS : Infrastructure as a Service → ハードウェアを提供する
• +CaaS : Cloud as a Service
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 4/52...
4/52
.
クラウドの定義:なんでもクラウド
Cloud
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 5/52...
5/52
.
クラウドの定義:なんでもクラウド.クラウドの目標は.....
.
...場所、技術、所属性などに関係なく、全ての資源をクラウド化すること
Cloud
• クラウド化: 或る資源(リソース)を、クラウドらしい形にして使うこと
• 資源: 保存(ストーレジ)、計算、ネットワーク、アプリ
• クラウド化=仮想化• 仮想化=API化• API化=ブラックボックス化 : ボックスの中身を隠して、可能性を限った
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 6/52...
6/52
.
何でもクラウドは可能か?
Cloud
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 7/52...
7/52
.
クラウド:別の見方
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 8/52...
8/52
.
階層の形をしているクラウド
Location 1 Location 2 …
Cloud Management Platform(s)
Cloud APPs …
Tier 1
Tier 2
Tier 3
• 少なくても3層がある → TIER
• Tier 1: 物理的な場所、データセンターなど
• Tier 2: 場所・リソースを管理しているソフト
• Tier 3: Tier2上で出来ているサービスを用いたアプリ
• なぜ階層型?ビズネスを設けるときに判断しやすいからです.
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 9/52...
9/52
.
クラウドの単位:DC(Aさん募集)
• (今の)クラウド: ネットでつながっているデータセンター(DC)を合わせたリソース
• (これからの)クラウド: ユーザ端末(スマホ)なども含める → mobile cloud
• 基本的に、複数のプロバイダがDCを共有することがない → vertical integration
• あれば、horizontal integrationと呼ぶ• vertical → horizontalの移転なら、クライアント側のシステムになる 07
07 M.Zhanikeev "High Availability Cloud Storage...Smart, Throughput and Socially Aware" IEICE NS研 (horizontal)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 10/52...
10/52
.
クラウドの単位:DC, PMs, CE
• クラウドプロバイダの意思決定:DCいくつ? DC毎にPMいくつ?
• CE : クラウドエンジニアの仕事です!• CE:仕事の内容とは?SE? EE? 営業?
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 11/52...
11/52
.
クラウドの単位:CEの仕事は?
• クラウドを構築する
• クラウド上で動いているリソースを管理する
• クラウドの性能を把握し、改善する
• 上記の項目で生じた負担を、自動化などにより、出来るだけ減らす
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 12/52...
12/52
.
クラウドの単位:+ VMs + ROBOTs
• VM: PM上で動いている仮想マシン=仮想計算機
• VMの実行、管理はCEの仕事• ROBOT: CEが作るヘルパー、ソフトに限らない
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 13/52...
13/52
.
CEの事例:Macサーバのラック
• 場面:Macサーバ(性能の良いMac)のラックを作りたい(アップルが)、商品にしたい
• 問題: Mac OSXは、microkernel型で、kernelエラーに弱い、
よくフリーズする(経験ある方?)
• 解決: ...?
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 14/52...
14/52
.
CEの事例:Macサーバのラック
• 場面:Macサーバ(性能の良いMac)のラックを作りたい(アップルが)、商品にしたい
• 問題: Mac OSXは、microkernel型で、kernelエラーに弱い、
よくフリーズする(経験ある方?)
• 解決:フリーズ反応(電気量の変動)+ ラックにロボットアーム(シ
ャーシ型)によるボタン押し = 売られる商品
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 15/52...
15/52
.
CEの仕事:OSSの部分
• CEの仕事にOSSの部分が含まれている
• OSS : Operations Systems and Software (管理に関わるシステムとソフト)
• クラウドなどになってから、NGOSSもある(NG:次世代)• OSSの目的: (何でも)負担を減らす
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 16/52...
16/52
.
CEの事例2 : NTT自宅ハブのストーリ
• IEICE研究会の発表(NTTAT)、2012年辺り(私が聞いたもの)
• マンション型インタネット接続設置の話題、光なども
• 問題: 状況が良く側って、ハードウェアの交換が必要となる• 解決: ハブを設置するときに、(現状の)ユーザ数の2倍程度口のハブを用意する→ 80%のハード交換が不要となった
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 17/52...
17/52
.
CEの仕事:取りまとめ
• OSSの部分はもちろんのこと
• 階層のモデルで、全層に分かって仕事すること
• 解決として何でも良い!API化により、内部が隠れているため、効果のある解決方法が良い(ロボットアームでも)
• 性能が重要!CEの殆どの負担、一番難しい問題、殆どの問題に解決が存在しない世界
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 18/52...
18/52
.
クラウドを構築する(演習1)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 19/52...
19/52
.
Step 1: Switch
• 外部(インタネット)<>(DCの)内部の接続
• 普段、DCに口が1個だけです
• 日本の場合、殆ど1Gbps,最近10Gbpsが増えている
• もちろん、セキュリティなどを含めて、も少し複雑な通信網もありえますね
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 20/52...
20/52
.
Step 2 : + PM
• 空っぽい状態からPMを立ち上げる、一瞬のことじゃないね!
• (最低)条件って何?
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 21/52...
21/52
.
Step 2a : PMの(最低)条件
• マルチコアのCPU : 仮想化の技術により1VM=1コアの設定
• RAMメモリの十分な方 : VMを立ち上げる時に設定するパラメタ• HDメモリの十分の方: これもパラメタ• .... じゃ、ハードウェアとして、どっちが良い?Googleの場合?個人の好み?
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 22/52...
22/52
.
Step 2a : PM初期化
SCP 1.6 Deploy CD
Linux __ Install CD
• Case 1: Linux OSをCDからインストールし、ネットワークからクラウドプラットフォームをインストールする
• Case 2: Bootable USBから、OS+クラウドプラットフォームを一発でインストールする
• Case 3: 専用CDから、OS+クラウドプラットフォームを一発でインストールする
• どっちにする? どっちに時間がかかる?面倒くささ?
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 23/52...
23/52
.
Step 2a : Time Watcher : Tさん募集
• 各段階でかかった時間を記録したいので、Tさんを募集します
• Androidなら、HybridStopwatchを薦めている(LAP記録)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 24/52...
24/52
.
Step 2 : + PM (CEさんの作業)
• XCP 1.6のUSBを使ってインストールする
• Mac Mini: 電源を入れてALTを押し続ける、USBが出たときに選択する
• インストール順序にしたがって、インストールする
• IP: 192.168.11.10, MASK:255.255.255.0, GW:192.168.11.1
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 25/52...
25/52
.
Step 3 : + (2台目の) PM
• も一台• IP: 192.168.11.11, MASK:255.255.255.0, GW:192.168.11.1
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 26/52...
26/52
.
Step 4 : + NOC
• NOC : Network Operations Center• DCを管理するマシン・場所
• CE, ボロットが働いているマシン• Windowsでも構いません、何でも構いません
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 27/52...
27/52
.
Step 4 : Xen Server (Windows)
• Windows用のXCP管理ソフト
• GUIから何でも出来る• NOC上に既にインストールされているので、PMx2の状況を確認する
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 28/52...
28/52
.
Step 4 : xeのCLI
• CE仕事のOSSの部分に直接絡んでいる
• Xen Serverの中で、CLIのxeコマンドもある• GUIより機能性が高い• また、Linux, MacなどのOS用なCLIもあるので、NOCはどいう環境でも立ち上げることができる
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 29/52...
29/52
.
Step 5 : + VM
• VMの作り方: (1)新規でインストール、(2).xvaイメージからインポート
• (1)にすると、OSSが把握しているCEに怒られる
• ベストなパターン: CEが(1)で.xvaを(1回だけ)用意し、それ以降ずっと(2)で運用する
• 教材の中で:***small***と***min***をインポートしてみよう(CLI.txtが参照)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 30/52...
30/52
.
Step 6 : + PROBE
• PM・VMの性能なら、xeのCLIを使う
• 別途でトラヒックをキャプチャし、分析を行うこともある
• 本クラウドに、NetGearのスマートハブを使っているから、ProSafeをつかって、ミラーリングの設定が出来る
• ミラーリング: 邪魔しないで別のマシンで処理できるからです
• Data Center Forensics 04
04
M.Zhanikeev "A Software Design and Algorithms for Multicore Capture in Data Center Forensics" 9th ACM ASIACCSW
(multicore)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 31/52...
31/52
.
クラウド運用・管理(演習2)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 32/52...
32/52
.
クラウド運用・管理とは?
• 全部CEの仕事• 仕事: インタフェース化、API化(VM立ち上げるなど)• 仕事: 性能測定・分析・管理• VMマイグレーションとその自動化(ロボット)
◦ 適当にマイグレーションをしてはいけません、コスト・グリーン化などがある02
• VM以外のリソースのマイグレーション
02 M.Zhanikeev "Optimizing Virtual Machine Migration for Energy-Efficient Clouds" IEICEJ, vol.E97-B, no.2 (migration)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 33/52...
33/52
.
VMマイグレーションの演習
• 一番単純な方法: vm-export → (別のPMに)vm-import
• NOCを使って(独自に=やりたい人)、やってみてください◦ ハブに自分のマシンをつなげて、予備NOCを作ってもよい
• 時間ログを取りましょう、.xvaファイルが2個がある(小・大)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 34/52...
34/52
.
VMマイグレーション=コスト計算
• マイグレーションに掛かった時間・電力などは、コストと呼ぶ
• そのコストの最小化は重要 → VMマイグレーションのグリーン化
• たとえば: bin packing問題でマイグレーション計画を立てちゃだめ!02
• 宿題: コストを減らす方法をリストアップしてみてください
02 M.Zhanikeev "Optimizing Virtual Machine Migration for Energy-Efficient Clouds" IEICEJ, vol.E97-B, no.2 (migration)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 35/52...
35/52
.
wrapup: 何でもクラウドは可能?
• DC内のOSS・管理・自動化を上手く作れば... 可能です。
• VM作成・解除・移動のAPI化を設計すれば... 可能です。
• DC内間の(VM+)リソースマイグレーションを上手く設計すれば... 可能です。
• マイグレーションの時に、コスト最小化を考慮すれば....可能な範囲で運用経費の節約もできる!
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 36/52...
36/52
.
(今の)クラウドの問題点
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 37/52...
37/52
.
PM != ストーレジ
• PMはハードウェアの(結構)固いAPI化
• API化: VMだけのマシンの意味• PMにストーレジが出来ない• そりゃ残念!(インポート、エクスポートの時間を考えて)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 38/52...
38/52
.
VM <> PM間、通信しない決まり
• また、PMのAPI化の決まり
• 目的: VMがハードウェアが意識しないこと
• 「私はxxのVMです、ちょっと、別のPMに移
動したいのですが...」が出来ない
• そりゃ残念
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 39/52...
39/52
.
解決:Cloud Visitation Platform
Location 1 Location 2 …
Cloud Management Platform(s)
Cloud APPs …
Tier 1
Tier 2
Tier 3
Cloud Visitation
Platforms
06 M.Zhanikeev "A Cloud Visitation Platform for Federated Services at Network Edge" Cisco Project Proposal (visitation)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 40/52...
40/52
.
解決:CVP : APIs
Storage Sensors
…
Cloud Visitation Platform
Container
Cloud Visitation Platform
App App App …
APIs
…
Multitenancy
Physical Device
… Interfaces Billing,
Fairness
Generics, Resilience
Application Specifics • PM上 : 2つのインタ
フェース・APIを用意する
• ハードウェアの機能性が意識でき、APIの可能な限りの使用も出来る
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 41/52...
41/52
.
解決:Cloud Visitation : Apps (PULL)
Cloud Visitation Platform
App App App …
Pull-Based Installation (of Apps)
End User
Device Provider 3rd Party
Service
Local services
One Cloud
• 個人・自宅の使用パターン
• End User + 機器プロバイダ+第3者のサービスの複雑な関係
• CiscoのFogComputingの概念を実現した提案06
06 M.Zhanikeev "A Cloud Visitation Platform for Federated Services at Network Edge" Cisco Project Proposal (visitation)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 42/52...
42/52
.
解決:Cloud Visitation : Apps (PUSH)
Cloud Visitation Platform
App App App …
Cloud/device Owner
3rd Party Service Federated
Clouds
Local services
Federated Cloud
Manager
• Federated Cloudsの使用パターン
• 各DCがFCMのサービスに登録する
• 第3者のサービスがFCMにお願いして、アプリをプッシュする
• 同じ提案、別の使用パターン06
06 M.Zhanikeev "A Cloud Visitation Platform for Federated Services at Network Edge" Cisco Project Proposal (visitation)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 43/52...
43/52
.
The Minics Project : まず、質問!
• 比較対象その1: NIIが東京の建物から提供しているクラウド
• 比較対象その2: 今日構築したミニクラウドを日本国内の10大学(10か所)に設置し、ネットでつながったクラウド
• どっちが増し?なぜ?
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 44/52...
44/52
.
The Minics Project
03 M.Zhanikeev "MINICS: Building Manual" http://tinyurl.com/minicsBuild (minics)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 45/52...
45/52
.
Pocket Clouds ?
• Mac MiniにLAN+WiFi、両方あるが、PM化によりWiFiが動かない
• 動いたら、LANの無い、無線だけで接続するクラウドを、ポケットにしまって、持参する
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 46/52...
46/52
.
Practical Cloud : Video Streaming
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 47/52...
47/52
.
Users・SPs・CPsのリソース経済1. 新役割: SP、ユーザ→SP→クラウド2. SP: クラウドのリソースを借りて、サービスに与える3. User, SP, CP間に、リソース経済が生じる01
01 M.Zhanikeev "Multi-Source Stream Aggregation in the Cloud" ACDN Book, Wiley (streaming)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 48/52...
48/52
.
Video Streaming : Cloud vs P2P
01 M.Zhanikeev "Multi-Source Stream Aggregation in the Cloud" ACDN Book, Wiley (streaming)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 49/52...
49/52
.
普通の経済 : Micropayments• micropayments : 料金の非常に小さいお支払
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 50/52...
50/52
.
Micropayments : Cloud Coins.Cloud Coinとは?...クラウドドライブで保存されたeコイン
• アクセス料金が生じないから、集約が可能となる(1週間分など)
• 新特徴のため、リソース経済にも適切:リソース課金など
• コイン・APIなど既に実装済05
05 M.Zhanikeev "3 Cloud Drives Can Use OAuth for Micropayments and Resource Metering Alike" 9th ACM CFI (coin)
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 51/52...
51/52
.
That’s all, thank you ...
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 52/52...
52/52
.
[01] M.Zhanikeev (streaming)Multi-Source Stream Aggregation in the CloudACDN Book, Wiley
[02] M.Zhanikeev (migration)Optimizing Virtual Machine Migration for Energy-Efficient CloudsIEICEJ, vol.E97-B, no.2
[04] M.Zhanikeev (multicore)A Software Design and Algorithms for Multicore Capture in Data Center Forensics9th ACM ASIACCSW
[04] M.Zhanikeev (multicore)A Software Design and Algorithms for Multicore Capture in Data Center Forensics9th ACM ASIACCSW
[05] M.Zhanikeev (coin)3 Cloud Drives Can Use OAuth for Micropayments and Resource Metering Alike9th ACM CFI
[06] M.Zhanikeev (visitation)M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 52/52
...
52/52
.
A Cloud Visitation Platform for Federated Services at Network EdgeCisco Project Proposal
[07] M.Zhanikeev (horizontal)High Availability Cloud Storage...Smart, Throughput and Socially AwareIEICE NS研
M.Zhanikeev -- [email protected] Cloud from Scratch / ゼロからクラウド構築 -- http://bit.do/marat140829 52/52...
52/52