Automation Assembler
のネットワーク、セキュリティ グループ、およびロード バランサ リソースの例

Automation Assembler
クラウド テンプレートでは、ネットワーク、セキュリティ、およびロード バランサのリソースと設定を使用できます。
クラウド テンプレート コードのオプションの概要については、vRealize Automation Resource Type Schema を参照してください。
これらの例では、基本的なクラウド テンプレート デザイン内のネットワーク、セキュリティ、およびロード バランサのリソースを示します。

ネットワーク

リソース シナリオ
クラウド テンプレート デザイン コードの例
DHCP IP アドレスが割り当てられた、
vSphere
ネットワークおよび
NSX
ネットワークに接続された複数の NIC を搭載した
vSphere
マシン
resources: demo-machine: type: Cloud.vSphere.Machine properties: image: ubuntu flavor: small networks: - network: ${resource["demo-vSphere-Network"].id} deviceIndex: 0 - network: ${resource["demo-NSX-Network"].id} deviceIndex: 1 demo-vSphere-Network: type: Cloud.vSphere.Network properties: networkType: existing demo-NSX-Network: type: Cloud.NSX.Network properties: networkType: outbound
vlanIds
プロパティを使用して、3 つの VLAN(123、456、および 7)で構成された配列を指定する
NSX
プライベート ネットワーク
formatVersion: 1 inputs: {} resources: Cloud_Machine_1: type: Cloud.Machine properties: image: test flavor: test networks: - network: '${resource.Cloud_NSX_Network_1.id}' Cloud_NSX_Network_1: type: Cloud.NSX.Network properties: networkType: private vlanIds: - 123 - 456 - 7
Azure 仮想マシンの展開用に固定 IP アドレスを持つプライベート ネットワークを追加します。
formatVersion: 1 inputs: {} resources: Cloud_Azure_Machine_1: type: Cloud.Machine properties: image: photon flavor: Standard_B1ls networks: - network: '${resource.Cloud_Network_1.id}' assignment: static address: 10.0.0.45 assignPublicIpAddress: false Cloud_Network_1: type: Cloud.Network properties: networkType: existing
VMware Aria Automation
IP アドレス管理で固定 IP アドレス割り当てを使用することができます(
VMware Aria Automation
に付属している内部アドレス、または VMware Marketplace で使用可能な Infloblox プラグインの 1 つなど、
VMware Aria Automation
IP アドレス管理 SDK に基づく外部アドレス)。VMware Aria Automation クラウド テンプレートのネットワーク リソースの詳細の「
注意事項
」セクションに記載されているように、
assignment: static
のその他の使用方法はサポートされていません。
resources: demo_vm: type: Cloud.vSphere.Machine properties: image: 'photon' cpuCount: 1 totalMemoryMB: 1024 networks: - network: ${resource.demo_nw.id} assignment: static demo_nw: type: Cloud.vSphere.Network properties: networkType: existing
既存の展開の
Cloud.NSX.NAT
リソースに NAT および DNAT ポート転送ルールを追加するか、これらのルールを編集します。
resources: gw: type: Cloud.NSX.Gateway properties: networks: - ${resource.akout.id} nat: type: Cloud.NSX.Nat properties: networks: - ${resource.akout.id} natRules: - translatedInstance: ${resource.centos.networks[0].id} index: 0 protocol: TCP kind: NAT44 type: DNAT sourceIPs: any sourcePorts: 80 translatedPorts: 8080 destinationPorts: 8080 description: edit - translatedInstance: ${resource.centos.networks[0].id} index: 1 protocol: TCP kind: NAT44 type: DNAT sourceIPs: any sourcePorts: 90 translatedPorts: 9090 destinationPorts: 9090 description: add gateway: ${resource.gw.id} centos: type: Cloud.vSphere.Machine properties: image: WebTinyCentOS65x86 flavor: small customizationSpec: Linux networks: - network: ${resource.akout.id} assignment: static akout: type: Cloud.NSX.Network properties: networkType: outbound constraints: - tag: nsxt-nat-1-M2
パブリック IP アドレスではなく内部 IP アドレスを使用するためのパブリック クラウド マシン。この例では、特定のネットワーク ID を使用します。
注:ターゲット ネットワーク ID を指定するには、
networks:
設定で
network:
オプションを使用します。
networks:
設定の
name:
オプションは廃止されているため、使用しないでください。
resources: wf_proxy: type: Cloud.Machine properties: image: ubuntu 16.04 flavor: small constraints: - tag: 'platform:vsphere'
networks:
- network: '${resource.wf_net.id}'
assignPublicIpAddress: false
NSX
ネットワーク リソース タイプを使用したルーティング ネットワーク。
Cloud_NSX_Network_1: type: Cloud.NSX.Network properties: networkType: routed
クラウド テンプレート内のマシン NIC リソースにタグを追加します。
formatVersion: 1 inputs: {} resources: Cloud_Machine_1: type: Cloud.vSphere.Machine properties: flavor: small image: ubuntu networks: - name: '${resource.Cloud_Network_1.name}' deviceIndex: 0 tags: - key: 'nic0' value: null - key: internal value: true - name: '${resource.Cloud_Network_2.name}' deviceIndex: 1 tags: - key: 'nic1' value: null - key: internal value: false
送信ネットワークに
NSX-T
論理スイッチをタグ付けします。
NSX-T
および
VMware Cloud on AWS
ではタグ付けがサポートされています。
このシナリオの詳細については、コミュニティ ブログの記事Creating Tags in NSXを参照してください。
Cloud_NSX_Network_1: type: Cloud.NSX.Network properties: networkType: outbound tags: - key: app value: opencart

セキュリティ グループ

リソース シナリオ
クラウド テンプレート デザイン コードの例
マシン NIC に適用された制約タグのある既存のセキュリティ グループ。
既存のセキュリティ グループを使用するには、コンポーネントの
securityGroupType
プロパティに
existing
と入力します。
タグを
Cloud.SecurityGroup
リソースに割り当て、タグ制約を使用して、既存のセキュリティ グループを割り当てることができます。タグを含まないセキュリティ グループはクラウド テンプレート デザインで使用することはできません。
制約タグは、
securityGroupType: existing
セキュリティ グループのリソースに対して設定する必要があります。これらの制約は、既存のセキュリティ グループに対して設定されているタグと一致する必要があります。
securityGroupType: new
セキュリティ グループのリソースに制約タグを設定することはできません。
formatVersion: 1 inputs: {} resources: allowSsh_sg:
type: Cloud.SecurityGroup
properties:
securityGroupType: existing
constraints:
- tag: allowSsh
compute: type: Cloud.Machine properties: image: centos flavor: small networks: - network: '${resource.prod-net.id}' securityGroups: - '${resource.allowSsh_sg.id}' prod-net: type: Cloud.Network properties: networkType: existing
Allow
Deny
アクセス オプションを示す 2 つのファイアウォール ルールが設定されているオンデマンド セキュリティ グループ。
resources: Cloud_SecurityGroup_1:
type: Cloud.SecurityGroup
properties:
securityGroupType: new
rules: - ports: 5000 source: 'fc00:10:
000
:
000
:
000
:56ff:fe89:48b4'
access: Allow
direction: inbound
name: allow_5000
protocol: TCP - ports: 7000 source: 'fc00:10:
000
:
000
:
000
:56ff:fe89:48b4'
access: Deny
direction: inbound
name: deny_7000
protocol: TCP Cloud_vSphere_Machine_1: type: Cloud.vSphere.Machine properties: image: photon cpuCount: 1 totalMemoryMB: 256 networks: - network: '${resource.Cloud_Network_1.id}' assignIPv6Address: true assignment: static securityGroups: - '${resource.Cloud_SecurityGroup_1.id}' Cloud_Network_1: type: Cloud.Network properties: networkType: existing
以下を含む、2 つのセキュリティ グループがある複雑なクラウド テンプレート
  • 1 つの既存のセキュリティ グループ
  • 複数のファイアウォール ルールの例を含む 1 つのオンデマンド セキュリティ グループ
  • 1 台の
    vSphere
    マシン
  • 1 つの既存のネットワーク
このサンプルでは、プロトコルとポート、サービス、送信元と宛先としての IP CIDR、送信元または宛先としての IP アドレス範囲、および any、IPv6、(::/0) のオプションのさまざまな組み合わせを示しています。
マシン NIC の場合は、接続されているネットワークと、セキュリティ グループを指定できます。NIC インデックスまたは IP アドレスを指定することもできます。
formatVersion: 1 inputs: {} resources: DEMO_ESG :
existing security group - security group 1)
type: Cloud.SecurityGroup
properties: constraints: - tag: BlockAll
securityGroupType: existing
(
designation of existing for security group 1
) DEMO_ODSG: (
on-demand security group - security group 2)
)
type: Cloud.SecurityGroup
properties:
rules:
(
multiple firewall rules in this section
) -
name: IN-ANY
(
rule 1
) source: any service: any direction: inbound
access: Deny
- name: IN-SSH
(
rule 2
) source: any service: SSH direction: inbound
access: Allow
- name: IN-SSH-IP
(
rule 3
) source: 33.33.33.1-33.33.33.250 protocol: TCP ports: 223 direction: inbound
access: Allow
- name: IPv-6-ANY-SOURCE
(
rule 4
) source: '::/0' protocol: TCP ports: 223 direction: inbound
access: Allow
- name: IN-SSH-IP
(
rule 5
) source: 44.44.44.1/24 protocol: UDP ports: 22-25 direction: inbound
access: Allow
- name: IN-EXISTING-SG
(
rule 6
)
source: '${resource["DEMO_ESG"].id}'
protocol: ICMPv6 direction: inbound
access: Allow
- name: OUT-ANY
(
rule 7
) destination: any service: any direction: outbound
access: Deny
- name: OUT-TCP-IPv6
(
rule 8
) destination: '2001:0db8:85a3::8a2e:0370:7334/64' protocol: TCP ports: 22 direction: outbound
access: Allow
- name: IPv6-ANY-DESTINATION
(
rule 9
) destination: '::/0' protocol: UDP ports: 23 direction: outbound
access: Allow
- name: OUT-UDP-SERVICE
(
rule 10
) destination: any service: NTP direction: outbound
access: Allow
securityGroupType: new
(
designation of on-demand for security group 2
) DEMO_VC_MACHINE: (
machine resource
)
type: Cloud.vSphere.Machine
properties: image: PHOTON cpuCount: 1 totalMemoryMB: 1024
networks:
(
Machine network NICs
)
- network: '${resource.DEMO_NW.id}' securityGroups: - '${resource.DEMO_ODSG.id}' - '${resource.DEMO_ESG.id}'
DEMO_NETWORK: (
network resource
)
type: Cloud.vSphere.Network
properties:
networkType: existing
constraints: - tag: nsx62

ロード バランサ

リソース シナリオ
クラウド テンプレート デザイン コードの例
ロード バランサのログ レベル、アルゴリズム、およびサイズを指定します。
ログ レベル、アルゴリズム、およびサイズの使用方法を示すサンプル NSX ロード バランサ:
resources: Cloud_LoadBalancer_1:
type: Cloud.NSX.LoadBalancer
properties: name: myapp-lb network: '${appnet-public.name}' instances: '${wordpress.id}' routes: - protocol: HTTP port: '80'
loggingLevel: CRITICAL
algorithm: LEAST_CONNECTION
type: MEDIUM
指定されたマシンまたは指定されたマシン NIC にロード バランサを関連付けます。
machine ID
または
machine network ID
を指定して、ロード バランサ プールにマシンを追加できます。instances プロパティは、マシン (
machine by ID
) と NIC (
machine by network ID
) の両方をサポートします。
1 番目の例では、
machine by ID
設定を使用することにより、マシンがどのネットワークに展開されてもロード バランシングを行います。
2 番目の例では、
machine by network ID
設定を使用することにより、マシンが指定されたマシン NIC に展開されている場合にのみロード バランシングを行います。
3 番目の例は、同じ
instances
オプションで使用される両方の設定を示しています。
instances
プロパティを使用して、マシン ID またはマシン ネットワーク ID を定義できます。
  • マシン ID
    Cloud_LoadBalancer_1: type: Cloud.LoadBalancer properties: network: '${resource.Cloud_Network_1.id}' instances: '${resource.Cloud_Machine_1.id}'
  • マシン ネットワーク ID
    Cloud_LoadBalancer_1: type: Cloud.LoadBalancer properties: network: '${resource.Cloud_Network_1.id}' instances: '${resource.Cloud_Machine_1.networks[0].id}'
  • ロード バランサに含めるように指定された 1 台のマシンと、ロード バランサに含めるように指定された別のマシン NIC:
    instances: - resource.Cloud_Machine_1.id - resource.Cloud_Machine_2.networks[2].id
NSX
ロード バランサに健全性チェック設定を追加します。
httpMethod
requestBody
responseBody
などの追加オプションがあります。
myapp-lb:
type: Cloud.NSX.LoadBalancer
properties: name: myapp-lb network: '${appnet-public.name}' instances: '${wordpress.id}' routes: - protocol: HTTP port: '80' algorithm: ROUND_ROBIN instanceProtocol: HTTP instancePort: '80'
healthCheckConfiguration:
protocol: HTTP
port: '80'
urlPath: /mywordpresssite/wp-admin/install.php
intervalSeconds: 60
timeoutSeconds: 10
unhealthyThreshold: 10
healthyThreshold: 2
connectionLimit: '50' connectionRateLimit: '50' maxConnections: '500' minConnections: '' internetFacing: true{code}
1 アームのロード バランサを備えたオンデマンド ネットワーク。
inputs: {} resources: mp-existing: type: Cloud.Network properties: name: mp-existing networkType: existing mp-wordpress: type: Cloud.vSphere.Machine properties: name: wordpress count: 2 flavor: small image: tiny customizationSpec: Linux networks: - network: '${resource["mp-private"].id}' mp-private: type: Cloud.NSX.Network properties: name: mp-private networkType: private constraints: - tag: nsxt mp-wordpress-lb: type: Cloud.LoadBalancer properties: name: wordpress-lb internetFacing: false network: '${resource.mp-existing.id}' instances: '${resource["mp-wordpress"].id}' routes: - protocol: HTTP port: '80' instanceProtocol: HTTP instancePort: '80' healthCheckConfiguration: protocol: HTTP port: '80' urlPath: /index.pl intervalSeconds: 60 timeoutSeconds: 30 unhealthyThreshold: 5 healthyThreshold: 2
ロード バランサを使用する既存のネットワーク。
formatVersion: 1 inputs: count: type: integer default: 1 resources: ubuntu-vm: type: Cloud.Machine properties: name: ubuntu flavor: small image: tiny count: '${input.count}' networks: - network: '${resource.Cloud_NSX_Network_1.id}' Provider_LoadBalancer_1: type: Cloud.LoadBalancer properties: name: OC-LB routes: - protocol: HTTP port: '80' instanceProtocol: HTTP instancePort: '80' healthCheckConfiguration: protocol: HTTP port: '80' urlPath: /index.html intervalSeconds: 60 timeoutSeconds: 5 unhealthyThreshold: 5 healthyThreshold: 2 network: '${resource.Cloud_NSX_Network_1.id}' internetFacing: false instances: '${resource["ubuntu-vm"].id}' Cloud_NSX_Network_1: type: Cloud.NSX.Network properties: networkType: existing constraints: - tag: nsxt24prod

詳細情報

関連情報は、次の VMware ブログで入手できます。