애플리케이션, 지속성 및 네트워크 프로파일과 같은 Avi Load Balancer 프로파일을 생성할 수 있습니다. 예를 들어 단일 지속성 프로파일을 생성하고 나중에 사용할 수 있도록 조직의 다른 팀에 제공할 수도 있습니다.

이러한 샘플 템플릿은 Avi Load Balancer 프로파일을 생성하기 위한 몇 가지 시나리오를 다룹니다. 첫 번째 예는 애플리케이션 프로파일, 지속성 프로파일 및 네트워크 프로파일이 포함된 템플릿을 생성하는 방법을 보여줍니다. 두 번째 예에서는 클라우드 영역 할당 도우미와 함께 Avi Load Balancer에서 사용할 수 있는 다양한 유형의 지속성 프로파일이 포함된 템플릿을 보여줍니다. 나머지 예는 단일 지속성 프로파일에 초점을 맞춥니다.

템플릿 예는 Avi Load Balancer 프로파일을 생성하기 위한 최소 요구 사항을 다룹니다. 조직과 관련된 템플릿을 생성할 때는 다른 속성이 필요할 수 있다는 점에 유의하십시오.

프로파일에 대한 자세한 내용은 "VMware NSX Advanced Load Balancer 구성" 가이드의 로드 밸런싱 섹션을 참조하십시오.

애플리케이션, 지속성 및 네트워크 프로파일

이 샘플 Avi Load Balancer 템플릿은 애플리케이션 프로파일, 네트워크 프로파일 및 지속성 프로파일을 사용합니다.

애플리케이션 프로파일은 가상 서비스의 동작을 결정합니다. 네트워크 프로파일은 네트워크 프로토콜의 유형과 설정을 결정합니다. 애플리케이션 프로파일과 네트워크 프로파일은 모두 가상 서비스와 연결됩니다. 지속성 프로파일은 지정된 기간 동안 클라이언트가 동일한 서버에 연결되어 있도록 하는 설정을 제어합니다. Avi Load Balancer 풀에 연결되어 있습니다.

formatVersion: 1
inputs:
  count:
    type: integer
    title: count
    default: 2
resources:
  Idem_AVILB_PROFILES_HEALTH_MONITOR_1:
    type: Idem.AVILB.PROFILES.HEALTH_MONITOR
    properties:
      name: prof-monitor-${uuid()}
      type: HEALTH_MONITOR_PING
      account: Avi
      tenant_ref: admin
      cloud_ref: cloud01_vcenter-cmbu-w01-vc11
      is_federated: false
      monitor_port: 8000
      send_interval: 8
      receive_timeout: 4
      successful_checks: 4
      failed_checks: 4
  Idem_AVILB_PROFILES_APPLICATION_PROFILE_1:
    type: Idem.AVILB.PROFILES.APPLICATION_PROFILE
    properties:
      name: prof-application-${uuid()}
      type: APPLICATION_PROFILE_TYPE_HTTP
      account: Avi
      http_profile:
        connection_multiplexing_enabled: true
        detect_ntlm_app: true
        websockets_enabled: true
  Idem_AVILB_PROFILES_NETWORK_PROFILE_1:
    type: Idem.AVILB.PROFILES.NETWORK_PROFILE
    properties:
      name: prof-network-${uuid()}
      account: Avi
      profile:
        type: PROTOCOL_TYPE_TCP_PROXY
        tcp_proxy_profile:
          automatic: true
  Idem_AVILB_APPLICATIONS_VS_VIP_1:
    type: Idem.AVILB.APPLICATIONS.VS_VIP
    properties:
      name: prof-vip-${uuid()}
      account: Avi
      tenant_ref: admin
      cloud_ref: cloud01_vcenter-cmbu-w01-vc11
      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
  Idem_AVILB_PROFILES_APPLICATION_PERSISTENCE_PROFILE_1:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    properties:
      name: prof-persistence-${uuid()}
      account: Avi
      persistence_type: PERSISTENCE_TYPE_CLIENT_IP_ADDRESS
      server_hm_down_recovery: HM_DOWN_PICK_NEW_SERVER
      ip_persistence_profile:
        ip_persistent_timeout: 5
  Idem_AVILB_APPLICATIONS_POOL_1:
    type: Idem.AVILB.APPLICATIONS.POOL
    properties:
      name: prof-pool-${uuid()}
      account: Avi
      tenant_ref: admin
      cloud_ref: cloud01_vcenter-cmbu-w01-vc11
      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")}
      application_persistence_profile_ref: ${resource.Idem_AVILB_PROFILES_APPLICATION_PERSISTENCE_PROFILE_1.name}
  Idem_AVILB_APPLICATIONS_VIRTUAL_SERVICE_1:
    type: Idem.AVILB.APPLICATIONS.VIRTUAL_SERVICE
    properties:
      name: prof-vs-${uuid()}
      account: Avi
      tenant_ref: admin
      cloud_ref: cloud01_vcenter-cmbu-w01-vc11
      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}
      application_profile_ref: ${resource.Idem_AVILB_PROFILES_APPLICATION_PROFILE_1.name}
      network_profile_ref: ${resource.Idem_AVILB_PROFILES_NETWORK_PROFILE_1.name}
  Cloud_vSphere_Machine_1:
    type: Cloud.vSphere.Machine
    properties:
      image: webserver
      cpuCount: 2
      totalMemoryMB: 4096
      networks:
        - network: ${resource.Cloud_vSphere_Network_1.id}
          assignment: static
      count: ${input.count}
  Cloud_vSphere_Network_1:
    type: Cloud.vSphere.Network
    properties:
      networkType: existing

지속성 프로파일 및 할당 도우미

이 샘플 템플릿에는 할당 도우미와 함께 모든 지속성 프로파일 유형이 포함되어 있습니다.

클라우드 영역 할당 도우미는 클라우드 계정의 태그를 기반으로 원하는 VMware Avi Load Balancer 컨트롤러에 배포 요청을 전달하는 데 도움을 줍니다.

formatVersion: 1
name: Create a ALB Persistence Profile
version: 1
inputs:
  env:
    type: string
    title: Environment
    description: Select Dev or Prod ALB environment
    default: env:dev
    oneOf:
      - title: Dev ALB
        const: env:dev
      - title: Prod ALB
        const: env:prod
  name:
    type: string
    title: Persistence Profile Name
    description: A user-friendly name for the persistence profile
  persistenceType:
    type: string
    title: Persistence Type
    description: Select a method used to persist clients to the same server for a duration of time or a session.
    oneOf:
      - title: App Cookie
        const: PERSISTENCE_TYPE_APP_COOKIE
      - title: Client IP Address
        const: PERSISTENCE_TYPE_CLIENT_IP_ADDRESS
      - title: Custom HTTP Header
        const: PERSISTENCE_TYPE_CUSTOM_HTTP_HEADER
      - title: GSLB Site
        const: PERSISTENCE_TYPE_GSLB_SITE
      - title: HTTP Cookie
        const: PERSISTENCE_TYPE_HTTP_COOKIE
      - title: TLS
        const: PERSISTENCE_TYPE_TLS
  server_hm_down_recovery:
    type: string
    title: Select New Server When Persistent Server Is Down ?
    description: Specifies behavior when a persistent server has been marked down by a health monitor. Enum options - HM_DOWN_PICK_NEW_SERVER, HM_DOWN_ABORT_CONNECTION, HM_DOWN_CONTINUE_PERSISTENT_SERVER
    default: HM_DOWN_PICK_NEW_SERVER
    oneOf:
      - title: Immediate
        const: HM_DOWN_PICK_NEW_SERVER
      - title: Never
        const: HM_DOWN_CONTINUE_PERSISTENT_SERVER
  timeout:
    type: integer
    title: Persistence Timeout
    description: The length of time after a client's connections have closed before expiring the client's persistence to a server. Allowed values are 1-720. Unit is Min.
    minimum: 1
    maximum: 720
    default: 20
  ip_mask:
    type: integer
    title: IP Mask
    description: Mask to be applied on client IP. This may be used to persist clients from a subnet to the same server. When set to 0, all requests are sent to the same server. Allowed values are 0-128.
    minimum: 0
    maximum: 128
    default: 0
  prst_hdr_name:
    type: string
    title: Custom Header / App Cookie Name
    description: Header or App Cookie name for application cookie persistence or custom http header.
    default: Set Header Name
  always_send_cookie:
    type: boolean
    title: Always Send Cookie ?
    description: If no persistence cookie was received from the client, always send it.
  cookie_name:
    type: string
    title: Cookie Name
    description: HTTP cookie name for cookie persistence.
    default: Set HTTP Cookie Name
  http_only:
    type: boolean
    title: HTTP Only
    description: Sets the HttpOnly attribute in the cookie. Setting this helps to prevent the client side scripts from accessing this cookie, if supported by browser.
  is_persistent_cookie:
    type: boolean
    title: Is Persistent Cookie
    description: When True, the cookie used is a persistent cookie, i.e. the cookie shouldn't be used at the end of the timeout. By default, it is set to false, making the cookie a session cookie, which allows clients to use it even after the timeout, if the session is still open.
resources:
  Allocations_CloudZone_1:
    type: Allocations.CloudZone
    metadata:
      layoutPosition:
        - 1
        - 2
    properties:
      accountType: avilb
      constraints:
        - tag: ${input.env}
  hdr_persistence_profile:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    metadata:
      layoutPosition:
        - 0
        - 1
    properties:
      name: ${input.name}
      account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
      description: Managed by Aria Automation
      count: ${input.persistenceType == "PERSISTENCE_TYPE_CUSTOM_HTTP_HEADER" ? 1 :0}
      persistence_type: ${input.persistenceType}
      server_hm_down_recovery: ${input.server_hm_down_recovery}
      hdr_persistence_profile:
        prst_hdr_name: ${input.prst_hdr_name}
  tls_persistence_profile:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    metadata:
      layoutPosition:
        - 0
        - 3
    properties:
      name: ${input.name}
      account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
      description: Managed by Aria Automation
      count: ${input.persistenceType == "PERSISTENCE_TYPE_TLS" ? 1 :0}
      persistence_type: ${input.persistenceType}
  app_cookie_persistence_profile:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    metadata:
      layoutPosition:
        - 1
        - 0
    properties:
      name: ${input.name}
      account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
      description: Managed by Aria Automation
      count: ${input.persistenceType == "PERSISTENCE_TYPE_APP_COOKIE" ? 1 :0}
      persistence_type: ${input.persistenceType}
      server_hm_down_recovery: ${input.server_hm_down_recovery}
      app_cookie_persistence_profile:
        prst_hdr_name: ${input.prst_hdr_name}
        timeout: ${input.timeout}
  ip_persistence_profile:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    metadata:
      layoutPosition:
        - 1
        - 1
    properties:
      name: ${input.name}
      account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
      description: Managed by Aria Automation
      count: ${input.persistenceType == "PERSISTENCE_TYPE_CLIENT_IP_ADDRESS" ? 1 :0}
      persistence_type: ${input.persistenceType}
      server_hm_down_recovery: ${input.server_hm_down_recovery}
      ip_persistence_profile:
        ip_mask: ${input.ip_mask}
        ip_persistent_timeout: ${input.timeout}
  gslb_persistence_profile:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    metadata:
      layoutPosition:
        - 1
        - 3
    properties:
      name: ${input.name}
      account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
      description: Managed by Aria Automation
      count: ${input.persistenceType == "PERSISTENCE_TYPE_GSLB_SITE" ? 1 :0}
      persistence_type: ${input.persistenceType}
      server_hm_down_recovery: ${input.server_hm_down_recovery}
      is_federated: true
      http_cookie_persistence_profile:
        cookie_name: ${input.cookie_name}
        is_persistent_cookie: ${input.is_persistent_cookie}
        timeout: ${input.timeout}
  http_cookie_persistence_profile:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    metadata:
      layoutPosition:
        - 1
        - 4
    properties:
      name: ${input.name}
      account: ${resource.Allocations_CloudZone_1.selectedCloudAccount.name}
      description: Managed by Aria Automation
      count: ${input.persistenceType == "PERSISTENCE_TYPE_HTTP_COOKIE" ? 1 :0}
      persistence_type: ${input.persistenceType}
      server_hm_down_recovery: ${input.server_hm_down_recovery}
      http_cookie_persistence_profile:
        always_send_cookie: ${input.always_send_cookie}
        cookie_name: ${input.cookie_name}
        http_only: ${input.http_only}
        is_persistent_cookie: ${input.is_persistent_cookie}
        timeout: ${input.timeout}

개별 지속성 프로파일

지속성 프로파일에 대한 자세한 내용은 "VMware NSX Advanced Load Balancer 구성" 가이드에서 지속성을 참조하십시오.

프로파일 샘플 템플릿

HTTP 쿠키 지속성 프로파일

이 샘플 템플릿은 Avi Load Balancer 클라우드 계정에서 HTTP 쿠키 지속성 프로파일을 생성하는 방법을 보여줍니다.

formatVersion: 1
name: Persistence Profile - HTTP Cookie
version: 1
inputs:
  name:
    type: string
    title: Persistence Profile Name
    description: A user-friendly name for the persistence profile
  server_hm_down_recovery:
    type: string
    title: Select New Server When Persistent Server Is Down ?
    description: Specifies behavior when a persistent server has been marked down by a health monitor. Enum options - HM_DOWN_PICK_NEW_SERVER, HM_DOWN_ABORT_CONNECTION, HM_DOWN_CONTINUE_PERSISTENT_SERVER
    default: HM_DOWN_PICK_NEW_SERVER
    oneOf:
      - title: Immediate
        const: HM_DOWN_PICK_NEW_SERVER
      - title: Never
        const: HM_DOWN_CONTINUE_PERSISTENT_SERVER
  timeout:
    type: integer
    title: Persistence Timeout
    description: The length of time after a client's connections have closed before expiring the client's persistence to a server. Allowed values are 1-720. Unit is Min.
    minimum: 1
    maximum: 720
    default: 20
  always_send_cookie:
    type: boolean
    title: Always Send Cookie ?
    description: If no persistence cookie was received from the client, always send it.
  cookie_name:
    type: string
    title: Cookie Name
    description: HTTP cookie name for cookie persistence.
  http_only:
    type: boolean
    title: HTTP Only
    description: Sets the HttpOnly attribute in the cookie. Setting this helps to prevent the client side scripts from accessing this cookie, if supported by browser.
  is_persistent_cookie:
    type: boolean
    title: Is Persistent Cookie
    description: When True, the cookie used is a persistent cookie, i.e. the cookie shouldn't be used at the end of the timeout. By default, it is set to false, making the cookie a session cookie, which allows clients to use it even after the timeout, if the session is still open.
resources:
  http_cookie_persistence_profile:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    metadata:
      layoutPosition:
        - 1
        - 1
    properties:
      name: ${input.name}
      account: avi-account
      description: Managed by Aria Automation
      persistence_type: PERSISTENCE_TYPE_HTTP_COOKIE
      server_hm_down_recovery: ${input.server_hm_down_recovery}
      http_cookie_persistence_profile:
        always_send_cookie: ${input.always_send_cookie}
        cookie_name: ${input.cookie_name}
        http_only: ${input.http_only}
        is_persistent_cookie: ${input.is_persistent_cookie}
        timeout: ${input.timeout}

애플리케이션 쿠키 지속성 프로파일

이 샘플 템플릿은 Avi Load Balancer 클라우드 계정에서 애플리케이션 쿠키 지속성 프로파일을 생성하는 방법을 보여줍니다.

formatVersion: 1
name: Persistence Profile - App Cookie
version: 1
inputs:
  name:
    type: string
    title: Persistence Profile Name
    description: A user-friendly name for the persistence profile
  server_hm_down_recovery:
    type: string
    title: Select New Server When Persistent Server Is Down ?
    description: Specifies behavior when a persistent server has been marked down by a health monitor. Enum options - HM_DOWN_PICK_NEW_SERVER, HM_DOWN_ABORT_CONNECTION, HM_DOWN_CONTINUE_PERSISTENT_SERVER
    default: HM_DOWN_PICK_NEW_SERVER
    oneOf:
      - title: Immediate
        const: HM_DOWN_PICK_NEW_SERVER
      - title: Never
        const: HM_DOWN_CONTINUE_PERSISTENT_SERVER
  timeout:
    type: integer
    title: Persistence Timeout
    description: The length of time after a client's connections have closed before expiring the client's persistence to a server. Allowed values are 1-720. Unit is Min.
    minimum: 1
    maximum: 720
    default: 20
  prst_hdr_name:
    type: string
    title: App Cookie Name
    description: App Cookie name for application cookie persistence or custom http header.
resources:
  app_cookie_persistence_profile:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    metadata:
      layoutPosition:
        - 1
        - 0
    properties:
      name: ${input.name}
      account: avi-account
      description: Managed by Aria Automation
      persistence_type: PERSISTENCE_TYPE_APP_COOKIE
      server_hm_down_recovery: ${input.server_hm_down_recovery}
      app_cookie_persistence_profile:
        prst_hdr_name: ${input.prst_hdr_name}
        timeout: ${input.timeout}

HTTP 사용자 지정 헤더 지속성 프로파일

이 샘플 템플릿은 Avi Load Balancer 클라우드 계정에서 사용자 지정 HTTP 헤더 지속성 프로파일을 생성하는 방법을 보여줍니다.

formatVersion: 1
name: Persistence Profile - Custom HTTP Header
version: 1
inputs:
  name:
    type: string
    title: Persistence Profile Name
    description: A user-friendly name for the persistence profile
  server_hm_down_recovery:
    type: string
    title: Select New Server When Persistent Server Is Down ?
    description: Specifies behavior when a persistent server has been marked down by a health monitor. Enum options - HM_DOWN_PICK_NEW_SERVER, HM_DOWN_ABORT_CONNECTION, HM_DOWN_CONTINUE_PERSISTENT_SERVER
    default: HM_DOWN_PICK_NEW_SERVER
    oneOf:
      - title: Immediate
        const: HM_DOWN_PICK_NEW_SERVER
      - title: Never
        const: HM_DOWN_CONTINUE_PERSISTENT_SERVER
  prst_hdr_name:
    type: string
    title: Custom Header Name
    description: Header name for application cookie persistence or custom http header.
resources:
  hdr_persistence_profile:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    metadata:
      layoutPosition:
        - 0
        - 1
    properties:
      name: ${input.name}
      account: avi-account
      description: Managed by Aria Automation
      persistence_type: PERSISTENCE_TYPE_CUSTOM_HTTP_HEADER
      server_hm_down_recovery: ${input.server_hm_down_recovery}
      hdr_persistence_profile:
        prst_hdr_name: ${input.prst_hdr_name}

클라이언트 IP 지속성 프로파일

이 샘플 템플릿은 Avi Load Balancer 클라우드 계정에서 클라이언트 IP 지속성 프로파일을 생성하는 방법을 보여줍니다.

formatVersion: 1
name: Persistence Profile - Client IP
version: 1
inputs:
  name:
    type: string
    title: Persistence Profile Name
    description: A user-friendly name for the persistence profile
  server_hm_down_recovery:
    type: string
    title: Select New Server When Persistent Server Is Down ?
    description: Specifies behavior when a persistent server has been marked down by a health monitor. Enum options - HM_DOWN_PICK_NEW_SERVER, HM_DOWN_ABORT_CONNECTION, HM_DOWN_CONTINUE_PERSISTENT_SERVER
    default: HM_DOWN_PICK_NEW_SERVER
    oneOf:
      - title: Immediate
        const: HM_DOWN_PICK_NEW_SERVER
      - title: Never
        const: HM_DOWN_CONTINUE_PERSISTENT_SERVER
  timeout:
    type: integer
    title: Persistence Timeout
    description: The length of time after a client's connections have closed before expiring the client's persistence to a server. Allowed values are 1-720. Unit is Min.
    minimum: 1
    maximum: 720
    default: 20
  ip_mask:
    type: integer
    title: IP Mask
    description: Mask to be applied on client IP. This may be used to persist clients from a subnet to the same server. When set to 0, all requests are sent to the same server. Allowed values are 0-128.
    minimum: 0
    maximum: 128
    default: 0
resources:
  ip_persistence_profile:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    metadata:
      layoutPosition:
        - 1
        - 1
    properties:
      name: ${input.name}
      account: avi-account
      description: Managed by Aria Automation
      persistence_type: PERSISTENCE_TYPE_CLIENT_IP_ADDRESS
      server_hm_down_recovery: ${input.server_hm_down_recovery}
      ip_persistence_profile:
        ip_mask: ${input.ip_mask}
        ip_persistent_timeout: ${input.timeout}

TLS 지속성 프로파일

이 샘플 템플릿은 Avi Load Balancer 클라우드 계정에서 TLS 지속성 프로파일을 생성하는 방법을 보여줍니다.

formatVersion: 1
name: Persistence Profile - TLS
version: 1
inputs:
  name:
    type: string
    title: Persistence Profile Name
    description: A user-friendly name for the persistence profile
resources:
  tls_persistence_profile:
    type: Idem.AVILB.PROFILES.APPLICATION_PERSISTENCE_PROFILE
    metadata:
      layoutPosition:
        - 0
        - 1
    properties:
      name: ${input.name}
      account: avi-account
      description: Managed by Aria Automation
      persistence_type: PERSISTENCE_TYPE_TLS