Baremetal deployment on top on Ironic
Heat templates have been refactored to deploy both VM
cases and baremetal nodes cases on top of Ironic.
Related-PROD: PRODX-2342
Change-Id: I6439ec670c69d67b65eb1806040a64f800dc6628
diff --git a/de/heat-templates/fragments/NetworkAccBM.yaml b/de/heat-templates/fragments/NetworkAccBM.yaml
new file mode 100644
index 0000000..3ebfb3b
--- /dev/null
+++ b/de/heat-templates/fragments/NetworkAccBM.yaml
@@ -0,0 +1,13 @@
+heat_template_version: queens
+
+parameters:
+ public_net_id:
+ type: string
+
+resources:
+
+outputs:
+ public_network:
+ value: { get_param: public_net_id }
+ accessible_subnet_id:
+ value: ''
diff --git a/de/heat-templates/fragments/NetworkAccVM.yaml b/de/heat-templates/fragments/NetworkAccVM.yaml
new file mode 100644
index 0000000..8b03070
--- /dev/null
+++ b/de/heat-templates/fragments/NetworkAccVM.yaml
@@ -0,0 +1,36 @@
+heat_template_version: queens
+
+parameters:
+ public_net_id:
+ type: string
+
+resources:
+
+ network:
+ type: OS::Neutron::Net
+ subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network: { get_resource: network }
+ enable_dhcp: true
+ cidr: '10.10.0.0/24'
+ dns_nameservers:
+ - 172.18.224.6
+ - 172.18.176.6
+ router:
+ type: OS::Neutron::Router
+ properties:
+ external_gateway_info:
+ network: { get_param: public_net_id }
+ router_iface:
+ type: OS::Neutron::RouterInterface
+ properties:
+ router: { get_resource: router }
+ subnet: { get_resource: subnet }
+
+
+outputs:
+ public_network:
+ value: { get_resource: network }
+ accessible_subnet_id:
+ value: { get_resource: subnet }
diff --git a/de/heat-templates/fragments/NetworkPrvFl.yaml b/de/heat-templates/fragments/NetworkPrvFl.yaml
new file mode 100644
index 0000000..0509def
--- /dev/null
+++ b/de/heat-templates/fragments/NetworkPrvFl.yaml
@@ -0,0 +1,23 @@
+heat_template_version: queens
+
+parameters:
+ private_floating_network_cidr:
+ type: string
+
+resources:
+
+ network:
+ type: OS::Neutron::Net
+ subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network: { get_resource: network }
+ enable_dhcp: false
+ cidr: { get_param: private_floating_network_cidr }
+ gateway_ip: ~
+
+outputs:
+ private_floating_network_id:
+ value: { get_resource: network }
+ private_floating_subnet_id:
+ value: { get_resource: subnet }
diff --git a/de/heat-templates/fragments/SrvInstancesBM.yaml b/de/heat-templates/fragments/SrvInstancesBM.yaml
new file mode 100644
index 0000000..166b510
--- /dev/null
+++ b/de/heat-templates/fragments/SrvInstancesBM.yaml
@@ -0,0 +1,108 @@
+heat_template_version: queens
+
+parameters:
+
+ metadata:
+ type: json
+ default: {}
+ node_type:
+ type: string
+ key_name:
+ type: string
+ description: Name of keypair to assign to servers
+ image:
+ type: string
+ description: Name of image to use for servers
+ flavor:
+ type: string
+ description: Flavor to use for servers
+ accessible_network:
+ type: string
+ accessible_subnet_id:
+ type: string
+ private_floating_network:
+ type: string
+ private_floating_network_cidr:
+ type: string
+ private_floating_subnet_id:
+ type: string
+ private_floating_interface:
+ type: string
+ host_interface:
+ type: string
+ functions_override:
+ type: string
+ boot_timeout:
+ type: number
+ description: Boot timeout for instance
+ default: 1200
+ ucp_master_host:
+ type: string
+ default: ''
+ public_net_id:
+ type: string
+ default: ''
+
+resources:
+
+ software_config:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: ../scripts/instance_boot.sh }
+ params:
+ $node_type: { get_param: node_type }
+ $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
+ $ucp_license_key: { get_file: ../scripts/license.lic }
+ $ucp_master_host: { get_param: ucp_master_host }
+ $node_metadata: { get_param: metadata }
+ $host_interface: { get_param: host_interface }
+ $private_floating_interface: { get_param: private_floating_interface }
+ $private_floating_network_cidr: { str_split: ['/', { get_param: private_floating_network_cidr }, 1] }
+ $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
+ $functions_override: { get_param: functions_override }
+
+ server:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: image }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ availability_zone: nova
+ networks:
+ - network: { get_param: accessible_network }
+ # NOTE(ohryhorov): connect to accessible network only as ironic doesn't
+ # support multitenancy use-case. Use private_floating_network for IPAM only.
+ user_data_format: RAW
+ user_data: { get_resource: software_config }
+ metadata: { get_param: metadata }
+
+ private_floating_server_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: private_floating_network }
+ port_security_enabled: false
+ fixed_ips:
+ - subnet: { get_param: private_floating_subnet_id }
+
+ wait_handle:
+ type: OS::Heat::WaitConditionHandle
+ wait_condition:
+ type: OS::Heat::WaitCondition
+ properties:
+ handle: { get_resource: wait_handle }
+ timeout: { get_param: boot_timeout }
+
+
+outputs:
+ server_private_ip:
+ description: IP address of server in private network
+ value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
+ server_private_floating_ip:
+ description: IP address of server in private floating network
+ value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
+ server_public_ip:
+ description: Floating IP address of server in public network
+ value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
diff --git a/de/heat-templates/fragments/SrvInstancesVM.yaml b/de/heat-templates/fragments/SrvInstancesVM.yaml
new file mode 100644
index 0000000..7cb89ae
--- /dev/null
+++ b/de/heat-templates/fragments/SrvInstancesVM.yaml
@@ -0,0 +1,119 @@
+heat_template_version: queens
+
+parameters:
+
+ metadata:
+ type: json
+ default: {}
+ node_type:
+ type: string
+ key_name:
+ type: string
+ description: Name of keypair to assign to servers
+ image:
+ type: string
+ description: Name of image to use for servers
+ flavor:
+ type: string
+ description: Flavor to use for servers
+ accessible_network:
+ type: string
+ accessible_subnet_id:
+ type: string
+ private_floating_network:
+ type: string
+ private_floating_network_cidr:
+ type: string
+ private_floating_subnet_id:
+ type: string
+ private_floating_interface:
+ type: string
+ host_interface:
+ type: string
+ functions_override:
+ type: string
+ boot_timeout:
+ type: number
+ description: Boot timeout for instance
+ default: 1200
+ ucp_master_host:
+ type: string
+ default: ''
+ public_net_id:
+ type: string
+
+resources:
+
+ software_config:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: ../scripts/instance_boot.sh }
+ params:
+ $node_type: { get_param: node_type }
+ $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
+ $ucp_license_key: { get_file: ../scripts/license.lic }
+ $ucp_master_host: { get_param: ucp_master_host }
+ $node_metadata: { get_param: metadata }
+ $host_interface: { get_param: host_interface }
+ $private_floating_interface: { get_param: private_floating_interface }
+ $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
+ $private_floating_network_cidr: { str_split: ['/', { get_param: private_floating_network_cidr }, 1] }
+ $functions_override: { get_param: functions_override }
+
+ server:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: image }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ availability_zone: nova
+ networks:
+ - port: { get_resource: accessible_server_port }
+ - port: { get_resource: private_floating_server_port }
+ user_data_format: RAW
+ user_data: { get_resource: software_config }
+ metadata: { get_param: metadata }
+
+ accessible_server_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: accessible_network }
+ port_security_enabled: false
+ fixed_ips:
+ - subnet: { get_param: accessible_subnet_id }
+
+ private_floating_server_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: private_floating_network }
+ port_security_enabled: false
+ fixed_ips:
+ - subnet: { get_param: private_floating_subnet_id }
+
+ server_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: accessible_server_port }
+
+ wait_handle:
+ type: OS::Heat::WaitConditionHandle
+ wait_condition:
+ type: OS::Heat::WaitCondition
+ properties:
+ handle: { get_resource: wait_handle }
+ timeout: { get_param: boot_timeout }
+
+outputs:
+ server_private_ip:
+ description: IP address of server in private network
+ value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
+ server_private_floating_ip:
+ description: IP address of server in private floating network
+ value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
+ server_public_ip:
+ description: Floating IP address of server in public network
+ value: { get_attr: [ server_floating_ip, floating_ip_address ] }