LoginSignup
3
4

More than 5 years have passed since last update.

CoreOSを VMware ESXiにインストール

Posted at

ESXiにCoreOSをインストールしログインするまでの設定方法です

主な流れ

  • CoreOSをインストール
  • user_data を作成しiso化
  • 作成したisoをCoreOSからマウント

参考:Running CoreOS on VMware

CoreOS のインストール

  1. vSphere Clientから[ファイル]-[OVF テンプレートのデプロイ]を開きます
  2. 以下のURLを入力し[次へ] > https://stable.release.core-os.net/amd64-usr/current/coreos_production_vmware_ova.ova

3.VMの名前を入力し[次へ]
4.thin provision を選択し[次へ]

Cloud-config

  • 鍵を作る
$ ssh-keygen -t rsa
  • configdrive.isoの作成
mkdir -p ~/new-drive/openstack/latest
cd !$
vi user_data

cloud-configについてはcloud-configを参照

user_data
#cloud-config

# 先ほど作成した公開鍵もしくは自分の公開鍵を入力します
ssh_authorized_keys:
  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGdByTgSVHq.......
coreos:
  etcd2:
    discovery: https://discovery.etcd.io/<token>
    advertise-client-urls: http://$private_ipv4:2379,http://$private_ipv4:4001
    initial-advertise-peer-urls: http://$private_ipv4:2380
    listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
    listen-peer-urls: http://$private_ipv4:2380
  units:
    - name: etcd2.service
      command: start
    - name: fleet.service
      command: start

ユーザーを追加する場合は

user_data
users:
  - name: "elroy"
    passwd: "$6$5s2u6/jR$un0AvWnqilcgaNB3Mkxd5yYv6mTlWfOoCYHZmfi3LDKVltj.E8XNKEcwWm..."
    groups:
      - "sudo"
      - "docker"
    ssh-authorized-keys:
      - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g+ZTxC7weoIJLUafOgrm+h..."
cd ~
mkisofs -R -V config-2 -o configdrive.iso new-drive

configdrive.isoを読み込む

  1. vSphere Clientの[データストアブラウザ]からconfigdrive.isoを適当なところに配置
  2. 先ほどインストールしたCoreOSの[仮想マシンのプロパティ]から[ハードウェア]タブ→[CD/DVD ドライブ]→[データストアISOファイル]を選択し[参照]からconfigdrive.isoを選択します。
  3. [パワーオン時に接続]を忘れずに

これでssh core@10.0.0.1 -i ~/.ssh/秘密鍵でログインできるはずです。

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4