vRealize Automation 8.x-云模板网络配置

在vRA8中使用现有网络配置文件,是一种最部署网络的方式。在这种情况下,不需要动态创建网络组件,因此配置会很容易。

以下步骤将显示如何创建网络配置文件并进行相应配置。

  1. 转到基础架构>配置>网络配置文件页面,然后单击新建[网络配置文件]
  2. 在“摘要”页面上,提供以下信息:
    • 帐户/区域
    • 名称
    • 描述(可选)
    • 功能标记,可以在云模板中匹配该标记
  3. 在“网络”页面上,添加适当的现有网络。请记住,如果您拥有更多的网络,则可以将标签用作蓝图约束,以便与已标记的网络进行匹配以避免歧义。
  4. 在“网络策略”页面上,无需执行任何配置。
  5. 点击创建

vRealize Automation 8.x-云模板网络配置

 

vRealize Automation 8.x-云模板网络配置

vRealize Automation 8.x-云模板网络配置

创建网络配置文件后,可以转到云模板并添加一个网络元素。以下是yaml显示的代码,用于到现有网络的ElasticSearch部署(这里以安装ElasticSeach为例,使用标签来标识当前的网络配置文件):

formatVersion: 1

name: ElasticStack

version: 1

description: Installs Elastic Stack on a single machine

inputs:

  image:

    type: string

    enum:

      - CentOS-7.8

      - CentOS-8.2

    description: 请选择操作系统

    title: 操作系统

    default: CentOS-7.8

  flavor:

    type: string

    enum:

      - 小型

      - 中型

      - 大型

    description: 请选择类型

    title: 类型

    default: 中型

  network:

    type: string

    title: 网络

    description: 请选择网络

    default: 'network:vlan41'

  region:

    type: string

    description: 请选择部署区域

    title: 区域

    default: 'cloud:prod'

  key:

    type: string

    title: Public Key

    description: 请输入Public Key

    default: 请输入Public Key

  name:

    type: string

    title: 虚拟机名称

    description: 请输入虚拟机名称

resources:

  Elastic_Stack_NODE:

    type: Cloud.Machine

    properties:

      name: elastic_stack_node

      flavor: '${input.flavor}'

      image: '${input.image}'

      cloudConfig: |

        #cloudconfig

        repo_update: true

        repo_upgrade: all

        package_update: true

        package_upgrade: all

        hostname: ${input.name}

        manage_etc_hosts: true

 

        runcmd:

        - echo "${input.key}" >> /root/.ssh/authorized_keys

        - echo "${input.key}" >> /home/ubuntu/.ssh/authorized_keys

        - chmod 400 /root/.ssh/vmware.pub

      networks:

        - name: '${Elastic_Stack_Network.name}'

          tags: []

          network: '${resource.Elastic_Stack_Network.id}'

          securityGroups: []

          assignPublicIpAddress: false

      constraints:

        - tag: '${input.region}'

  Elastic_Stack_Network:

    type: Cloud.Network

    properties:

      name: Elastic_Stack_Network

      networkType: existing

      constraints:

       - tag: '${input.network}'