VMware Aria Automation と Avi Load Balancerとの統合では、Avi Load Balancer IP アドレス管理による仮想サービスの仮想 IP アドレス割り当てがサポートされます。テンプレート内で、または入力として IP アドレスを指定することもできます。
テンプレートを設計する場合は、必須としてマークされていない一部のプロパティが、使用方法によってはテンプレートを機能させるために必要な場合があります。次に示すテンプレートのサンプルは、さまざまな IP アドレス管理、vSphere、および NSX Cloud のシナリオに関するガイダンスを提供します。
tier1_lr 属性を使用する一部のテンプレートのサンプルでは、Tier-1 論理ルーター名が ID と同じ場合にのみ tier1_lr 名を使用できます。それ以外の場合は、Tier-1 論理ルーターのフル パス(例:/infra/tier-1s/20f6a214-e8b3-4bb3-aaeb-6c06639ada23)を使用する必要があります。
開始する前に
- Avi Load Balancer コントローラで、サブネットと IP アドレス管理プロファイルを構成します。
「NSX Advanced Load Balancer の IP アドレス管理と DNS」を参照してください。
- VMware Aria Automation を構成します。
- Automation Assembler で Avi Load Balancer クラウド アカウントを作成し、プロジェクトを作成して、クラウド ゾーンを追加します。
VMware Avi Load Balancer クラウド アカウントの作成を参照してください。
- プロビジョニング用のネットワークを構成します。
の順に移動し、プロビジョニングに使用するネットワークを特定して、IPv4/IPv6 CIDR および DNS サーバを構成します。
VMware Aria Automation のネットワーク リソースを参照してください。
- イメージ マッピングを構成します。
の順に移動し、画面上のプロンプトに従って新しいイメージ マッピングを作成します。
VMware Aria Automation でのイメージ マッピングの詳細を参照してください。
- ネットワーク プロファイルを構成します。
の順に移動し、画面上のプロンプトに従って新しいネットワーク プロファイルを作成します。
- Automation Assembler で Avi Load Balancer クラウド アカウントを作成し、プロジェクトを作成して、クラウド ゾーンを追加します。
VS VIP の固定 IP アドレス
この Avi Load Balancer サンプル テンプレートには、仮想サービス、VS VIP、プールが含まれています。vSphere 仮想マシン クラスタがプールに割り当てられています。VS VIP には固定 IP アドレスがあります。
formatVersion: 1
inputs:
count:
type: integer
title: vm-count
default: 2
resources:
Idem_AVILB_APPLICATIONS_POOL_1:
type: Idem.AVILB.APPLICATIONS.POOL
properties:
name: pool-${uuid()}
account: Avi
default_server_port: 8000
networks:
- network_ref: ${resource.Cloud_vSphere_Network_1.resourceName}
health_monitor_refs:
- System-HTTP
servers: ${map_to_object(resource.Cloud_vSphere_Machine_1[*].address, "ip", "addr")}
Idem_AVILB_APPLICATIONS_VIRTUAL_SERVICE_1:
type: Idem.AVILB.APPLICATIONS.VIRTUAL_SERVICE
properties:
name: vs-${uuid()}
account: Avi
traffic_enabled: true
services:
- port: 8000
pool_ref: ${resource.Idem_AVILB_APPLICATIONS_POOL_1.name}
vsvip_ref: ${resource.Idem_AVILB_APPLICATIONS_VS_VIP_1.name}
Idem_AVILB_APPLICATIONS_VS_VIP_1:
type: Idem.AVILB.APPLICATIONS.VS_VIP
properties:
name: vip-${uuid()}
account: Avi
vip:
- enabled: true
ip_address:
addr: 10.202.20.80
type: V4
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
count: ${input.count}
image: webserver
cpuCount: 1
totalMemoryMB: 1024
networks:
- network: ${resource.Cloud_vSphere_Network_1.id}
assignment: static
Cloud_vSphere_Network_1:
type: Cloud.vSphere.Network
properties:
networkType: existing
vCenter Server クラウドの VS VIP での Avi Load Balancer IP アドレス管理
この Avi Load Balancer サンプル テンプレートは、vCenter Server クラウド用です。
VS VIP リソースでは、network ref と subnet を含む ipam_network_subnet セクションを定義します。この定義により、Avi Load Balancerは、Avi Load Balancer コントローラで VS VIP を作成するときに、定義済みの Avi Load Balancer IP アドレス管理プロファイルから IP アドレスを割り当てます。
プール メンバーの定義済みクラスタでは、固定ネットワーク割り当てを使用します。Automation Assembler では、ドメイン、IPv4/IPv6 CIDR、デフォルト ゲートウェイ、DNS サーバなどのネットワークを構成します。次に、このネットワークを使用してネットワーク範囲を持つネットワーク プロファイルを設定します。クラスタが作成されると、そのネットワーク範囲の IP アドレスがクラスタに割り当てられます。
inputs:
count:
type: integer
title: count
default: 2
resources:
Allocations_CustomNaming_1:
type: Allocations.CustomNaming
properties:
resourceType: Generic
numberOfNamesToGenerate: 5
templateName: aviBP
Idem_AVILB_PROFILES_HEALTH_MONITOR_1:
type: Idem.AVILB.PROFILES.HEALTH_MONITOR
properties:
name: test-mon-${resource.Allocations_CustomNaming_1.selectedNames[0]}
type: HEALTH_MONITOR_PING
account: aviAcct
is_federated: false
monitor_port: 8000
send_interval: 8
receive_timeout: 4
successful_checks: 4
failed_checks: 4
Idem_AVILB_APPLICATIONS_POOL_1:
type: Idem.AVILB.APPLICATIONS.POOL
metadata:
layoutPosition:
- 0
- 2
properties:
name: test-pool-${resource.Allocations_CustomNaming_1.selectedNames[0]}
account: aviAcct
lb_algorithm: LB_ALGORITHM_ROUND_ROBIN
default_server_port: 8000
networks:
- network_ref: ${resource.Cloud_vSphere_Network_1.resourceName}
health_monitor_refs:
- ${resource.Idem_AVILB_PROFILES_HEALTH_MONITOR_1.name}
servers: ${map_to_object(resource.Cloud_vSphere_Machine_1[*].address, "ip", "addr")}
Idem_AVILB_APPLICATIONS_VIRTUAL_SERVICE_1:
type: Idem.AVILB.APPLICATIONS.VIRTUAL_SERVICE
properties:
name: test-vs-${resource.Allocations_CustomNaming_1.selectedNames[0]}
account: aviAcct
cloud_type: CLOUD_NONE
type: VS_TYPE_NORMAL
traffic_enabled: true
services:
- enable_ssl: false
port: 8000
pool_ref: ${resource.Idem_AVILB_APPLICATIONS_POOL_1.name}
vsvip_ref: ${resource.Idem_AVILB_APPLICATIONS_VS_VIP_1.name}
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
count: ${input.count}
image: webserver
cpuCount: 1
totalMemoryMB: 1024
networks:
- network: ${resource.Cloud_vSphere_Network_1.id}
assignment: static
Cloud_vSphere_Network_1:
type: Cloud.vSphere.Network
metadata:
layoutPosition:
- 2
- 0
properties:
networkType: existing
Idem_AVILB_APPLICATIONS_VS_VIP_1:
type: Idem.AVILB.APPLICATIONS.VS_VIP
properties:
name: test-vip-${resource.Allocations_CustomNaming_1.selectedNames[0]}
account: aviAcct
vip:
- auto_allocate_floating_ip: false
auto_allocate_ip: true
auto_allocate_ip_type: V4_ONLY
avi_allocated_fip: false
avi_allocated_vip: false
enabled: true
ipam_network_subnet:
network_ref: ${resource.Cloud_vSphere_Network_1.resourceName}
subnet:
ip_addr:
addr: 10.202.20.0
type: V4
mask: 22
NSX Cloud の VS VIP での Avi Load Balancer IP アドレス管理
このサンプルの Avi Load Balancer テンプレートは、NSX Cloud の Avi Load Balancer用です。
NSX Cloud で Avi Load Balancerをプロビジョニングするには、Avi Load Balancer プール、仮想サービス、VS VIP リソースに Tier-1 論理ルーター (tier1_lr) を定義するか、VRF コンテキスト (vrf_context_ref) が必要です。
VS VIP リソースでは、network ref と subnet を含む ipam_network_subnet セクションを定義します。この定義により、Avi Load Balancerは、Avi Load Balancer コントローラで VS VIP を作成するときに、定義済みの Avi Load Balancer IP アドレス管理プロファイルから IP アドレスを割り当てます。
formatVersion: 1
inputs: {}
resources:
Allocations_CustomNaming_1:
type: Allocations.CustomNaming
properties:
resourceType: Generic
numberOfNamesToGenerate: 5
templateName: avinsxBP
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
count: 2
image: webserver
cpuCount: 1
totalMemoryMB: 1024
networks:
- network: ${resource.Cloud_vSphere_Network_1.id}
assignment: static
Idem_AVILB_APPLICATIONS_VS_VIP_1:
type: Idem.AVILB.APPLICATIONS.VS_VIP
properties:
name: test-vip-${resource.Allocations_CustomNaming_1.selectedNames[0]}
account: avinsx
tier1_lr: DONT-DELETE-AVI-Admin-E2E
vrf_context_ref: T1-DONT-DELETE-AVI-Admin-E2E
vip:
- auto_allocate_floating_ip: false
auto_allocate_ip: true
auto_allocate_ip_type: V4_ONLY
avi_allocated_fip: false
avi_allocated_vip: false
enabled: true
ipam_network_subnet:
network_ref: ${resource.Cloud_vSphere_Network_1.resourceName}
subnet:
ip_addr:
addr: 192.168.223.0
type: V4
mask: 24
Idem_AVILB_APPLICATIONS_VIRTUAL_SERVICE_1:
type: Idem.AVILB.APPLICATIONS.VIRTUAL_SERVICE
properties:
name: test-vs-${resource.Allocations_CustomNaming_1.selectedNames[0]}
account: avinsx
cloud_type: CLOUD_NONE
type: VS_TYPE_NORMAL
traffic_enabled: true
vrf_context_ref: T1-DONT-DELETE-AVI-Admin-E2E
services:
- enable_ssl: false
port: 80
port_range_end: 8000
pool_ref: ${resource.Idem_AVILB_APPLICATIONS_POOL_1.name}
vsvip_ref: ${resource.Idem_AVILB_APPLICATIONS_VS_VIP_1.name}
Idem_AVILB_APPLICATIONS_POOL_1:
type: Idem.AVILB.APPLICATIONS.POOL
properties:
name: test-pool-${resource.Allocations_CustomNaming_1.selectedNames[0]}
account: avinsx
lb_algorithm: LB_ALGORITHM_ROUND_ROBIN
tier1_lr: DONT-DELETE-AVI-Admin-E2E
vrf_ref: T1-DONT-DELETE-AVI-Admin-E2E
health_monitor_refs:
- System-Ping
servers: ${map_to_object(resource.Cloud_vSphere_Machine_1[*].address, "ip", "addr")}
Cloud_vSphere_Network_1:
type: Cloud.vSphere.Network
properties:
networkType: existing
NSX Cloud の VS VIP での Infoblox IP アドレス管理
このサンプルの Avi Load Balancer テンプレートは、Avi Load Balancer と Infoblox との統合に基づいています。このテンプレートでは、Infoblox IP アドレス管理を使用して、NSX Cloud の Avi Load Balancerの VS VIP に IP アドレスを割り当てます。
テンプレート内の ipam_network_subnet セクションの network_ref 属性は、Infoblox で定義されているネットワーク セグメントのフル パスに設定されます。network_ref 値は、/api/network/ プリフィックスを含むフル パスにする必要があります。これは他の ref 属性とは異なります。
formatVersion: 1
inputs:
count:
type: integer
title: count
default: 2
resources:
Idem_AVILB_APPLICATIONS_VIRTUAL_SERVICE_1:
type: Idem.AVILB.APPLICATIONS.VIRTUAL_SERVICE
properties:
name: infoblox-vs-${uuid()}
account: aviinfoblox
vrf_context_ref: nested-T1
services:
- port: 8000
vsvip_ref: ${resource.Idem_AVILB_APPLICATIONS_VS_VIP_1.name}
pool_ref: ${resource.Idem_AVILB_APPLICATIONS_POOL_1.name}
Idem_AVILB_APPLICATIONS_VS_VIP_1:
type: Idem.AVILB.APPLICATIONS.VS_VIP
properties:
name: infoblox-vip-${uuid()}
account: aviinfoblox
vrf_context_ref: nested-T1
tier1_lr: nested-T1
vip:
- auto_allocate_ip: true
ipam_network_subnet:
network_ref: /api/network/infoblox--default--192.168.225.0-24
Idem_AVILB_APPLICATIONS_POOL_1:
type: Idem.AVILB.APPLICATIONS.POOL
properties:
name: infoblox-pool-${uuid()}
account: aviinfoblox
tier1_lr: nested-T1
default_server_port: 8000
health_monitor_refs:
- System-HTTP
servers: ${map_to_object(resource.Cloud_vSphere_Machine_1[*].address, "ip", "addr")}
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
count: ${input.count}
image: webserver
cpuCount: 2
totalMemoryMB: 4096
networks:
- network: ${resource.Cloud_NSX_Network_1.id}
assignment: static
Cloud_NSX_Network_1:
type: Cloud.NSX.Network
properties:
networkType: existing
プール メンバーの既存の NSX セキュリティ グループ
このサンプルの Avi Load Balancer テンプレートでは、既存の NSX セキュリティ グループを使用してプール メンバーを割り当てます。
nsx_securitygroup 属性が定義され、Idem.AVILB.APPLICATIONS.POOL リソース内の既存の NSX セキュリティ グループ名に設定されます。
formatVersion: 1
inputs:
count:
type: integer
title: vm-count
default: 2
resources:
Idem_AVILB_APPLICATIONS_VS_VIP_1:
type: Idem.AVILB.APPLICATIONS.VS_VIP
properties:
name: vip-sg-${uuid()}
account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
tier1_lr: DONT-DELETE-AVI-Admin-E2E
vrf_context_ref: T1-DONT-DELETE-AVI-Admin-E2E
vip:
- auto_allocate_floating_ip: false
auto_allocate_ip: true
enabled: true
auto_allocate_ip_type: V4_ONLY
ipam_network_subnet:
network_ref: SEG-DONT-DELETE-AVI-Admin-E2E-Two-Arm-VSVIP
subnet:
ip_addr:
addr: 192.168.223.0
type: V4
mask: 24
Allocations_CloudZone_1:
type: Allocations.CloudZone
properties:
accountType: avilb
constraints:
- tag: avi-nsx
Idem_AVILB_APPLICATIONS_VIRTUAL_SERVICE_1:
type: Idem.AVILB.APPLICATIONS.VIRTUAL_SERVICE
properties:
name: vs-sg-${uuid()}
account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
vrf_context_ref: T1-DONT-DELETE-AVI-Admin-E2E
traffic_enabled: true
services:
- port: 8000
vsvip_ref: ${resource.Idem_AVILB_APPLICATIONS_VS_VIP_1.name}
pool_ref: ${resource.Idem_AVILB_APPLICATIONS_POOL_1.name}
Idem_AVILB_APPLICATIONS_POOL_1:
type: Idem.AVILB.APPLICATIONS.POOL
properties:
name: pool-sg-${uuid()}
account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
tier1_lr: DONT-DELETE-AVI-Admin-E2E
vrf_ref: T1-DONT-DELETE-AVI-Admin-E2E
lb_algorithm: LB_ALGORITHM_ROUND_ROBIN
health_monitor_refs:
- System-Ping
nsx_securitygroup:
- avinsxgroup
単一プール内の 2 つの異なるマシン クラスタ
servers プロパティの定義は、通常のバインド プロパティとは異なります。map_to_object 関数を呼び出す場合は、次のように 2 つのサーバ クラスタのアドレスを連結します。
${map_to_object(resource.Cloud_vSphere_Machine_1[*].address + resource.Cloud_vSphere_Machine_2[*].address, "ip", "addr")}
その他のコンポーネント(仮想サービス、VS VIP、健全性モニター、クラウド ゾーン割り当てヘルパーなど)は通常の方法で使用されます。
formatVersion: 1
inputs: {}
resources:
Idem_AVILB_PROFILES_HEALTH_MONITOR_1:
type: Idem.AVILB.PROFILES.HEALTH_MONITOR
properties:
name: monitor-${resource.Allocations_CustomNaming_1.selectedNames[0]}
type: HEALTH_MONITOR_PING
account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
is_federated: false
monitor_port: 8000
send_interval: 8
receive_timeout: 4
successful_checks: 4
failed_checks: 4
Allocations_CloudZone_1:
type: Allocations.CloudZone
properties:
accountType: avilb
constraints:
- tag: avi-vcenter
Idem_AVILB_APPLICATIONS_POOL_1:
type: Idem.AVILB.APPLICATIONS.POOL
properties:
name: pool-${resource.Allocations_CustomNaming_1.selectedNames[0]}
account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
lb_algorithm: LB_ALGORITHM_ROUND_ROBIN
default_server_port: 8000
servers: ${map_to_object(resource.Cloud_vSphere_Machine_1[*].address + resource.Cloud_vSphere_Machine_2[*].address, "ip", "addr")}
health_monitor_refs:
- ${resource.Idem_AVILB_PROFILES_HEALTH_MONITOR_1.name}
Idem_AVILB_APPLICATIONS_VS_VIP_1:
type: Idem.AVILB.APPLICATIONS.VS_VIP
properties:
name: vip-${resource.Allocations_CustomNaming_1.selectedNames[0]}
account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
vip:
- auto_allocate_ip: true
auto_allocate_ip_type: V4_ONLY
enabled: true
placement_networks:
- network_ref: ${resource.Cloud_vSphere_Network_1.resourceName}
subnet:
ip_addr:
addr: 10.202.20.0
type: V4
mask: 22
Allocations_CustomNaming_1:
type: Allocations.CustomNaming
properties:
resourceType: Generic
numberOfNamesToGenerate: 1
templateName: avi-vcenter-bp
Idem_AVILB_APPLICATIONS_VIRTUAL_SERVICE_1:
type: Idem.AVILB.APPLICATIONS.VIRTUAL_SERVICE
properties:
name: vs-${resource.Allocations_CustomNaming_1.selectedNames[0]}
account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
traffic_enabled: true
services:
- port: 8000
pool_ref: ${resource.Idem_AVILB_APPLICATIONS_POOL_1.name}
vsvip_ref: ${resource.Idem_AVILB_APPLICATIONS_VS_VIP_1.name}
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
count: 2
image: photon
cpuCount: 1
totalMemoryMB: 1024
networks:
- network: ${resource.Cloud_vSphere_Network_1.id}
assignment: static
Cloud_vSphere_Machine_2:
type: Cloud.vSphere.Machine
properties:
count: 3
image: photon
cpuCount: 1
totalMemoryMB: 1024
networks:
- network: ${resource.Cloud_vSphere_Network_1.id}
assignment: static
Cloud_vSphere_Network_1:
type: Cloud.vSphere.Network
properties:
networkType: existing