Gary Wu | 3fd6c2a | 2018-10-28 21:44:00 -0700 | [diff] [blame] | 1 | ${VM_TYPE}_${VM_NUM}_private_port: |
Gary Wu | 14a6b30 | 2018-05-01 15:59:28 -0700 | [diff] [blame] | 2 | type: OS::Neutron::Port |
| 3 | properties: |
| 4 | network: { get_resource: oam_network } |
| 5 | fixed_ips: [{"subnet": { get_resource: oam_subnet }}] |
| 6 | security_groups: |
| 7 | - { get_resource: onap_sg } |
| 8 | |
Gary Wu | 3fd6c2a | 2018-10-28 21:44:00 -0700 | [diff] [blame] | 9 | ${VM_TYPE}_${VM_NUM}_floating_ip: |
Gary Wu | 14a6b30 | 2018-05-01 15:59:28 -0700 | [diff] [blame] | 10 | type: OS::Neutron::FloatingIP |
| 11 | properties: |
| 12 | floating_network_id: { get_param: public_net_id } |
Gary Wu | 3fd6c2a | 2018-10-28 21:44:00 -0700 | [diff] [blame] | 13 | port_id: { get_resource: ${VM_TYPE}_${VM_NUM}_private_port } |
Gary Wu | 14a6b30 | 2018-05-01 15:59:28 -0700 | [diff] [blame] | 14 | |
Gary Wu | b718998 | 2018-11-14 10:01:37 -0800 | [diff] [blame] | 15 | ${VM_TYPE}_${VM_NUM}_vm_scripts: |
| 16 | type: OS::Heat::CloudConfig |
| 17 | properties: |
| 18 | cloud_config: |
| 19 | power_state: |
| 20 | mode: reboot |
| 21 | runcmd: |
| 22 | - [ /opt/k8s_vm_install.sh ] |
| 23 | write_files: |
| 24 | - path: /opt/k8s_vm_install.sh |
| 25 | permissions: '0755' |
| 26 | content: |
| 27 | str_replace: |
| 28 | params: |
| 29 | __docker_proxy__: { get_param: docker_proxy } |
| 30 | __apt_proxy__: { get_param: apt_proxy } |
| 31 | __docker_version__: { get_param: docker_version } |
| 32 | __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] } |
| 33 | __rancher_private_ip_addr__: { get_attr: [rancher_floating_ip, fixed_ip_address] } |
| 34 | __host_private_ip_addr__: { get_attr: [${VM_TYPE}_${VM_NUM}_floating_ip, fixed_ip_address] } |
Gary Wu | 5dac73a | 2018-11-17 17:14:38 -0800 | [diff] [blame] | 35 | __mtu__: { get_param: mtu } |
Gary Wu | b718998 | 2018-11-14 10:01:37 -0800 | [diff] [blame] | 36 | template: |
| 37 | get_file: k8s_vm_install.sh |
| 38 | - path: /opt/k8s_vm_init.sh |
| 39 | permissions: '0755' |
| 40 | content: |
| 41 | str_replace: |
| 42 | params: |
| 43 | __host_private_ip_addr__: { get_attr: [${VM_TYPE}_${VM_NUM}_floating_ip, fixed_ip_address] } |
| 44 | __host_label__: '$HOST_LABEL' |
| 45 | template: |
| 46 | get_file: k8s_vm_init.sh |
| 47 | - path: /etc/init.d/k8s_vm_init_serv |
| 48 | permissions: '0755' |
| 49 | content: |
| 50 | get_file: k8s_vm_init_serv.sh |
| 51 | |
| 52 | ${VM_TYPE}_${VM_NUM}_vm_config: |
| 53 | type: OS::Heat::MultipartMime |
| 54 | properties: |
| 55 | parts: |
| 56 | - config: { get_resource: ${VM_TYPE}_${VM_NUM}_vm_scripts } |
| 57 | |
Gary Wu | 3fd6c2a | 2018-10-28 21:44:00 -0700 | [diff] [blame] | 58 | ${VM_TYPE}_${VM_NUM}_vm: |
Gary Wu | 14a6b30 | 2018-05-01 15:59:28 -0700 | [diff] [blame] | 59 | type: OS::Nova::Server |
| 60 | properties: |
eHanan | 97b7a9c | 2018-09-05 14:09:19 +0100 | [diff] [blame] | 61 | name: |
Gary Wu | 3fd6c2a | 2018-10-28 21:44:00 -0700 | [diff] [blame] | 62 | list_join: ['-', [ { get_param: 'OS::stack_name' }, '${VM_TYPE}', '${VM_NUM}' ] ] |
Gary Wu | 14a6b30 | 2018-05-01 15:59:28 -0700 | [diff] [blame] | 63 | image: { get_param: ubuntu_1604_image } |
Gary Wu | 3fd6c2a | 2018-10-28 21:44:00 -0700 | [diff] [blame] | 64 | flavor: { get_param: ${VM_TYPE}_vm_flavor } |
gwu | 10db462 | 2018-07-17 22:11:39 -0700 | [diff] [blame] | 65 | key_name: { get_param: key_name } |
Gary Wu | 14a6b30 | 2018-05-01 15:59:28 -0700 | [diff] [blame] | 66 | networks: |
Gary Wu | 3fd6c2a | 2018-10-28 21:44:00 -0700 | [diff] [blame] | 67 | - port: { get_resource: ${VM_TYPE}_${VM_NUM}_private_port } |
Gary Wu | b718998 | 2018-11-14 10:01:37 -0800 | [diff] [blame] | 68 | user_data_format: SOFTWARE_CONFIG |
| 69 | user_data: { get_resource: ${VM_TYPE}_${VM_NUM}_vm_config } |
Gary Wu | 14a6b30 | 2018-05-01 15:59:28 -0700 | [diff] [blame] | 70 | |