ISUCON13の過去問を解くための環境構築
Table of Contents
12月にISUCON14に参戦することが決まったのでISUCONの過去問を解きたい
経緯
去年参加できなかったISUCONに、今年は念願叶って出場できることになったので、過去問を解くことにした。
環境構築手順は公式にあるのでこれに従っておけばよい。

ISUCONの過去問にチャレンジするためのシンプルな環境構築 : ISUCON公式Blog
Vagrantfileをmatsuuさんが公開してくださっているので、今回はそれを使う。

GitHub - matsuu/vagrant-isucon: ISUCON過去問を構築するためのVagrantfile集
トラブル
Vagrantfile
内のconfig.vm.network
の設定を適当なIPに変更してvagrant up
すると以下のエラーが。
The machine <vmname> is already locked by a session (or being locked or unlocked)

VM in virtualbox is already locked for a session (or being unlocked)
上のサイトによると、
VBoxManage startvm <vm-uuid> --type emergencystop
すると治るらしいと書いてあったので、VBoxManage list vms
して出てきたvmのUUIDを埋め込んで実行すると治った。
続いて、以下のエラーが発生。
VT-x is disabled in the BIOS for both all CPU modes
VT-xは以前、確かに有効化した記憶があったので、何で無効化されてるんだと訝しみながら再度設定。 マザボの電池切れとかだと面倒だな。
その後、vagrant up
が問題なく動き出したと思ったら、今度はsnap install go
でエラーが起きていた。
...
default: Preparing to unpack .../nodejs_20.18.0-1nodesource1_amd64.deb ...
default: Unpacking nodejs (20.18.0-1nodesource1) ...
default: Setting up nodejs (20.18.0-1nodesource1) ...
default: Processing triggers for man-db (2.10.2-1) ...
default: NEEDRESTART-VER: 3.5
default: NEEDRESTART-KCUR: 5.15.0-91-generic
default: NEEDRESTART-KEXP: 5.15.0-91-generic
default: NEEDRESTART-KSTA: 1
default: NEEDRESTART-SVC: ssh.service
default: ++ snap install go --channel=1.21/stable --classic
default: error: too early for operation, device not yet seeded or device model not acknowledged
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
エラーの内容的にsleep 600
挟めばいけるやろ、と思って入れてみたら本当に治った。
後で思ったことだが、数分待ってvagrant provision
とかでもいけてたのかな。
この後無事立ち上がったので/etc/hosts
に{先程設定したIP} pipe.u.isucon.local
のエントリを追加して、ブラウザからhttps://pipe.u.isucon.local
へアクセス。

めでたしめでたし。
おわりに
本番までに5年分は解いておきたいなという希望的観測。
Read other posts