Vultr で Disk image をアップロードする場合

Table of contents

No heading

No headings in the article.

Vultr に Disk image をアップロードして使うことがあるのでメモ VUltr に Disk image を登録するためには http でアクセスできるようにして RAW image でなければならないので、 qcow2 のイメージを変換して http でアクセスできるようにしなければならない

Best Practices when Migrating to Vultr - Vultr.com (日本語)

  • 適当にサーバーを立てる
  • Cumulus のサイトから KVM のイメージをダウンロードする
    • SUM256: 064fd2f767b36df871e70885b40141be76a903e063a0ba30fbf4dfa4f0a8ee4b
cat <<EOF> cumulus-linux-5.1.0-vx-amd64-qemu.sha256sum
064fd2f767b36df871e70885b40141be76a903e063a0ba30fbf4dfa4f0a8ee4b  cumulus-linux-5.1.0-vx-amd64-qemu.qcow2
EOF

wget https://d2cd9e7ca6hntp.cloudfront.net/public/CumulusLinux-5.1.0/cumulus-linux-5.1.0-vx-amd64-qemu.qcow2

sha256sum -c cumulus-linux-5.1.0-vx-amd64-qemu.sha256sum
  • qemu-img コマンドをインストール
apt install -y qemu-utils
  • 変換
qemu-img convert -f qcow2 -O raw cumulus-linux-5.1.0-vx-amd64-qemu.qcow2 cumulus-linux-5.1.0-vx-amd64-qemu.img
  • nginx をインストール
apt install -y nginx
  • ufw を開放
ufw allow 80/tcp

ufw status verbose
  • イメージを配置
mv -v cumulus-linux-5.1.0-vx-amd64-qemu.img /var/www/html/cumulus-linux-5.1.0-vx-amd64-qemu.img

echo "http://$(curl -sfSL ifconfig.me)/cumulus-linux-5.1.0-vx-amd64-qemu.img"