Ask Your Question
0

Create AutoScalingGroup in a single file

asked 2018-09-14 09:21:34 -0600

I'm trying to create an auto scaling but I'm having this error:

"Erro: ERROR: resources.autoscaling1<nested_stack>: : The Resource Type (vmteste) could not be found."

I know I can register the instance and the member of the balancer before creating auto scaling but I want to pass everything in a single file, is it possible?

>  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
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-09-17 16:09:32 -0600

zaneb gravatar image

The resource.type property must be a valid resource type, like OS::Nova::Server. The way you have defined it, the vmteste resource would be created in the parent stack and then an invalid resource type passed to the autoscaling group. You want to copy the whole definition of vmteste into the resource property of the scaling group.

However, there is no way to include the LBaaS pool member in the scaled unit of the group without creating a second template that encapsulates the server and pool member resources.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-09-14 09:21:34 -0600

Seen: 13 times

Last updated: Sep 17