CRIUをホスティングで試していく #hostingcasual / My CRIU Life in Progress

CRIUをホスティングで試していく #hostingcasual / My CRIU Life in Progress

@ホスティングカジュアル #5
直近のイベント宣伝等を抜いています。

2cf373725ded741824c50fd571eda6e1?s=128

KONDO Uchio

March 22, 2019
Tweet

Transcript

  1. 4.
  2. 6.
  3. 9.
  4. 10.

    Memory dump Network conf File descriptors cgroup params ...... CRIU

    Target
 process Syscalls, /proc files ... Kernel $3*6ͰΠϝʔδΛ࡞੒ɺ͔ͦ͜Βىಈ ˞ࢀߟ
  5. 18.
  6. 19.

    ϦετΞ͞ΕͨϓϩηεΛɺ )BDPOJXBͷԼʹ໭͍ͨ͠ɻ Haconiwa sv-sv \- criu restore \- Container Haconiwa

    sv-sv \- Haconiwa sv \- Container ௨ৗىಈ CRIUܦ༝ͷىಈ ϑοΫॲཧ͸ ओʹ͜͜Ͱߦ͏ ʁʁʁ
  7. 20.

    ํ๏  TXSLNPEF SFTUPSFTJCMJOH shd: vagrant@pts/0 \_ -bash \_ sudo

    ../mruby/bin/mruby example/restore_child.rb \_ ../mruby/bin/mruby example/restore_child.rb <- libcriuΛݺͼग़ͨ͠mruby script \_ /usr/local/apache2/bin/httpd -DFOREGROUND -X <- ͜Ε͕ίϯςφϓϩηε \_ /usr/local/sbin/criu swrk 6 <- ͜Ε͕swrkϞʔυͰ্ཱ͕ͪͬͨαʔϏεͰɺ cr_restore_tasks() ͸͜͜ͰಡΜͰ͍Δ \_ sh -c ps auxf <- ֬ೝͷͨΊʹ system() ͨ͠΋ͷ \_ ps auxf
  8. 22.

    DMPOF $-0/&@1"3&/5 $ ./clone-tarou parent --use-clone-parent [!] Hey, maybe a

    new sibling is added 26627 pts/1 S+ 0:00 \_ ./clone-tarou parent --use-clone-parent 26628 pts/1 S+ 0:00 \_ clone-tarou tarou --use-clone-parent 26629 pts/1 S+ 0:00 \_ clone-tarou jirou [!] exit: PID=26628 [!] exit: PID=26629 <DMPOFͷ$-0/&@1"3&/5ϑϥάͷڍಈΛ؍࡯͢Δ><ݕࡧ>
  9. 24.

    ํ๏  FYFDDNEͬͪ͜Λ࠾༻ Haconiwa sv \- criu restore \- Container

    Haconiwa sv \- haconiwa _restored \- Container FYFD XBJU wDSJVίϚϯυͰϦετΞ͔ͯ͠Βɺ೚ҙͷϓϩάϥϜʹFYFDWF Ͱ͖Δ wFYFDલʹGPSLͨ͠ϓϩηεΛɺ৽͍͠ϓϩάϥϜଆͰXBJU Ͱ͖Δ
  10. 25.

    &YUFSOBMCJOENPVOUରԠ /path/to/pivot_root `- / (bind-mount self) `- /etc -> /other/etc

    `- /home/foo -> /other2/home `- /var/log -> /other3/log wSPPUGTͷ֎ଆʹ͋ΔϑΝΠϧγεςϜSPPUΛCJOENPVOUͯ͠ɺ
 DISPPUQJWPU@SPPU  ͔ͯ͠Β΋࢖͑ΔΑ͏ʹ͢Δ͜ͱ͕Α͋͘Δ™ wͦ͏͍͏֎ଆͷϑΝΠϧγεςϜΛ$3*6͕ཧղͰ͖ΔΑ͏ʹ͢Δ ͜͜ʹpivot_root
  11. 31.

    Web Proxy Web Request Dispatcher FastContainer Runtime CMDB ❌ FastContainer

    Killed 1. Check 2. Boot 3. Forward 4. Terminate 'BTU3FNPUF$IFDLͱ͍͏ NHFNΛར༻ͯ͠଴͍ͬͯΔ͕ɺ ઃఆ͕มʁ
  12. 33.
  13. 35.
  14. 38.