Openstack:在单个文件中创建AutoScalingGroup

时间:2018-09-14 16:43:52

标签: load-balancing openstack autoscaling

我正在尝试创建自动缩放比例,但出现此错误:

“错误:错误:resources.autoscaling1 ::找不到资源类型(vmteste)。”

我知道我可以在创建自动缩放比例之前注册实例和平衡器的成员,但是我想将所有内容传递到一个文件中,这有可能吗?

heat_template_version: 2017-09-01
description: > 
  Template stack gerado por ucloud input
resources: 
  autoscaling1:
    type: OS::Heat::AutoScalingGroup
    properties:
      max_size: 3
      min_size: 1
      cooldown: 5
      desired_capacity: 1
      resource: 
        type: {get_resource: vmteste}
        properties:
          flavor: 1VCPU-1GBRAM
          image: Ubuntu-18.04-x86_64
          key_name: {get_resource: chav1}
          pool_id: {get_resource: pool-balanceador1}
          security_groups: {get_resource: sgteste}
          metadata:
            metering.server_group: {get_param: 'OS::stack_id'}
  balanceador1:
    type: OS::Neutron::LBaaS::LoadBalancer
    properties:
      name: BALANCEADOR1
      vip_subnet: {get_resource: subnettoredeteste}
  monitor-balanceador1:
    type: OS::Neutron::LBaaS::HealthMonitor
    properties:
      delay: 5
      max_retries: 3
      timeout: 5
      type: PING
      pool: {get_resource: pool-balanceador1}
  pool-balanceador1:
    type: OS::Neutron::LBaaS::Pool
    properties:
      name: POOL-BALANCEADOR1
      lb_algorithm: ROUND_ROBIN
      protocol: TCP
      listener: {get_resource: listerner-balanceador1}
  listerner-balanceador1:
    type: OS::Neutron::LBaaS::Listener
    properties:
      name: LISTERNER-BALANCEADOR1
      protocol: TCP
      protocol_port: 22
      loadbalancer: {get_resource: balanceador1}
  redeteste:
    type: OS::Neutron::Net
    properties: {name: REDETESTE}
  subnettoredeteste:
    type: OS::Neutron::Subnet
    properties:
      name: SUBNETTOREDETESTE
      network: {get_resource: redeteste}
      cidr: 172.19.158.128/25
      dns_nameservers: [8.8.8.8, 8.8.4.4]
      ip_version: 4
  chav1:
    type: OS::Nova::KeyPair
    properties:  { name: CHAV1, public_key: -----BEGIN PUBLIC KEY-----
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJxGUDUmNJhgPMfspOvI9o0dSmAnscx4
In8s+GykEJXpS6lxownW3s7fjJeK2El5Uiv2Jd/kYe1y0VncOmj9KRMCAwEAAQ==
-----END PUBLIC KEY-----}
  sgteste:
    type: OS::Neutron::SecurityGroup
    properties:
      name: SGTESTE
      rules:
      - {port_range_max: 22, port_range_min: 22, protocol: tcp, remote_ip_prefix: 0.0.0.0/0}
  policytoautoscaling11:
    type: OS::Heat::ScalingPolicy
    properties:
      adjustment_type: change_in_capacity
      auto_scaling_group_id: {get_resource: autoscaling1}
      scaling_adjustment: 1
      cooldown: 60
  vmteste:
    type: OS::Nova::Server
    properties: 
      name: VMTESTE
      flavor: 1VCPU-1GBRAM
      image: Ubuntu-18.04-x86_64
      key_name: {get_resource: chav1}
      security_groups:
      - default
      - {get_resource: sgteste}
      networks:
      - network: {get_resource: redeteste}
  menbervm:
    type: OS::Neutron::LBaaS::PoolMember
    properties:
      address: 172.19.158.129
      admin_state_up: true
      pool: {get_resource: pool-balanceador1}
      protocol_port: 22
      subnet: {get_resource: subnettoredeteste}
      weight: 1

0 个答案:

没有答案