ベアメタルのつくりかた

 ベアメタルのつくりかた

NTT Engineers' Festa #2で発表しました。
Enterprise Cloud 2.0 ベアメタルの仕組み・裏側についてご紹介。

80aa531a501c1787edd964c8cc28f32c?s=128

Akihiko Horiuchi

February 06, 2019
Tweet

Transcript

  1. ϕΞϝλϧͷͭ͘Γ͔ͨ !IJDPOZBO

  2. ΋͘͡ ͸͡Ίʹ ϕΞϝλϧͬͯԿʁ ϕΞϝλϧͷ࢓૊Έ ϕΞϝλϧͷཪଆ ͓ΘΓʹ  

  3. ͸͡Ίʹ

  4. ࣗݾ঺հ ງ಺Ᏼ඙ ΄Γ͏͖ͪ͋ͻ͜ /55ίϛϡχέʔγϣϯζ Ϋϥ΢υαʔϏε෦ ೖࣾ೥໨ͷϐνϐνιϑτ΢ΣΞΤϯδχΞ ϕΞϝλϧ։ൃνʔϜͰεΫϥϜϚελʔ΍ͬͯ·͢  

  5. ࠓ೔஌ͬͯཉ͍͜͠ͱ w ϕΞϝλϧͷϢʔεέʔε w 19&,JDLTUBSUͷ͘͠Έ w ෺ཧαʔόͷιϑτ΢ΣΞΠϯςάϨʔγϣϯ w େن໛ͳίϯϙʔωϯτͷߏ੒؅ཧ 

    
  6. ϕΞϝλϧͬͯԿʁ

  7. ʲϕΞϝλϧʳ ണ͖ग़͠ͷۚଐͱ͍͏ҙຯ Կ΋Πϯετʔϧ͞Ε͍ͯͳ͍෺ཧαʔόͷ͜ͱ

  8. ෺ཧαʔόΛ࢖͏ʹ͸ ਅ໘໨ʹϓϩμΫγϣϯͰ࢖͓͏ͱ͢Δͱ w ॳظ౤ࢿ͕େ͖͍ͷͰ͓͕ۚʜ w ϥοΫΛઃஔͰ͖Δεϖʔε͸ʜ w ωοτϫʔΫͱిݯͷ৑௕͸ʜ w ϋʔυ΢ΣΞͷอक͸ʜ

    ࣗ෼Ͱߏஙͨ͠Γӡ༻ͨ͠Γ͢Δͷ͸େมʂ    
  9. ϕΞϝλϧΫϥ΢υ w ෺ཧαʔόΛͦͷ··ఏڙ͢Δ w Ծ૝αʔόͷΑ͏ʹ؆୯ʹɾ͙͢ʹ࡞ΕΔ w ઎༗ͯ͠ϋΠύʔόΠβͱͯ͠࢖͑Δ w ύʔπ͕ނোͨ͠ͱ͖ͷमཧ΋αϙʔτ ୅දతͳαʔϏε͸

    &OUFSQSJTF$MPVEɺ*#.$MPVEɺ1BDLFU  
  10. &$-ͷϕΞϝλϧ ݁ߏ͕Μ͹ͬͯ·͢ʂ  w ੈքϦʔδϣϯʹల։ w ඪ४ߏ੒Ͱ୆ ԁ݄
 ʢ$16ίΞ ɺϝϞϦ(#ɺ44%(#ʷʣ

    w ઎༗ܕϋΠύʔόΠβ΋͋ΔΑ  
  11.   ϕΞϝλϧαʔό εΠον εΠον ϩδΧϧωοτϫʔΫ ʢ4%/ʣ (MBODF 8JOEPXTɺ&49Jɺ 3)&-ɺ6CVOUVͳͲ

    3$" 71/ܦ༝Ͱ
 #.$ʹΞΫηε ετϨʔδ
  12.  

  13. ϕΞϝλϧͷ࢓૊Έ

  14. αʔόΛ࡞Δͱ͖ ͍͍ͩͨ͜Μͳײ͡ʢʙ෼ʣ  (MBODF͔ΒΠϝʔδΛμ΢ϯϩʔυ  04Πϯετʔϧ༻ͷઃఆΛੜ੒  19&ͰωοτϫʔΫϒʔτ  ,JDLTUBSUͰ04ΛΠϯετʔϧ

     DMPVEJOJUͰωοτϫʔΫઃఆ    
  15.   $IBTTJT  $POUSPMMFS %)$1"HFOU $POEVDUPS .POJUPS  3BCCJU.2

    (6*$-* 3&45"1* "QBDIF 5'51E %)$1E  (MBODF ʢʣ*NBHF %PXOMPBE *1.* /*$ ʢʣ"EE&OUSZ ʢʣ$IBOHF#PPU0SEFS1PXFS0O
  16.   $IBTTJT  $POUSPMMFS %)$1"HFOU $POEVDUPS .POJUPS  3BCCJU.2

    (6*$-* 3&45"1* "QBDIF 5'51E %)$1E *1.* /*$ ʢʣ/PUJGZ19&4FSWFS BU%)$10''&3 ʢʣ(FU/#1'JMF #PPU*NBHF #!ipxe kernel http://.../ubuntu/install/netboot/ubuntu-installer/amd64/linux initrd http://.../ubuntu/install/netboot/ubuntu-installer/amd64/initrd.gz imgargs linux initrd=initrd.gz auto=true fb=false priority=critical preseed/url=http://.../ubuntu/16-04-1_64/01-23-45-67-89/preseed.cfg ks=http://.../ubuntu/16-04-1_64/01-23-45-67-89/ks.cfg boot
  17. ͜ΕΛ    

  18. ͜͏     d-i debian-installer/locale string en_US d-i

    debian-installer/add-kernel-opts string nomod... d-i clock-setup/utc boolean true d-i time/zone string UTC d-i netcfg/choose_interface select 01:23:45:67:89... d-i netcfg/get_nameservers string none d-i netcfg/get_ipaddress string 10.1.0.2 d-i netcfg/get_netmask string 255.255.255.0 d-i netcfg/get_gateway string none d-i netcfg/get_hostname string ubuntu1604 d-i partman-lvm/device_remove_lvm boolean true d-i partman-lvm/device_remove_lvm_span boolean true d-i partman-md/device_remove_md boolean true d-i partman-auto/purge_lvm_from_device boolean t... ...
  19.   $IBTTJT  $POUSPMMFS %)$1"HFOU $POEVDUPS .POJUPS  3BCCJU.2

    (6*$-* 3&45"1* ʢʣ"EE.POJUPSJOH5BSHFU
 ʢ3&45"1*ʣ "QBDIF 5'51E %)$1E  (MBODF *1.* /*$ ʢʣ.POJUPSCZ*1.*4/.1FUD
 ʢ&WFSZTʣ
  20. αʔόΛফ͢ͱ͖ ͍͍ͩͨ͜Μͳײ͡ʢ෼ʣ  ωοτϫʔΫΛ࡟আ  ϑΝʔϜ΢ΣΞΛόʔδϣϯΞοϓ  σΟεΫΛॳظԽʢ;FSP'JMMʣ  6&'*ͱ#.$ͷઃఆΛॳظԽ

       
  21. #.$ʹ͍ͭͯ ϕϯμʹΑͬͯΠϯλϑΣʔε͕ҧ͏ w )1&ɿ J-0 w %&--ɿ J%3"$ w 'VKJUTVɿJ3.$

    ඪ४Խͱͯ͠*1.*ʢʙʣͱ 3FEpTIʢʙʣ͕͋Δ    
  22. ϒʔτΦʔμΛมߋ PATCH /redfish/v1/Systems/System.Embedded.1/BootSources/Settings     { "Attributes": {

    "UefiBootSeq": [ { "Name": "NIC.PxeDevice.1-1", "Index": 0, "Id": "BIOS.Setup.1-1#UefiBootSeq#NIC.P...", "Enabled": true }, { "Name": "AHCI.Slot.2-1", "Index": 1, "Id": "BIOS.Setup.1-1#UefiBootSeq#AHCI....", "Enabled": true }, ...
  23. $16ͷεςʔλεΛ؂ࢹ GET /redfish/v1/Systems/System.Embedded.1     { "ProcessorSummary": {

    "Status": { "State": "Enabled", "HealthRollup": "OK", "Health": "OK" }, "Model": "Intel(R) Xeon(R) Gold 6132 CPU @ ...", "Count": 2 }, }
  24. ϕΞϝλϧͷཪଆ

  25. *SPOJD͸࢖Θͣʹɺ3VCZͰεΫϥον։ൃ ʢ4JOBUSBɺ"DUJWF3FDPSEɺ4JEFLJRʣ ίϯϙʔωϯτͷߏ੒     $POUSPMMFS %)$1"HFOU $IBTTJT

    ,FZTUPOF (MBODF $POEVDUPS .POJUPS GPS&BDI(SPVQT
  26. #MVF(SFFO%FQMPZNFOU "OTJCMFͱ4FSWFSTQFDͰߏ੒؅ཧ σϓϩΠͷ΍Γํ    

  27. 4ZTUFN ʢ$POTVM%$ʣ 4ZTUFN ʢ$POTVM%$ʣ  -#  +FOLJOT  

    'MVFOUE &MBTUJDTFBSDI *OqVY%# (SBGBOB ,JCBOB 4ZTUFN ʢʣ6QEBUF4PGUXBSFCZ"OTJCMF ʢʣ$SFBUF%FMFUF4FSWFS BT4DFOBSJP5FTU
  28. 4ZTUFN ʢ$POTVM%$ʣ 4ZTUFN ʢ$POTVM%$ʣ  -#  +FOLJOT  

    'MVFOUE &MBTUJDTFBSDI *OqVY%# (SBGBOB ,JCBOB 4ZTUFN ʢʣ4UBSU"QQMJDBUJPOT ʢʣ4UPQ"QQMJDBUJPOT ʢʣ$IBOHF$POTVM%$
  29. σϓϩΠͷ༷ࢠ    

  30. ͓ΘΓʹ

  31. ࠓ೔஌ͬͯཉ͔ͬͨ͜͠ͱ w ϕΞϝλϧͷϢʔεέʔε w 19&,JDLTUBSUͷ͘͠Έ w ෺ཧαʔόͷιϑτ΢ΣΞΠϯςάϨʔγϣϯ w େن໛ͳίϯϙʔωϯτͷߏ੒؅ཧ ஌ͬͯ௖͚·͔ͨ͠ʜʁ

     
  32. ·ͱΊ w ϑϧελοΫͳͷͰਏ͍͚Ͳָ͍͠ w ෺ཧʙϛυϧ΢ΣΞʙΞϓϦ·Ͱ w ৭Μͳϕϯμͷαʔό৮ΕΔͷͰָ͍͠ w )1&ɺ%&--ɺ'VKJUTVɺ4VQFSNJDSP w

    ίϯϙʔωϯτ͕ଟ͍ͷͰσϓϩΠ͕ͭΒ͍ w དྷ೥౓தʹίϯςφԽɾ(,&Ҡߦ͍ͨ͠  
  33. 8FSF)JSJOH