vSphere Integrated Containers (VIC) 1.0 をためしてみる。

vSphere Integrated Containers (VIC) 1.0 をためしてみる。

日本の vExpert による 2016 アドベントカレンダー 11日目のブログ投稿です。

vExperts Advent Calendar 2016 - Adventar

VMware vSphere Integrated Containers 1.0 が、とうとう GA になりました。

ドキュメント

VMware vSphere Integrated Containers Documentation

ダウンロード

VMware vSphere Integrated Containers Download

さっそく、下記のような構成で

vSphere Integrated Containers Engine (VIC Engine)をインストールしてみました。

VIC 1.0 に含まれる VIC Engine のバージョンは、0.8 です。

VCH Endpoint VM と Container VM には、VMware Photon OS が使用されています。

  • vCenter Server Applience 6.0 U2
  • ESXi 6.0 U2
  • DRS 有効。
  • 分散仮想スイッチ(vDS)を使用。
  • vSAN データストアを使用。
  • VIC Machine は、Windows 10 PC から実行。
  • docker コマンドは、Oracle Linux 7 から実行。

vE-Advent2016-VIC10GA.png

VIC Machine、docker コマンドは Windows / Linux / Mac から実行できます。

ちなみに Linux は Ubuntu でテストされているようですが、

偶然てもとの環境が Oracle Linux だったのでそれを使用しました。

1. Virtual Container Hosts (VCH) のデプロイ。

MyVMware サイトから、VIC Engine (vic_0.8.0-7315-c8ac999.tar.gz) をダウンロードして、C:\work に展開しました。

その中に含まれる vic-machine ユーティリティで VCH をデプロイします。

今回は、Windows 10 の PC から、VCH をデプロイしてみました。

PS C:\work\vic> dir

  ディレクトリ: C:\work\vic

Mode                LastWriteTime         Length Name

----                -------------         ------ ----

d-----       2016/12/11     13:46                ui

-a----       2016/12/04      4:30      127401984 appliance.iso

-a----       2016/12/04      4:30       65732608 bootstrap.iso

-a----       2016/12/04      4:29         209570 LICENSE

-a----       2016/12/04      4:29             57 README

-a----       2016/12/04      4:29       35095088 vic-machine-darwin

-a----       2016/12/04      4:29       35557968 vic-machine-linux

-a----       2016/12/04      4:29       35261952 vic-machine-windows.exe

-a----       2016/12/04      4:29       31672144 vic-ui-darwin

-a----       2016/12/04      4:29       31972920 vic-ui-linux

-a----       2016/12/04      4:29       31675392 vic-ui-windows.exe

Windows 用の vic-machine を使用します。

PS C:\work\vic> .\vic-machine-windows.exe

NAME:

   vic-machine-windows.exe - Create and manage Virtual Container Hosts


USAGE:

   vic-machine-windows.exe [global options] command [command options] [arguments...]


VERSION:

   v0.8.0-7315-c8ac999


COMMANDS:

     create   Deploy VCH

     delete   Delete VCH and associated resources

     ls       List VCHs

     inspect  Inspect VCH

     version  Show VIC version information

     debug    Debug VCH


GLOBAL OPTIONS:

   --help, -h     show help

   --version, -v  print the version

それでは、VCH をデプロイします。

今回の vCenter のアドレスは 192.168.1.82 です。

VCH から vCenter の名前解決ができないとエラーになるので、今回は IP アドレスで指定しています。

実行結果から、VCH に付与された IP アドレスがわかります。

下記の例では未設定ですが、vic-machine 実行前に、ESXi Firewall ルールを開放しておきます。

vSphere Integrated Containers (VIC) 1.0 むけの ESXi Firewall Rule 設定。

PS C:\work\vic> .\vic-machine-windows.exe create --target 192.168.1.82 --user "administrator@vsphere.local" --password <パスワード> --compute-resource cluster-vsan01 --bridge-network vic-bridge --public-network dvpg-vlan-0000 --image-store vsanDatastore --no-tlsverify --force

[34mINFO[0m[2016-12-11T17:02:29+09:00] ### Installing VCH ####

[33mWARN[0m[2016-12-11T17:02:29+09:00] Using administrative user for VCH operation - use --ops-user to improve security (see -x for advanced help)

[34mINFO[0m[2016-12-11T17:02:29+09:00] Loaded server certificate virtual-container-host\server-cert.pem

[33mWARN[0m[2016-12-11T17:02:29+09:00] Configuring without TLS verify - certificate-based authentication disabled

[34mINFO[0m[2016-12-11T17:02:29+09:00] Validating supplied configuration

[34mINFO[0m[2016-12-11T17:02:29+09:00] vDS configuration OK on "vic-bridge"

[34mINFO[0m[2016-12-11T17:02:29+09:00] Firewall status: ENABLED on "/dc01/host/cluster-vsan01/hv-i21.godc.lab"

[33mWARN[0m[2016-12-11T17:02:29+09:00] Firewall configuration on "/dc01/host/cluster-vsan01/hv-i21.godc.lab" may prevent connection on dst 2377/tcp outbound with allowed IPs: [192.168.51.239 192.168.51.161]

[34mINFO[0m[2016-12-11T17:02:29+09:00] Firewall status: ENABLED on "/dc01/host/cluster-vsan01/hv-i22.godc.lab"

[33mWARN[0m[2016-12-11T17:02:29+09:00] Firewall configuration on "/dc01/host/cluster-vsan01/hv-i22.godc.lab" may prevent connection on dst 2377/tcp outbound with allowed IPs: [192.168.51.161 192.168.51.239]

[34mINFO[0m[2016-12-11T17:02:29+09:00] Firewall status: ENABLED on "/dc01/host/cluster-vsan01/hv-i23.godc.lab"

[33mWARN[0m[2016-12-11T17:02:29+09:00] Firewall configuration on "/dc01/host/cluster-vsan01/hv-i23.godc.lab" may prevent connection on dst 2377/tcp outbound with allowed IPs: [192.168.51.161 192.168.51.239]

[33mWARN[0m[2016-12-11T17:02:29+09:00] Unable to fully verify firewall configuration due to DHCP use on management network

[33mWARN[0m[2016-12-11T17:02:29+09:00] VCH management interface IP assigned by DHCP must be permitted by allowed IP settings

[33mWARN[0m[2016-12-11T17:02:29+09:00] Firewall allowed IP configuration may prevent required connection on hosts:

[33mWARN[0m[2016-12-11T17:02:29+09:00] "/dc01/host/cluster-vsan01/hv-i21.godc.lab"

[33mWARN[0m[2016-12-11T17:02:29+09:00] "/dc01/host/cluster-vsan01/hv-i22.godc.lab"

[33mWARN[0m[2016-12-11T17:02:29+09:00] "/dc01/host/cluster-vsan01/hv-i23.godc.lab"

[34mINFO[0m[2016-12-11T17:02:29+09:00] Firewall must permit dst 2377/tcp outbound to the VCH management interface

[34mINFO[0m[2016-12-11T17:02:30+09:00] License check OK on hosts:

[34mINFO[0m[2016-12-11T17:02:30+09:00] "/dc01/host/cluster-vsan01/hv-i21.godc.lab"

[34mINFO[0m[2016-12-11T17:02:30+09:00] "/dc01/host/cluster-vsan01/hv-i22.godc.lab"

[34mINFO[0m[2016-12-11T17:02:30+09:00] "/dc01/host/cluster-vsan01/hv-i23.godc.lab"

[34mINFO[0m[2016-12-11T17:02:30+09:00] DRS check OK on:

[34mINFO[0m[2016-12-11T17:02:30+09:00] "/dc01/host/cluster-vsan01/Resources"

[34mINFO[0m[2016-12-11T17:02:30+09:00]

[34mINFO[0m[2016-12-11T17:02:30+09:00] Creating virtual app "virtual-container-host"

[34mINFO[0m[2016-12-11T17:02:31+09:00] Creating appliance on target

[34mINFO[0m[2016-12-11T17:02:31+09:00] Network role "client" is sharing NIC with "public"

[34mINFO[0m[2016-12-11T17:02:31+09:00] Network role "management" is sharing NIC with "public"

[34mINFO[0m[2016-12-11T17:02:34+09:00] Uploading images for container

[34mINFO[0m[2016-12-11T17:02:34+09:00] "bootstrap.iso"

[34mINFO[0m[2016-12-11T17:02:34+09:00] "appliance.iso"

[34mINFO[0m[2016-12-11T17:02:46+09:00] Waiting for IP information

[34mINFO[0m[2016-12-11T17:03:02+09:00] Waiting for major appliance components to launch

[34mINFO[0m[2016-12-11T17:03:02+09:00] Checking VCH connectivity with vSphere target

[34mINFO[0m[2016-12-11T17:03:03+09:00] vSphere API Test: https://192.168.1.82 vSphere API target responds as expected

[34mINFO[0m[2016-12-11T17:03:16+09:00] Initialization of appliance successful

[34mINFO[0m[2016-12-11T17:03:16+09:00]

[34mINFO[0m[2016-12-11T17:03:16+09:00] VCH Admin Portal:

[34mINFO[0m[2016-12-11T17:03:16+09:00] https://192.168.1.5:2378

[34mINFO[0m[2016-12-11T17:03:16+09:00]

[34mINFO[0m[2016-12-11T17:03:16+09:00] Published ports can be reached at:

[34mINFO[0m[2016-12-11T17:03:16+09:00] 192.168.1.5

[34mINFO[0m[2016-12-11T17:03:16+09:00]

[34mINFO[0m[2016-12-11T17:03:16+09:00] Docker environment variables:

[34mINFO[0m[2016-12-11T17:03:16+09:00] DOCKER_HOST=192.168.1.5:2376

[34mINFO[0m[2016-12-11T17:03:16+09:00]

[34mINFO[0m[2016-12-11T17:03:16+09:00] Environment saved in virtual-container-host/virtual-container-host.env

[34mINFO[0m[2016-12-11T17:03:16+09:00]

[34mINFO[0m[2016-12-11T17:03:16+09:00] Connect to docker:

[34mINFO[0m[2016-12-11T17:03:16+09:00] docker -H 192.168.1.5:2376 --tls info

[34mINFO[0m[2016-12-11T17:03:16+09:00] Installer completed successfully

PS C:\work\vic>

この先の Docker コマンドのアクセスで、デプロイした VCH の IP アドレスをエンドポイントとして指定します。

VCH の IP アドレスは後から確認することもできます。

vCenter の thumbprint を指定しないとエラーになるので・・・

PS C:\work\vic> .\vic-machine-windows.exe ls --target 192.168.1.82 --user "administrator@vsphere.local" --password <パスワード> --compute-resource cluster-vsan01

[34mINFO[0m[2016-12-11T17:47:38+09:00] ### Listing VCHs ####

[31mERRO[0m[2016-12-11T17:47:38+09:00] Failed to verify certificate for target=192.168.1.82 (thumbprint=A4:98:53:2F:68:11:01:06:08:48:AD:68:33:95:0D:6F:30:10:4D:D1)

[31mERRO[0m[2016-12-11T17:47:38+09:00] List cannot continue - failed to create validator: x509: certificate signed by unknown authority

[31mERRO[0m[2016-12-11T17:47:38+09:00] --------------------

[31mERRO[0m[2016-12-11T17:47:38+09:00] vic-machine-windows.exe failed: list failed

thumbprint を指定して「vic-machine-windows ls」コマンドを実行します。

VCH の仮想アプライアンスが VM (vm-527) としてデプロイされていることが分かります。

PS C:\work\vic> .\vic-machine-windows.exe ls --target 192.168.1.82 --user "administrator@vsphere.local" --password <パスワード> --compute-resource cluster-vsan01 --thumbprint A4:98:53:2F:68:11:01:06:08:48:AD:68:33:95:0D:6F:30:10:4D:D1

[34mINFO[0m[2016-12-11T17:48:00+09:00] ### Listing VCHs ####

[34mINFO[0m[2016-12-11T17:48:00+09:00] Validating target

[34mINFO[0m[2016-12-11T17:48:00+09:00] Validating compute resource

ID            PATH                                       NAME                          VERSION

vm-527        /dc01/host/cluster-vsan01/Resources        virtual-container-host        v0.8.0-7315-c8ac999

エンドポイント のアドレスも確認できます。

PS C:\work\vic> .\vic-machine-windows.exe inspect --target 192.168.1.82 --user "administrator@vsphere.local" --password <パスワード> --compute-resource cluster-vsan01 --thumbprint A4:98:53:2F:68:11:01:06:08:48:AD:68:33:95:0D:6F:30:10:4D:D1

[34mINFO[0m[2016-12-11T17:50:09+09:00] ### Inspecting VCH ####

[34mINFO[0m[2016-12-11T17:50:09+09:00]

[34mINFO[0m[2016-12-11T17:50:09+09:00] VCH ID: VirtualMachine:vm-527

[34mINFO[0m[2016-12-11T17:50:09+09:00]

[34mINFO[0m[2016-12-11T17:50:09+09:00] Installer version: v0.8.0-7315-c8ac999

[34mINFO[0m[2016-12-11T17:50:09+09:00] VCH version: v0.8.0-7315-c8ac999

[33mWARN[0m[2016-12-11T17:50:10+09:00] Unable to identify address acceptable to host certificate

[34mINFO[0m[2016-12-11T17:50:10+09:00]

[34mINFO[0m[2016-12-11T17:50:10+09:00] VCH Admin Portal:

[34mINFO[0m[2016-12-11T17:50:10+09:00] https://192.168.1.5:2378

[34mINFO[0m[2016-12-11T17:50:10+09:00]

[34mINFO[0m[2016-12-11T17:50:10+09:00] Published ports can be reached at:

[34mINFO[0m[2016-12-11T17:50:10+09:00] 192.168.1.5

[34mINFO[0m[2016-12-11T17:50:10+09:00]

[34mINFO[0m[2016-12-11T17:50:10+09:00] Docker environment variables:

[34mINFO[0m[2016-12-11T17:50:10+09:00] DOCKER_HOST=192.168.1.5:2376

[34mINFO[0m[2016-12-11T17:50:10+09:00]

[34mINFO[0m[2016-12-11T17:50:10+09:00] Connect to docker:

[34mINFO[0m[2016-12-11T17:50:10+09:00] docker -H 192.168.1.5:2376 --tls info

[34mINFO[0m[2016-12-11T17:50:10+09:00] Completed successfully

PS C:\work\vic>

VCH は、vApp としてデプロイされます。デフォルトでは、

「virtual-container-host」という名前の vApp に、

「virtual-container-host」という名前(vApp と同名)の VCH Endpoint VM がデプロイされます。

vic-10ga-11.png


VCH Endpoint VM は、ISO ブートになっています。

vic-10ga-12.png

2. Docker コンテナの起動。

docker コマンドで、コンテナを起動してみます。

今回は、Oracle Linux 7 から VCH Endpoint にアクセスしています。

クライアントとして使用する Docker は、Oracle Linux Public Yum サーバにある RPM でインストールしたものです。

[gowatana@client01 ~]$ cat /etc/oracle-release

Oracle Linux Server release 7.3

[gowatana@client01 ~]$ docker -v

Docker version 1.12.2, build a8c3fe4

VCH のエンドポイントを指定して docker コマンドを実行します。

クライアント側とサーバ側とで API バージョンが異なり、エラーになるので・・・

[gowatana@client01 ~]$ docker -H 192.168.1.5:2376 --tls info

Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.23)

環境変数「DOCKER_API_VERSION」を指定すると、docker コマンドが実行できるようになります。

docker info コマンドで、VCH 側の Docker の情報が表示されます。

[gowatana@client01 ~]$ export DOCKER_API_VERSION=1.23

[gowatana@client01 ~]$ docker -H 192.168.1.5:2376 --tls info

Containers: 0

Running: 0

Paused: 0

Stopped: 0

Images: 0

Server Version: v0.8.0-7315-c8ac999

Storage Driver: vSphere Integrated Containers v0.8.0-7315-c8ac999 Backend Engine

VolumeStores:

vSphere Integrated Containers v0.8.0-7315-c8ac999 Backend Engine: RUNNING

VCH mhz limit: 111 Mhz

VCH memory limit: 52.32 GiB

VMware Product: VMware vCenter Server

VMware OS: linux-x64

VMware OS version: 6.0.0

Plugins:

Volume:

Network: bridge

Swarm:

NodeID:

Is Manager: false

Node Address:

Security Options:

Operating System: linux-x64

OSType: linux-x64

Architecture: x86_64

CPUs: 111

Total Memory: 52.32 GiB

Name: virtual-container-host

ID: vSphere Integrated Containers

Docker Root Dir:

Debug Mode (client): false

Debug Mode (server): false

Registry: registry-1.docker.io

[gowatana@client01 ~]$

それでは、Nginx のコンテナを起動してみます。

使用するコンテナ イメージは、Docker Hub オフィシャルの Nginx イメージです。

[gowatana@client01 ~]$ docker -H 192.168.1.5:2376 --tls pull nginx

Using default tag: latest

Pulling from library/nginx

386a066cd84a: Pull complete

a3ed95caeb02: Pull complete

386dc9762af9: Pull complete

d685e39ac8a4: Pull complete

Digest: sha256:e56314fa645f9e8004864d3719e55a6f47bdee2c07b9c8b7a7a1125439d23249

Status: Downloaded newer image for library/nginx:latest

[gowatana@client01 ~]$ docker -H 192.168.1.5:2376 --tls images nginx

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

nginx               latest              19d21b7e5b14        12 days ago         181.5 MB

コンテナを web01 という名前で起動します。

[gowatana@client01 ~]$ docker -H 192.168.1.5:2376 --tls run -d -p 8080:80 --name web01 nginx

3d4a7cca39dd2511aac38f5550ea9d584def35b7e243546770204d6a3b715a20

[gowatana@client01 ~]$ docker -H 192.168.1.5:2376 --tls ps

CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                      NAMES

3d4a7cca39dd        nginx               "nginx -g daemon off;"   About a minute ago   Up About a minute   192.168.1.5:8080->80/tcp   web01

コンテナ VM が作成されました。

vic-10ga-21.png

コンテナの UUID が、そのまま VM 名に付与されます。

コンテナ VM には、172.16.0.0 の IP アドレスが自動付与されています。

vic-10ga-22.png

コンテナを追加で起動すると・・・

[gowatana@client01 ~]$ docker -H 192.168.1.5:2376 --tls run -d -p 8081:80 --name web02 nginx

9a60d8755ebb952ce4d4272fadb33125de09f8536187e41142f7fbac53555444

[gowatana@client01 ~]$ docker -H 192.168.1.5:2376 --tls ps

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                      NAMES

9a60d8755ebb        nginx               "nginx -g daemon off;"   11 minutes ago      Up 10 minutes       192.168.1.5:8081->80/tcp   web02

3d4a7cca39dd        nginx               "nginx -g daemon off;"   About an hour ago   Up About an hour    192.168.1.5:8080->80/tcp   web01

[gowatana@client01 ~]$

コンテナ VM も増えます。

vic-10ga-23.png

3. コンテナのサービスへのアクセス。

VIC では、コンテナ VM ではなく VCH エンドポイントを経由して、コンテナの提供するサービスにアクセスします。

web01 コンテナの起動時に「-p 8080:80」とポート番号を指定していました。

コンテナ VM ではなく、VCH エンドポイントのアドレス (192.168.1.5) の 8080 番ポートにアクセスすると、
Nginx の Welcome ページが表示されます。

vic-10ga-31.png

ちょうど VIC 1.0 が GA されたので、いきおいでためしてみましたが

機会をみつけて、活用方法を探ってみたいと思います。

たしかに、VIC は既存の vSphere 環境を殆ど構成変更することなく利用することができます。

以上、VIC Engine をためしてみる話でした。

こちらもどうぞ。

vSphere Integrated Containers Engine の vSphere Web Client Plug-In から見る Docker 情報。

Tags (3)
Version history
Revision #:
1 of 1
Last update:
‎12-11-2016 06:23 AM
Updated by: