読者です 読者をやめる 読者になる 読者になる

らくがきちょう

なんとなく

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

昨年末、vSphere Integrated Containers (vIC) の 1.0.0 がリリースされました。

今回は vIC をインストールしてみます。

検証環境

今回の検証環境は vSphere 6.5 上に構築しています。

Environment Prerequisites for VCH Deployment にサポートされる環境の情報が掲載されています。このページによると vIC を作成する際にサポートされるプラットフォームは 64bit 版の以下と書かれています。

プラットフォーム バージョン
Windows 7, 10
Mac OS X 10.11 (El Capitan)
Linux Ubuntu 16.04 LTS

CentOS は表記が無いのですが、今回は敢えて CentOS から vIC をデプロイしてみました(特に問題無く、インストール出来ました)。

セキュリティポリシーの変更

VCH Deployment Fails with Firewall Validation に詳しく書かれているのですが、2377/TCP の outbound 通信が許可されていなければインストール時に(インストール前の検証時に、以下のようなエラーとなってしまいます。

ERRO[2017-01-14T10:46:18+09:00] Firewall configuration incorrect on hosts:
ERRO[2017-01-14T10:46:18+09:00]     "/MyDatacenter/host/MyCluster/172.31.98.231"
ERRO[2017-01-14T10:46:18+09:00] Firewall must permit dst 2377/tcp outbound to the VCH management interface

そこで vIC をインストールする前にセキュリティポリシーを修正しておきます。

セキュリティポリシーの確認

セキュリティポリシーの設定は esxcli network firewall ruleset list で確認出来ます。

[root@esxi-01:~] esxcli network firewall ruleset list
Name                      Enabled
------------------------  -------
sshServer                    true
sshClient                   false
nfsClient                   false
nfs41Client                 false
dhcp                         true
dns                          true
snmp                         true
ntpClient                   false
CIMHttpServer                true
CIMHttpsServer               true
CIMSLP                       true
iSCSI                        true
vpxHeartbeats                true
updateManager                true
faultTolerance               true
webAccess                    true
vMotion                      true
vSphereClient                true
activeDirectoryAll          false
NFC                          true
HBR                          true
ftpClient                   false
httpClient                  false
gdbserver                   false
DVFilter                    false
DHCPv6                       true
DVSSync                      true
syslog                      false
WOL                          true
vSPC                        false
remoteSerialPort            false
rdt                         false
cmmds                       false
vsanvp                      false
rabbitmqproxy                true
ipfam                       false
vvold                       false
iofiltervp                   true
esxupdate                   false
vsanEncryption              false
pvrdma                      false
vsanhealth-multicasttest    false

検証前のセキュリティポリシー

セキュリティポリシーの設定は ESXi ホストの /etc/vmware/firewall/service.xml で定義されています。今回、検証した環境では以下のようになっていました(id が 0000 〜 0043 まで定義されていました。長いですが、全て掲載しておきます)。

<!-- Firewall configuration information -->
<ConfigRoot>

  <!-- Known and blessed services -->

  <service id='0000'>
    <id>sshServer</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>22</port>
    </rule>
    <enabled>true</enabled>
    <required>true</required>
  </service>

  <service id='0001'>
    <id>sshClient</id>
    <rule>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>22</port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <service id='0002'>
    <id>nfsClient</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>0</begin>
        <end>65535</end>
      </port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <service id='0003'>
    <id>nfs41Client</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>0</begin>
        <end>65535</end>
      </port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <service id='0004'>
    <id>dhcp</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>68</port>
    </rule>
    <rule id='0001'>
      <direction>outbound</direction>
      <protocol>udp</protocol>
      <porttype>src</porttype>
      <port>68</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0005'>
    <id>dns</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>53</port>
    </rule>
    <rule id='0001'>
      <direction>outbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>53</port>
    </rule>
    <rule id='0002'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>53</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0006'>
    <id>snmp</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>161</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0007'>
    <id>ntpClient</id>
    <rule>
      <direction>outbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>123</port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <!-- First-party optional services -->

  <service id='0008'>
    <id>CIMHttpServer</id>
    <rule>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>5988</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0009'>
    <id>CIMHttpsServer</id>
    <rule>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>5989</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0010'>
    <id>CIMSLP</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>427</port>
    </rule>
    <rule id='0001'>
      <direction>outbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>427</port>
    </rule>
    <rule id='0002'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>427</port>
    </rule>
    <rule id='0003'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>427</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0011'>
    <id>iSCSI</id>
    <rule>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>3260</port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <service id='0012'>
    <id>vpxHeartbeats</id>
    <rule>
      <direction>outbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>902</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0013'>
    <id>updateManager</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>80</port>
    </rule>
    <rule id='0001'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>9000</begin>
        <end>9100</end>
      </port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0014'>
    <id>faultTolerance</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>80</port>
    </rule>
    <rule id='0001'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>8300</port>
    </rule>
    <rule id='0002'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>8300</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0015'>
    <id>webAccess</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>80</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0016'>
    <id>vMotion</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>8000</port>
    </rule>
    <rule id='0001'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>8000</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0017'>
    <id>vSphereClient</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>902</port>
    </rule>
    <rule id='0001'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>443</port>
    </rule>
    <enabled>true</enabled>
    <required>true</required>
  </service>

  <service id='0018'>
     <id>activeDirectoryAll</id>

     <!--
         the required ports are listed here:
         http://download1.beyondtrust.com/Technical-Support/Downloads/files/pbiso/Manuals/likewise-open-guide.html#OpenOutboundPorts
     -->

     <!-- Kerberos 5 -->
     <rule id='0000'>
        <direction>outbound</direction>
        <protocol>udp</protocol>
        <porttype>dst</porttype>
        <port>88</port>
     </rule>
     <rule id='0001'>
        <direction>outbound</direction>
        <protocol>tcp</protocol>
        <porttype>dst</porttype>
        <port>88</port>
     </rule>

     <!-- NTP -->
     <rule id='0002'>
        <direction>outbound</direction>
        <protocol>udp</protocol>
        <porttype>dst</porttype>
        <port>123</port>
     </rule>

     <!-- NetBIOS Name Service -->
     <rule id='0003'>
        <direction>outbound</direction>
        <protocol>udp</protocol>
        <porttype>dst</porttype>
        <port>137</port>
     </rule>

     <!-- NetBIOS Session (SMB) -->
     <rule id='0004'>
        <direction>outbound</direction>
        <protocol>tcp</protocol>
        <porttype>dst</porttype>
        <port>139</port>
     </rule>

     <!-- LDAP -->
     <rule id='0005'>
        <direction>outbound</direction>
        <protocol>tcp</protocol>
        <porttype>dst</porttype>
        <port>389</port>
     </rule>
     <rule id='0006'>
        <direction>outbound</direction>
        <protocol>udp</protocol>
        <porttype>dst</porttype>
        <port>389</port>
     </rule>

     <!-- SMB over TCP -->
     <rule id='0007'>
        <direction>outbound</direction>
        <protocol>tcp</protocol>
        <porttype>dst</porttype>
        <port>445</port>
     </rule>

     <!-- Machine password changes -->
     <rule id='0008'>
        <direction>outbound</direction>
        <protocol>udp</protocol>
        <porttype>dst</porttype>
        <port>464</port>
     </rule>
     <rule id='0009'>
        <direction>outbound</direction>
        <protocol>tcp</protocol>
        <porttype>dst</porttype>
        <port>464</port>
     </rule>

     <!-- Global Catalog search -->
     <rule id='0010'>
        <direction>outbound</direction>
        <protocol>tcp</protocol>
        <porttype>dst</porttype>
        <port>3268</port>
     </rule>

     <!-- CAM service -->
     <rule id='0011'>
        <direction>outbound</direction>
        <protocol>tcp</protocol>
        <porttype>dst</porttype>
        <port>7476</port>
     </rule>

     <!-- VMAFD service -->
     <rule id='0012'>
        <direction>inbound</direction>
        <protocol>tcp</protocol>
        <porttype>dst</porttype>
        <port>2020</port>
     </rule>

     <enabled>false</enabled>
     <required>false</required>

  </service>

  <service id='0019'>
    <id>NFC</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>902</port>
    </rule>
    <rule id='0001'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>902</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id='0020'>
    <id>HBR</id>
    <!-- vSphere Replication traffic initiated from VMkernel on
    port 31031 (initial sync), and port 44046 (on-going replication).
    See PR 610578. -->
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>31031</port>
    </rule>
    <rule id='0001'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>44046</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <!-- Just for active mode ftp access -->
  <service id='0021'>
    <id>ftpClient</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>21</port>
    </rule>
    <rule id='0001'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>src</porttype>
      <port>20</port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <service id="0022">
    <id>httpClient</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>80</port>
    </rule>
    <rule id='0001'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>443</port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <service id='0023'>
    <id>gdbserver</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>1000</begin>
        <end>9999</end>
      </port>
    </rule>
    <rule id='0001'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>50000</begin>
        <end>50999</end>
      </port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <service id="0024">
    <id>DVFilter</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>2222</port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <service id="0025">
    <id>DHCPv6</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>547</port>
    </rule>
    <rule id='0001'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>546</port>
    </rule>
    <rule id='0002'>
      <direction>outbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>547</port>
    </rule>
    <rule id='0003'>
      <direction>inbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>546</port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <service id="0026">
    <id>DVSSync</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>8302</port>
    </rule>
    <rule id='0001'>
      <direction>inbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>8301</port>
    </rule>
    <rule id='0002'>
      <direction>outbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>8301</port>
    </rule>
    <rule id='0003'>
      <direction>inbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>8302</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <service id="0027">
    <id>syslog</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>514</port>
    </rule>
    <rule id='0001'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>514</port>
    </rule>
    <rule id='0002'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>1514</port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <!-- IKED="0028" has been removed -->

  <service id="0029">
    <id>WOL</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>9</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <!-- Remote serial port with vSPC: all remote serial port traffic is initiated by us -->
  <service id="0030">
    <id>vSPC</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>0</begin>
        <end>65535</end>
      </port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <!-- Remote serial port without vSPC: we may be listening -->
  <service id="0031">
    <id>remoteSerialPort</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>0</begin>
        <end>65535</end>
      </port>
    </rule>
    <rule id='0001'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>23</port>
    </rule>
    <rule id='0002'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>1024</begin>
        <end>65535</end>
      </port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <!-- vprobeServer service id='0032' removed. -->

  <!-- VSAN services -->
  <service id='0033'>
     <id>rdt</id>
     <rule id='0000'>
        <direction>inbound</direction>
        <protocol>tcp</protocol>
        <porttype>dst</porttype>
        <port>2233</port>
     </rule>
     <rule id='0001'>
        <direction>outbound</direction>
        <protocol>tcp</protocol>
        <porttype>dst</porttype>
        <port>2233</port>
     </rule>
     <enabled>false</enabled>
     <required>false</required>
  </service>

  <service id='0034'>
     <id>cmmds</id>
     <rule id='0000'>
        <direction>inbound</direction>
        <protocol>udp</protocol>
        <porttype>dst</porttype>
        <port>12345</port>
     </rule>
     <rule id='0001'>
        <direction>inbound</direction>
        <protocol>udp</protocol>
        <porttype>dst</porttype>
        <port>23451</port>
     </rule>
     <rule id='0002'>
        <direction>outbound</direction>
        <protocol>udp</protocol>
        <porttype>dst</porttype>
        <port>12345</port>
     </rule>
     <rule id='0003'>
        <direction>outbound</direction>
        <protocol>udp</protocol>
        <porttype>dst</porttype>
        <port>23451</port>
     </rule>
     <rule id='0004'>
        <direction>inbound</direction>
        <protocol>udp</protocol>
        <porttype>dst</porttype>
        <port>12321</port>
     </rule>
     <rule id='0005'>
        <direction>outbound</direction>
        <protocol>udp</protocol>
        <porttype>dst</porttype>
        <port>12321</port>
     </rule>
     <enabled>false</enabled>
     <required>false</required>
  </service>

  <service id='0035'>
    <id>vsanvp</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <port type='dst'>8080</port>
      <flags>-m state --state NEW</flags>
    </rule>
    <rule id='0001'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <port type='dst'>8080</port>
   </rule>
   <enabled>false</enabled>
   <required>false</required>
  </service>

  <service id='0036'>
    <id>rabbitmqproxy</id>
    <rule>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>5671</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>

  <!-- DI service for IP Forwarding Module -->
  <service id='0037'>
    <id>ipfam</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>6999</port>
    </rule>
    <rule id='0001' >
      <direction>outbound</direction>
      <protocol>udp</protocol>
      <porttype>dst</porttype>
      <port>6999</port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <service id='0038'>
    <id>vvold</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>0</begin>
        <end>65535</end>
      </port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
 </service>

  <service id='0039'>
    <id>iofiltervp</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <port type='dst'>9080</port>
      <flags>-m state --state NEW</flags>
    </rule>
   <enabled>false</enabled>
   <required>false</required>
  </service>

  <!-- Ports get opened during esxupdate process to download VIBs -->
  <service id='0040'>
    <id>esxupdate</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <port type='dst'>443</port>
    </rule>
   <enabled>false</enabled>
   <required>false</required>
  </service>

  <!-- vit service id='0041' removed. -->

  <service id='0042'>
    <id>vsanEncryption</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>0</begin>
        <end>65535</end>
      </port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

  <!-- Ports opened for PVRDMA devices to connect to each other. -->
  <service id="0043">
    <id>pvrdma</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>28250</begin>
        <end>28761</end>
      </port>
    </rule>
    <rule id='0001'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>28250</begin>
        <end>28761</end>
      </port>
    </rule>
    <enabled>false</enabled>
    <required>false</required>
  </service>

</ConfigRoot>

セキュリティポリシーの修正

vIC で利用する 2377/TCP を追加するように設定を修正していきます。/etc/vmware/firewall/service.xml を編集出来るようにします。

chmod 644 /etc/vmware/firewall/service.xml
chmod +t /etc/vmware/firewall/service.xml

/etc/vmware/firewall/service.xml へ以下を追記します。追記の状態では id が 0043 まで使われていたので、id は『0044』としました。

  <service id='0044'>
    <id>vicoutgoing</id>
    <rule id='0000'>
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <port type='dst'>2377</port>
    </rule>
    <enabled>true</enabled>
    <required>true</required>
  </service>

/etc/vmware/firewall/service.xml の権限を元に戻します。

chmod -t /etc/vmware/firewall/service.xml
chmod 444 /etc/vmware/firewall/service.xml

設定を反映します。

esxcli network firewall refresh

これでセキュリティポリシーに vIC で必要とされる 2377/TCP を許可するルールが追加されました。

[root@esxi-01:~] esxcli network firewall ruleset list | grep vicoutgoing
vicoutgoing                  true

インストールする

予め、vIC のバイナリは用意しておきます。

# ls -l
total 235776
-rw-r--r-- 1 root root 241427448 Jan 14 10:28 vic_0.8.0-7315-c8ac999.tar.gz

展開します。

tar zxvf vic_0.8.0-7315-c8ac999.tar.gz
cd vic

インストーラを実行します。

./vic-machine-linux create --target 172.31.98.230 --user "administrator@example.local" --password PASSWORD --compute-resource 'MyCluster' --bridge-network 'VLAN-3101' --public-network 'VLAN-3102' --image-store datastore1 --no-tlsverify --force

今回は 172.31.2.150 としてインストールされたので、VHC Admin Portalhttps://172.31.2.150:2378 になりました。

INFO[2017-01-14T11:18:04+09:00] VCH Admin Portal:
INFO[2017-01-14T11:18:04+09:00] https://172.31.2.150:2378
INFO[2017-01-14T11:18:04+09:00]
INFO[2017-01-14T11:18:04+09:00] Published ports can be reached at:
INFO[2017-01-14T11:18:04+09:00] 172.31.2.150
INFO[2017-01-14T11:18:04+09:00]
INFO[2017-01-14T11:18:04+09:00] Docker environment variables:
INFO[2017-01-14T11:18:04+09:00] DOCKER_HOST=172.31.2.150:2376

使ってみる

nginx の image を pull してみます。docker がインストールされた環境から -H オプションで VHC Admins Portal のアドレス/ポート番号を指定して実行します。

root@centos7:~# docker -H 172.31.2.150:2376 --tls pull nginx
Using default tag: latest
Pulling from library/nginx
75a822cd7888: Pull complete
a3ed95caeb02: Pull complete
0aefb9dc4a57: Pull complete
046e44ee6057: Pull complete
Digest: sha256:2b942f7dd01a57ceeb5985a0472a2f92735eb81a910dec70c2183c61fc54298c
Status: Downloaded newer image for library/nginx:latest

イメージがダウンロードされました。

root@centos7:~# docker -H 172.31.2.150:2376 --tls images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              25c9fe76c2fe        2 weeks ago         181.6 MB

ダウンドードしたイメージからコンテナを起動します。

root@centos7:~# docker -H 172.31.2.150:2376 --tls run -d -p 8080:80 --name web01 nginx
1c30361cedc44f1c42d97877169fcf72c60feb59398ab823774a1f30c7834c4b

コンテナが起動しました。

root@centos7:~# docker -H 172.31.2.150:2376 --tls ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                       NAMES
1c30361cedc4        nginx               "nginx -g daemon off;"   6 minutes ago       Up About a minute   172.31.2.150:8080->80/tcp   web01

ブラウザから起動したコンテナ上の Nginx にアクセス出来ました。

f:id:sig9:20170114124648p:plain

参考:「vic-machine-linux」のヘルプ表示

参考までに、vic-machine-linux のヘルプを引用しておきます。

# ./vic-machine-linux
NAME:
   vic-machine-linux - Create and manage Virtual Container Hosts

USAGE:
   vic-machine-linux [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