Share
Embed
ディスクレスハイパーバイザ 〜運用しやすいクラウドのために〜
サイバーエージェントにはプライベートクラウドチームがあり、15年以上前から自社でサーバを管理/運用しています。 プライベートクラウドを運用するにあたって、効率的な運用のために数多くの仕組みや自動化システムを開発しています。 このセッションではその中の1つであるディスクレスハイパーバイザについてお話しします。
Talked by 【サイバーエージェント】クラウドを支えるインフラ技術
Transcript
101 slides
-
ディスクレスハイパーバイザ 〜運⽤しやすいクラウドのために〜 株式会社サイバーエージェント CIU Platform div Nakanishi Kento @whywaita
クラウドを⽀えるインフラ技術 @ CAMPHOR- HOUSE 20 23 / 02 / 07 -
Nakanisi Kento / whywaita • 2019年新卒⼊社 (4年⽬) • 業務: OpenStack
/ Kubernetes を使った新機能開発 • IaaSの開発 • OSS (myshoes) の開発 & OSSを⽤いたマネージドサービス PdM • 趣味: ⾃宅インフラ / アニソン / ポーカー -
ディスクレスハイパーバイザ 〜運⽤しやすいクラウドのために〜 株式会社サイバーエージェント CIU Platform div Nakanishi Kento @whywaita
クラウドを⽀えるインフラ技術 @ CAMPHOR- HOUSE 20 23 / 02 / 07 -
Cycloud 5 •Cy(berAgent)cloud •特徴 •各種コンポーネントのAPI化 •Cloud / Firewall / IPAddress
/ LoadBalancer / etc •性能に対するコストパフォーマンス (Public⽐) •運⽤者が「つらくない」プライベートクラウド -
プライベートクラウド概要図 6 L 2 Overlay Network (VXLAN on IP CLOS)
Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer KVM / Container Users VM Users VM Users Service nova neutron Container KVM / Container OpenStack Controller Container other Container User Components OpenStack Components Physical Components Storage -
プライベートクラウド (OpenStack) の展開 7 L VM Users VM
Users Service nova Components OpenStack -
プライベートクラウド (OpenStack) の展開 8 L 2 Overlay Network (VXLAN on
IP CLOS) Compute Node Compute Node Compute Node k 8 s master k 8 s master k 8 s master Storage Storage KVM / Container Users Components -
プライベートクラウド概要図 12 L 2 Overlay Network (VXLAN on IP CLOS)
Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer KVM / Container Users VM Users VM Users Service nova neutron Container KVM / Container OpenStack Controller Container other Container User Components OpenStack Components Physical Components Storage -
プライベートクラウド概要図 13 L neutron Container KVM / Container
OpenStack Controller Container other Container User Components Physical -
プライベートクラウド概要図 15 L 2 Overlay Network (VXLAN on IP CLOS)
Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer KVM / Container Users VM Users VM Users Service nova neutron Container KVM / Container OpenStack Controller Container other Container User Components OpenStack Components Physical Components Storage -
プライベートクラウド概要図 16 L 2 Overlay Network (VXLAN on IP CLOS)
Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer KVM / Container Users VM Users VM Users Service nova neutron Container KVM / Container OpenStack Controller Container other Container User Components OpenStack Components Physical Components Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage -
プライベートクラウド概要図 17 L 2 Overlay Network (VXLAN on IP CLOS)
Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer KVM / Container Users VM Users VM Users Service nova neutron Container KVM / Container OpenStack Controller Container other Container User Components OpenStack Components Physical Components Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage nova neutron Container OpenStack Controller Container other Container nova neutron Container OpenStack Controller Container other Container nova neutron Container OpenStack Controller Container other Container nova neutron Container OpenStack Controller Container other Container nova neutron Container OpenStack Controller Container other Container -
プライベートクラウド概要図 22 L 2 Overlay Network (VXLAN on IP CLOS)
Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer KVM / Container Users VM Users VM Users Service nova neutron Container KVM / Container OpenStack Controller Container other Container User Components OpenStack Components Physical Components Storage -
プライベートクラウド概要図 23 L 8 s master k 8 s
master k 8 s master Storage Storage KVM / Container Users Components 物理的なサーバは Kubernetes Node として管理 -
24 $ kubectl get nodes | grep ^cn cn0001 Ready
cn,node cn0002 Ready cn,node cn0003 Ready cn,node cn0004 Ready cn,node -
25 $ kubectl get nodes | grep ^cn cn0001 Ready
cn,node cn0002 Ready cn,node cn0003 Ready cn,node cn0004 Ready cn,node 1台で80Core 512 GB ※最近だと96Core 1 TB -
プライベートクラウド概要図 26 L neutron Container KVM / Container
OpenStack Components Physical Components OpenStack⽤のコンポーネントは Podとして管理 -
27 $ kubectl get pod -n openstack -o wide |
grep nova-api nova-api-849dff6d5b-68z8h 2/2 Running 0 22d x.x.x.x k8smaster01 nova-api-849dff6d5b-8d95z 2/2 Running 0 22d x.x.x.x k8smaster02 nova-api-849dff6d5b-bp64w 2/2 Running 0 22d x.x.x.x k8smaster03 nova-api-849dff6d5b-cxhwt 2/2 Running 0 22d x.x.x.x k8smaster04 -
28 $ kubectl get pod -n openstack -o wide |
grep nova-api nova-api-849dff6d5b-68z8h 2/2 Running 0 22d x.x.x.x k8smaster01 nova-api-849dff6d5b-8d95z 2/2 Running 0 22d x.x.x.x k8smaster02 nova-api-849dff6d5b-bp64w 2/2 Running 0 22d x.x.x.x k8smaster03 nova-api-849dff6d5b-cxhwt 2/2 Running 0 22d x.x.x.x k8smaster04 複数ノードに渡るプロセスを ⼀括管理可能! -
プライベートクラウド概要図 29 L 2 Overlay Network (VXLAN on IP CLOS)
Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer KVM / Container Users VM Users VM Users Service nova neutron Container KVM / Container OpenStack Controller Container other Container User Components OpenStack Components Physical Components Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage nova neutron Container OpenStack Controller Container other Container nova neutron Container OpenStack Controller Container other Container nova neutron Container OpenStack Controller Container other Container nova neutron Container OpenStack Controller Container other Container nova neutron Container OpenStack Controller Container other Container -
プライベートクラウド概要図 30 L 2 Overlay Network (VXLAN on IP CLOS)
Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer KVM / Container Users VM Users VM Users Service nova neutron Container KVM / Container OpenStack Controller Container other Container User Components OpenStack Components Physical Components Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage -
プライベートクラウド概要図 32 L 8 s master k 8 s
master Firewall Load Blancer KVM / Container Users Components Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage -
Bearman 🐻 35 •Django製 Baremetal 管理 (manager) ツール •物理サーバの管理 •UUID
/ hostname •Flavor (起動するOSの指定) •ComputeNode, Cinder, Software LoadBalancer •Network (VLAN, IPMI, IP Address) -
Bearmanによる在庫管理 - 登録編 39 1 . iPXEによるブート (CentOS) 2 .
autorun.service が起動 3 . BIOS / NICのファームウェアバージョンチェック and アップ 4 . lldpd によって近傍スイッチ情報をチェック 5 . dmidecode コマンドでHW情報をチェック 6 . Bearmanに登録 / IPMI設定 7 . CentOS シャットダウン! -
Bearmanによる在庫管理 - 登録編 43 CentOS autorun.service 新規登録⽤ register.sh 取得 &
実⾏ object storage 1段階⽬OS -
Bearmanによる在庫管理 - 登録編 44 1 . iPXEによるブート (CentOS) 2 .
autorun.service が起動 3 . BIOS / NICのファームウェアバージョンチェック and アップ 4 . lldpd によって近傍スイッチ情報をチェック 5 . dmidecode コマンドでHW情報をチェック 6 . Bearmanに登録 / IPMI設定 7 . CentOS シャットダウン! register.sh の職務 -
Bearmanによる在庫管理 - 登録編 45 CentOS autorun.service Bearmanに登録 ※正確にはregister.shで取得した bearman-cli (by
Go) Bearman 1段階⽬OS register.sh https://bearman-grpc.example.com/ -
Bearmanによる在庫管理 - 登録編 46 CentOS autorun.service Bearman 1段階⽬OS register.sh 新規にNodeとして保存
Bearman DB Node (UUID: xxx) -
Bearmanによる在庫管理 - 登録編 49 CentOS autorun.service Bearman 1段階⽬OS register.sh ②BearmanがIPMI
IPを アサイン IPman ①IP払い出し -
Bearmanによる在庫管理 - 登録編 52 CentOS autorun.service Bearman 1段階⽬OS register.sh IPman
BMC • Node情報はBearmanから登録 • IPMIにてNodeに疎通可能 -
Bearmanによる在庫管理 - 起動編 55 Real OS (Ubuntu) iPXE kernel= …
initramfs= … append= … CentOS autorun.service kexec kernel= … initramfs= … append= … 初回ブート 1段階⽬OS 2段階⽬OS -
Bearmanによる在庫管理 - 起動編 56 Real OS (Ubuntu) iPXE kernel= …
initramfs= … append= … CentOS autorun.service kexec kernel= … initramfs= … append= … 初回ブート 1段階⽬OS 2段階⽬OS 2段階⽬には ⾃由なOSを選択可能 -
Bearmanによる在庫管理 - 起動編 60 iPXE kernel= … initramfs= … append=
… CentOS autorun.service 初回ブート 1段階⽬OS Cephからダウンロード kexec.sh -
Bearmanによる在庫管理 - 起動編 61 iPXE kernel= … initramfs= … append=
… CentOS autorun.service 初回ブート 1段階⽬OS ⾃分が起動するべき OS情報をBearmanから 取得 kexec.sh Bearman -
Bearmanによる在庫管理 - 起動編 62 iPXE kernel= … initramfs= … append=
… CentOS autorun.service 初回ブート 1段階⽬OS ⾃分が起動するべき OS情報をBearmanから 取得 kexec.sh Bearman https://bearman-grpc.example.com/ipxe/${uuid} -
Bearmanによる在庫管理 - 起動編 63 iPXE kernel= … initramfs= … append=
… CentOS autorun.service 初回ブート 1段階⽬OS kexec.sh Bearman https://bearman-grpc.example.com/ipxe/${uuid} $ dmidecode -s “system-uuid” にて決定 -
Bearmanによる在庫管理 - 起動編 64 iPXE kernel= … initramfs= … append=
… CentOS autorun.service 初回ブート 1段階⽬OS kexec.sh Bearman • 順番にエンドポイントを叩く • ${uuid}/pro fi le • 起動⽤のpro fi le • ${uuid}/detail • IPアドレス / bond 0 IPアドレスなど • ${uuid}/installed • インストール完了をBearmanに通知 -
Bearmanによる在庫管理 - 起動編 66 iPXE kernel= … initramfs= … append=
… CentOS autorun.service 初回ブート 1段階⽬OS kexec.sh Bearman • 順番にエンドポイントを叩く • ${uuid}/pro fi le • 起動⽤のpro fi le • ${uuid}/detail • IPアドレス / bond 0 IPアドレスなど • ${uuid}/installed • インストール完了をBearmanに通知 -
Bearmanによる在庫管理 - 起動編 68 iPXE kernel= … initramfs= … append=
… CentOS autorun.service 初回ブート 1段階⽬OS kexec.sh Bearman • 順番にエンドポイントを叩く • ${uuid}/pro fi le • 起動⽤のpro fi le • ${uuid}/detail • IPアドレス / bond 0 IPアドレスなど • ${uuid}/installed • インストール完了をBearmanに通知 -
Bearmanによる在庫管理 - 起動編 70 iPXE kernel= … initramfs= … append=
… CentOS autorun.service 初回ブート 1段階⽬OS kexec.sh Bearman このNodeが起動すべき OS情報などを取得 -
Bearmanによる在庫管理 - 起動編 71 iPXE kernel= … initramfs= … append=
… CentOS autorun.service kexec kernel= … initramfs= … append= … 初回ブート 1段階⽬OS kexecのパラメータ組⽴ -
Bearmanによる在庫管理 - 起動編 72 Real OS (Ubuntu) iPXE kernel= …
initramfs= … append= … CentOS autorun.service kexec kernel= … initramfs= … append= … 初回ブート 1段階⽬OS 2段階⽬OS -
Bearmanによる在庫管理 - 起動編 73 Real OS (Ubuntu) iPXE kernel= …
initramfs= … append= … CentOS autorun.service kexec kernel= … initramfs= … append= … 初回ブート 1段階⽬OS 2段階⽬OS ユーザ⽤の 2段階⽬OSが 起動成功🎉 -
Bearmanによる在庫管理 - 起動編 75 iPXE kernel= … initramfs= … append=
… CentOS autorun.service kexec kernel= … initramfs= … append= … 初回ブート 1段階⽬OS -
Bearmanによる在庫管理 - 起動編 76 iPXE kernel= … initramfs= … append=
… CentOS autorun.service kexec kernel= … initramfs= … append= … 初回ブート 1段階⽬OS 在庫管理DBに登録 必要な情報の収集 -
Bearmanによる在庫管理 - 起動編 77 Compute Node iPXE kernel= … initramfs=
… append= … CentOS autorun.service kexec kernel= … initramfs= … append= … 初回ブート 1段階⽬OS 2段階⽬OS メモリ上にOSを展開 -
Bearmanによる在庫管理 - 起動編 78 Compute Node iPXE kernel= … initramfs=
… append= … CentOS autorun.service kexec kernel= … initramfs= … append= … 初回ブート 1段階⽬OS 2段階⽬OS その上にユーザのVM ストレージはiSCSI経由 Users VM Users VM Users VM -
平和な⽇常 (Bearmanがない⼈⽣) 80 Compute Node Users VM Users VM Users
VM Compute Node Users VM Users VM Users VM Compute Node Users VM Users VM Users VM Compute Node 設定ファイル 設定ファイル 設定ファイル 設定ファイル -
悲しい事件 (Bearmanがない⼈⽣) 82 Compute Node Users VM Users VM Users
VM Compute Node Users VM Users VM Users VM Compute Node Users VM Users VM Users VM Compute Node 設定ファイル 設定ファイル 設定ファイル 設定ファイル 😇 🔥 🔥 🔥 🔥 障害発⽣ 🔥 🔥 強制シャットダウン 🔥 -
悲しい事件 (Bearmanがない⼈⽣) 83 Compute Node Users VM Users VM Users
VM Compute Node Users VM Users VM Users VM Compute Node Users VM Users VM Users VM Compute Node 設定ファイル 設定ファイル 設定ファイル 設定ファイル 😇 🔥 🔥 🔥 設定ファイル救出失敗!!! 復帰が⼤変 😇 -
平和な⽇常 (Bearmanがある⼈⽣) 88 Compute Node onMemory Users VM Users VM
Users VM Compute Node onMemory Users VM Users VM Users VM Compute Node onMemory Users VM Users VM Users VM Compute Node onMemory 設定ファイル 設定ファイル 設定ファイル 設定ファイル -
平和な⽇常 (Bearmanがある⼈⽣) 89 Compute Node onMemory Users VM Users VM
Users VM Compute Node onMemory Users VM Users VM Users VM Compute Node onMemory Users VM Users VM Users VM Compute Node onMemory 設定ファイル 設定ファイル 設定ファイル 設定ファイル (そもそも!) オンメモリ = いつ消えても再現可能 -
悲しい事件 (Bearmanがある⼈⽣) 91 Compute Node onMemory Users VM Users VM
Users VM Compute Node onMemory Users VM Users VM Users VM Compute Node onMemory Users VM Users VM Users VM Compute Node onMemory 設定ファイル 設定ファイル 設定ファイル 設定ファイル 😇 🔥 🔥 🔥 🔥 障害発⽣ 🔥 🔥 強制シャットダウン 🔥 -
悲しい事件 (Bearmanがある⼈⽣) 92 Compute Node onMemory Users VM Users VM
Users VM Compute Node onMemory Users VM Users VM Users VM Compute Node onMemory Users VM Users VM Users VM Compute Node onMemory 設定ファイル 設定ファイル 設定ファイル 設定ファイル 😇 🔥 🔥 (なんと!) ⾃動でUser VMはマイグレーション Users VM Users VM Users VM -
悲しい事件 (Bearmanがある⼈⽣) 93 Compute Node onMemory Users VM Users VM
Users VM Compute Node onMemory Users VM Users VM Users VM Compute Node onMemory Compute Node onMemory 設定ファイル 設定ファイル 設定ファイル 設定ファイル (さらに!) Bearmanによって簡単再構築! Users VM Users VM Users VM -
Bearman のメリット 97 •運⽤時の確認事項が⼤きく削減 •適切に電源 / 光ケーブルを配線し電源ポチで 🙆 •設定に不備があった場合はSlack通知で⽬視確認不要 •トラシュもフル機能のbashを使って可能
•IPMI情報などが⾃動で登録、Web画⾯から参照可 •チームメンバー誰でも気軽に物理利⽤ -
プライベートクラウド概要図 98 L 2 Overlay Network (VXLAN on IP CLOS)
Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer KVM / Container Users VM Users VM Users Service nova neutron Container KVM / Container OpenStack Controller Container other Container User Components OpenStack Components Physical Components Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall Load Blancer Storage -
プライベートクラウド概要図 99 L 2 Overlay Network (VXLAN on IP CLOS)
Compute Node Compute Node Compute Node k 8 s master k 8 s master Firewall KVM / Container Users VM Users VM Users Service nova neutron Container KVM / Container OpenStack Controller Container other Container User Components OpenStack Components Physical Components Storage Load Blancer 🐻 🐻 🐻 -
ディスクレスハイパーバイザ 100 •物理サーバ = Kubernetes Nodeに •OpenStack on Kubernetes •OSを全てオンメモリに展開することで障害からの
復旧を簡易化 •Bearmanと連携し簡単安全にNodeを復活 •ストレージは全てNetwork経由 -
まとめ 101 •CyberAgentのプライベートクラウドでは、 既存の問題点をエンジニアリングで解決 •Kubernetes / Bearman 🐻 •巨⼤なインフラを⾃分のソフトウェアで制御できる
•(たぶん)国内でもあまりない事例 •より多くの問題を解決し価値を提供していきます 💪