NTNX>日記

個人的な趣味による Nutanix Community Edition 日記。Japanese のみですみません。

Nutanix CE で Acropolis Container Services (ACS) 。Part.3

今回は、Docker Data Volume の Nutanix Volume Plug-In をセットアップして、Docker コンテナを起動をしてみます。 

前回はこちら。

前回作成した Docker Host VM「docker-vm-01」が起動しています。

[gowatana@vm01 bin]$ docker-machine ls
NAME           ACTIVE   DRIVER    STATE     URL                     SWARM   DOCKER    ERRORS
docker-vm-01   -        nutanix   Running   tcp://10.1.1.204:2376           v1.12.2

 

Docker Host VM へのログイン

Docker Machine を実行したクライアントから、Docker Host VM「docker-vm-01」に SSH でログインします。

[gowatana@vm01 bin]$ docker-machine ssh docker-vm-01
Last login: Sat Oct 15 20:41:53 2016 from 10.1.1.6
[root@docker-vm-01 ~]#

Nutanix Volume Plug-In のセットアップ

Docker Host で、root ユーザのホーム ディレクトリに配置されている「 start-volume-plugin.sh 」スクリプトを実行します。実行すると、自動的に orionapps/vol-plugin コンテナ イメージが Docker Hub からダウンロードされ、対話形式で設定値(下記)を入力することになります。

  • Enter prism ip address: 10.1.1.12 → Nutanix Cluster VIP を指定。
  • Enter Dataservices ip address: 10.1.1.13 → Nutanix ABS の Data Services IP を指定。
  • Enter prism username: admin
  • Enter prism password: → admin のパスワード。
  • Enter nutanix container where you want persistent volumes: cont01 → Nutanix DSF コンテナを指定。(Docker ではなく、分散ストレージのコンテナ)
[root@docker-vm-01 ~]# ./start-volume-plugin.sh
Starting Nutanix volume plugin container...
Updating volume plugin...
Using default tag: latest
latest: Pulling from orionapps/vol-plugin
a3ed95caeb02: Pull complete
252d14f3318a: Pull complete
5f1ff6e864de: Pull complete
Digest: sha256:0cacc3ca875770975afbf26cef9386b34d031665a36331bf1aeb60a06e5a9901
Status: Downloaded newer image for orionapps/vol-plugin:latest
Redirecting to /bin/systemctl restart  docker.service
Enter prism ip address: 10.1.1.12
Enter Dataservices ip address: 10.1.1.13
Enter prism username: admin
Enter prism password:
Enter nutanix container where you want persistent volumes: cont01
prism ip address      : 10.1.1.12
dataservice ip address: 10.1.1.13
prism username        : admin
default container     : cont01
8bcc08ecd1d84d7d818836563d062e401c4d1b45c9678508cc5ff8727de34732
[root@docker-vm-01 ~]#

Nutanix Volume Plug-In のコンテナが起動しました。

[root@docker-vm-01 ~]# docker ps -a
CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS              PORTS               NAMES
8bcc08ecd1d8        orionapps/vol-plugin   "/code/scripts/docker"   58 seconds ago      Up 53 seconds                           NutanixVolumePlugin

Data Volume をもつ Docker コンテナの起動 

Nutanix Volume を接続する Docker コンテナを起動すると、約 10GB の 2つめのボリューム(/dev/sdb)が /u01 にマウントされました。

  • --volume-driver nutanix → Nutanix Volume Plug-In を使用します。
  • -v ntnx-vg01:/u01 → ntnx-vg01 という Volume (Nutanix ABS VG) をコンテナの /u01 にマウントします。
[root@docker-vm-01 ~]# docker run -it --volume-driver nutanix --name ct01 -v ntnx-vg01:/u01 oraclelinux
[root@443346bfeeb1 /]# df /u01
Filesystem     1K-blocks  Used Available Use% Mounted on
/dev/sdb        10190100 36892   9612536   1% /u01

Prism でも、 10GiB の vDisk を 1つもつ VG「ntnx-vg01」が作成されたことがわかります。

f:id:gowatana:20161016183338p:plain

まだつづく。

©2023 gowatana
クリエイティブ・コモンズ・ライセンスこの 作品 は クリエイティブ・コモンズ 表示 4.0 国際 ライセンスの下に提供されています。