Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Dynamic VM Scheduling in OpenStack
Search
Kazuhiko Yamashita
November 25, 2022
Programming
1
1.2k
Dynamic VM Scheduling in OpenStack
CNDT2022で話した内容です。
Kazuhiko Yamashita
November 25, 2022
Tweet
Share
More Decks by Kazuhiko Yamashita
See All by Kazuhiko Yamashita
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.4k
Tuning GraphQL on Rails
pyama86
2
1.4k
ttlcacheのここがスゴい
pyama86
1
84
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
510
実践ARMアーキテクチャ移行
pyama86
2
2.3k
リモートワーク時代の守護神 PHP開発者のためのセキュリティ強化術
pyama86
3
1k
実践DevSecOps~クラウドネイティブとオンプレミスの間から~
pyama86
1
75
ペパボOpenTelemetry革命
pyama86
2
2k
Site Reliability Engineering for GMO
pyama86
10
1.3k
Other Decks in Programming
See All in Programming
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
From Translations to Multi Dimension Entities
alexanderschranz
2
130
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
530
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
130
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
nekko cloudにおけるProxmox VE利用事例
irumaru
3
420
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
Zoneless Testing
rainerhahnekamp
0
120
42 best practices for Symfony, a decade later
tucksaun
1
180
たのしいparse.y
ydah
3
120
Symfony Mapper Component
soyuka
2
730
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
450
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Facilitating Awesome Meetings
lara
50
6.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Six Lessons from altMBA
skipperchong
27
3.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Designing Experiences People Love
moore
138
23k
Building Your Own Lightsaber
phodgson
103
6.1k
A designer walks into a library…
pauljervisheath
204
24k
Into the Great Unknown - MozCon
thekraken
33
1.5k
Transcript
Dynamic VM Scheduling in OpenStack ʙ͜ͷલɺθΫγΟಡΜ͚ͩͲɺRFCΑΓ͔ͬͨ͠ฤʙ
ࢁԼ!QZBNB (.0ϖύϘٕज़ج൫νʔϜ γχΞɾϓϦϯγύϧ UFOTOBQPODPN QZBNBGVO TUOTKQ
45/4 -JOVY/444FSWFS TUOTKQ
45/4
None
CNDT ٱ͠ͿΓʹΦϑϥΠϯͰ ࠷ߴ!!1 Ͱ͜Εը͚ͩͲͶ
ϖύϘͷΠϯϑϥߏ CPU StealʹىҼͨ͠ɺྡਓ εʔύʔˑϥΠϒϚΠάϨʔγϣϯ ·ͱΊͱɺ݁ࠗʹ͓͚Δେࣄͳ͜ͱ42બ ࠓ͢͜ͱ
ϖύϘͷΠϯϑϥߏ 0QFO4UBDL #BSFNFUBM "84 IFSPLV ($1 ཧαʔό7.ن ϗεςΟϯάܥͷαʔϏεɺ֤छج൫αʔϏεͰར༻ &,4
3%4 &MBTUJDYYYܥͷϚωʔδυαʔϏεΛத৺ʹར༻ (,& #JH2VFSZΛத৺ʹ"84ͷ%3ɺσʔλΤϯδχΞϦϯάͷج൫ͱͯ͠ར༻
0QFO4UBDL 0QFO4UBDLͰཧ͢Δ7.ͷ্ʹ ࣗࣾ։ൃͷΤϯδϯΛར༻ͯ͠ ,VCFSOFUFTΛσϓϩΠ 0QFO4UBDL #BSFNFUBM #BSFNFUBM #BSFNFUBM 7.
7. 7. ,VCFSOFUFT $POUBJOFS $POUBJOFS $POUBJOFS ,VCFSOFUFT
CPU StealʹىҼͨ͠ɺ ྡਓ
ॠؒɺ৺ɺॏͶͯ ຊ࣌ؒͰαʔϏεͬͯΔ͔Β ϐʔΫλΠϜ͕ॏෳ 9:00 12:00 20:00 ϐʔΫλΠϜ ϐʔΫλΠϜ ϐʔΫλΠϜ ϐʔΫλΠϜ
ϐʔΫλΠϜ ϐʔΫλΠϜ
CPU Steal Ϧιʔε͕ୣ͍߹͍ʹͳΓɺCPU Steal͕ൃੜ
CPU Stealͷ֓೦ Hypervisor VM1 CPU͍͍ͨʂ 10ඵ͋͛Δ VM2 CPU͍͍ͨʂ 10ඵ͋͛Δ
VMڥʹ͓͚ΔCPU Stealͷ֓೦ Hypervisor VM1 CPU͍͍ͨʂ 10ඵ͋͛Δ VM2 CPU͍͍ͨʂ 10ඵ͋͛Δ ࣮ࡍ8ඵ͔͋͛͠ΒΕͳ͔ͬͨ
ࠩͷ2ඵ͕CPU Steal
CPU Steal͕ى͖Δͱʁ αʔόॲཧೳྗͷԼ αʔόϝτϦΫεͷѱԽ HTTPͷϨΠςϯγͷѱԽ ଓͷ૿Ճ ϩʔυΞϕϨʔδͷ্ঢ
εʔύʔˑϥΠϒϚΠάϨʔγϣϯ
ϥΠϒϚΠάϨʔγϣϯ Hypervisor VM1 VM2 10ඵ CPU 2ඵ CPU Hypervisor VM1
10ඵ CPU VMΛఀࢭ͢Δ͜ͱͳ͘HypervisorؒΛҠಈ
ϥΠϒϚΠάϨʔγϣϯ Hypervisor Hypervisor VM1 Disk Memory VM1 Disk STEP 1
σΟεΫΛಉظ ※ڞ༗ετϨʔδΛར༻͍ͯ͠ͳ͍߹
ϥΠϒϚΠάϨʔγϣϯ Hypervisor Hypervisor VM1 Disk Memory VM1 Disk STEP 2
ϝϞϦΛಉظͯ͠੩ࢭΛͭ ※ڞ༗ετϨʔδΛར༻͍ͯ͠ͳ͍߹ Memory
OpenStackͷϥΠϒϚΠάϨʔγϣϯ https://docs.openstack.org/nova/pike/admin/con fi guring-migrations.html
ϥΠϒϚΠάϨʔγϣϯ Hypervisor Hypervisor VM1 Disk Memory VM1 Disk Memory STEP
3 ੩ࢭ͕औΕͨΒ৽͍͠ΠϯελϯεΛ ༗ޮʹͯ͠ɺωοτϫʔΫܦ࿏ΛΓସ͑Δ ͓લ͕ࠓ͔ΒVM1ͩ
εʔύʔˑϥΠϒϚΠάϨʔγϣϯ
εʔύʔˑϥΠϒϚΠάϨʔγϣϯ 1. VMʹ͓͍ͯStealͷൃੜΛݕ͍ͨ͠ 2.Stealͷൃੜ͍ͯ͠ͳ͍HypervisorʹεέδϡʔϦϯά͍ͨ͠ 3.μϯλΠϜΛൃੜͤͨ͘͞ͳ͍ 4.ࣗಈͰ৸ͯΔؒʹͯ͢ऴΘͬͯ΄͍͠ ͱ͍͏ͷΛɺRubyͰ࣮ͨ͠
VMͷStealൃੜݕ Load5͕͖͍͠Ҏ্͔ͭɺSteal͕ൃੜ͍ͯ͠Δ͜ͱ Steal͕ൃੜͯ͠ɺॲཧ͕Ԇ͍ͯ͠ͳ͍ͳΒͳ͍
εέδϡʔϦϯά HypervisorͷϝτϦΫεͰSteal͕͖͍͠ҎԼͰɺΑΓۭ͖͕͋Δ ಉ͡ϩʔϧͷVM͕ಉҰαʔόʹ͖͍͠Ҏ্ऩ༰͞Ε͍ͯͳ͍ ಉ͡AZͷαʔόͰ͋Δ
Availability Zone LB AZ-1 VM1 AZ-2 VM2 LB AZ-1 VM1
VM2 AZ-2 AZΛ·͍ͨͰεέδϡʔϦϯά͢Δͱ োੑ͕ഁ໓!!1
μϯλΠϜΛൃੜͤ͞ͳ͍ ΦʔέετϨʔλʔͰ͢Δ $ kubectl drain example.local --force --ignore-daemonsets —delete-emptydir-data #
after migrated $ kubectl uncordon example.local $ consul maint -enable # after migrated $ consul maint -disable Kubernetes Consul
kubectl drain node-1 pod-1 Scheduling Disabled node-2 pod-2 pod-1 nodeͷPodͷׂΛఀࢭͯ͠ɺ͍ग़͢
consul node-1 (10.0.0.1) nginx node-2 (10.0.0.2) nginx node-3
(10.0.0.3) nginx $ dig web.service.consul a 10.0.0.1 10.0.0.2 10.0.0.3 ϔϧενΣοΫͳͲΛར༻ͯ͠ɺαʔϏεσΟεΧόϦ͕Ͱ͖Δ DNSͷଞʹɺConsul TemplateΛར༻ͨ͠ ߏϑΝΠϧͷϨϯμϦϯάͳͲͰ׆༻͍ͯ͠Δ
consul maint -enable node-1 (10.0.0.1) nginx node-2 (10.0.0.2)
nginx node-3 (10.0.0.3) nginx $ dig web.service.consul a 10.0.0.1 10.0.0.2 Ϋϥελ͔ΒΓ͠ consul maint -enable
ॲཧܥ·ͱΊ Stealͷൃੜ͔ͭ ϩʔυΞϕϨʔδͷ্ঢ ࠷దͳ؋ͷબఆ Ϋϥελ͔ΒͷΓ͠ ϥΠϒϚΠάϨʔγϣϯ ΫϥελͷΈࠐΈ ࣮ߦڥͱͯ͠OpenStackͷ্Ͱಈ͘ Kubernetesͷதͷpodͱͯ͠ɺ Reconciliation
loopͬΆ͘ಈ͍͍ͯΔ
ຊʹ͋ͬͨා͍
ʮεʔύʔˑϥΠϒϚΠάϨʔγϣϯ ಈ͍ͯΔΜͰ͚͢ͲɺϨΠςϯγ ߴ͍ΜͰ͢ΑͶʯ
ϥΠϒϚΠάϨʔγϣϯ͕ଳҬΛ৯͍Δ ͓ன͔Βഁ໓!!1
ϥΠϒϚΠάϨʔγϣϯ(࠶ܝ) Hypervisor Hypervisor VM1 Disk Memory VM1 Disk STEP 1
σΟεΫΛಉظ ※ڞ༗ετϨʔδΛར༻͍ͯ͠ͳ͍߹ ʊਓਓਓਓʊ ʼɹ500Gɹʻ ʉY^Y^Y^Y^ʉ
None
None
·ͱΊ ྡਓΛࣗͰεέδϡʔϥʔॻ͘͜ͱͰղܾͨ͠ OSSʹ͢ΔͱdeschedulerͷΑ͏ͳநʹͳΔͷͰɺ ࠓճެ։͠ͳ͔ͬͨ ϥΠϒϚΠάϨʔγϣϯҙ֎ͱଳҬ৯͏ͷͰɺωοτϫʔΫΛͯ͠ ϨʔτϦϛοτೖΕͨ΄͏͕͍͍
ଟɺձʹ͍ΔͷͰɺ టʹͳΓ·͠ΐ͏ʂʂʂ
None
͓͠·͍ ࠷৽ͷ࠾༻ใΛνΣοΫˠ !QC@SFDSVJU