Skip to content
Snippets Groups Projects
gc_HOT.yaml 14.1 KiB
Newer Older
---
heat_template_version: 2013-05-23
description: "A simple template to boot a cluster of desktops (LoginNode, ManagementNodes and Desktop Nodes)"
# avz parameters disabled. they are working but I want just more options than monash-02. I would like to have a parameter that says "I don't care"

parameters:
  ubuntu_1804_image_id:
    type: string
    label: Image ID
    description: Ubuntu Image
    default: 99d9449a-084f-4901-8bd8-c04aebd589ca
  centos_7_image_id:
    type: string
    label: Image ID
    description: Centos Image
    default: c47c3acb-9657-4243-9e14-e6c676157e3b #with NetworkManager
  ssh_key:
    type: string
    default: gc_key
  avz:
    type: string
    default: monash-02
  project_name:
    type: string
  NetID:
    type: string
    default: Classic Provider
  Flavour:
    type: string
Andreas Hamacher's avatar
Andreas Hamacher committed
    default: m3.xsmall


resources:

  SlurmSecGroup:
   type: "OS::Neutron::SecurityGroup"
   properties:
     name: "heatslurmsecgroup"
     rules: [ { protocol: tcp,
               port_range_min: 12000,
               port_range_max: 12999},
              { protocol: tcp,
               port_range_min: 6817,
               port_range_max: 6819},
              { protocol: tcp,
               port_range_min: 1019,
               port_range_max: 1019}]
  NFSSecGroup:
   type: "OS::Neutron::SecurityGroup"
   properties:
     name: "heatnfssecgroup"
     rules: [ { protocol: tcp,
               port_range_min: 2049,
               port_range_max: 2049},
              { protocol: tcp,
               port_range_min: 111,
               port_range_max: 111},
              { protocol: udp,
               port_range_min: 2049,
               port_range_max: 2049},
              { protocol: udp,
               port_range_min: 111,
Jafar Lie's avatar
Jafar Lie committed
               port_range_max: 111} ]
  MySQLSecGroup:
   type: "OS::Neutron::SecurityGroup"
   properties:
     name: "heatmysqlsecgroup"
     rules: [ { protocol: tcp,
               port_range_min: 3306,
               port_range_max: 3306,
               remote_security_group: MySQLSecGroup} ]
  SSHMonashSecGroup:
   type: "OS::Neutron::SecurityGroup"
   properties:
     name: "SSHMonashSecGroup"
     rules: [ { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
Jafar Lie's avatar
Jafar Lie committed
               remote_ip_prefix: 59.191.208.0/20
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
Jafar Lie's avatar
Jafar Lie committed
               remote_ip_prefix: 114.30.64.0/21
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 118.138.0.0/16
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 118.139.0.0/17
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 130.194.0.0/16
Jafar Lie's avatar
Jafar Lie committed
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 203.0.141.0/24
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 203.6.141.0/24
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 203.23.136.0/24
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 59.191.192.0/20
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 202.158.212.32/27
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 130.194.13.96/27
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 49.127.0.0/16
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 202.58.246.0/24
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 202.94.69.0/24
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 103.35.228.0/22
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 43.246.232.0/22
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 103.35.228.0/22
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 59.191.208.0/20
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 49.127.0.0/16
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 59.191.220.0/22
     },
     { protocol: tcp,
               port_range_min: 22,
               port_range_max: 22,
               direction: ingress,
               remote_ip_prefix: 43.246.232.0/22
     } ]
#  SSHInternalSecGroup:
#   type: "OS::Neutron::SecurityGroup"
#   properties:
#     name: "SSHInternalSecGroup"
#     rules: [ { protocol: tcp,
#               port_range_min: 22,
#               port_range_max: 22,
#               direction: ingress} ]
               #remote_ip_prefix: { get_param: REMOTE_IP }, direction: ingress
  webaccess:
   type: "OS::Neutron::SecurityGroup"
   properties:
     name: "webaccess"
     rules: [ { protocol: tcp,
               port_range_min: 80,
               port_range_max: 80},
              { protocol: tcp,
               port_range_min: 443,
               port_range_max: 443} ]

  SQLNode0:
   type: "OS::Nova::Server"
   properties:
    name:
     list_join: [ '-', [ { get_param: "OS::stack_name" }, 'sql0' ]]
    availability_zone: { get_param: avz }
    flavor: m3.small
Jafar Lie's avatar
Jafar Lie committed
    image: { get_param: ubuntu_1804_image_id }
    security_groups: [ default, { get_resource: SSHMonashSecGroup }, { get_resource: SlurmSecGroup }, { get_resource: MySQLSecGroup }, { get_resource: NFSSecGroup } ]
    metadata:
     ansible_host_groups: [ SQLNodes, NFSNodes ]
Jafar Lie's avatar
Jafar Lie committed
     ansible_ssh_user: ubuntu
     project_name: { get_param: project_name }
    networks:
      - network: { get_param: NetID }

  NFSVolume:
   type: OS::Cinder::Volume
   properties:
    availability_zone: { get_param: avz }
    size: 1
    name: nfsvol
  NFSVolumeAttachment:
   type: "OS::Cinder::VolumeAttachment"
   properties:
    volume_id: { get_resource: NFSVolume }
    instance_uuid: { get_resource: SQLNode0 }

  SLURMSTATEVolume:
   type: OS::Cinder::Volume
   properties:
    availability_zone: { get_param: avz }
    size: 1
    name: slurmstate
  SLURMSTATEVolumeAttachment:
   type: "OS::Cinder::VolumeAttachment"
   properties:
    volume_id: { get_resource: SLURMSTATEVolume }
    instance_uuid: { get_resource: SQLNode0 }

  DBVolume:
   type: OS::Cinder::Volume
   properties:
    availability_zone: { get_param: avz }
    size: 10
    name: dbvol
  DBVolumeAttachment:
   type: "OS::Cinder::VolumeAttachment"
   properties:
    volume_id: { get_resource: DBVolume }
    instance_uuid: { get_resource: SQLNode0 }

Jafar Lie's avatar
Jafar Lie committed
  MgmtNodesC:
Jafar Lie's avatar
Jafar Lie committed
    count: 0
    resource_def:
      type: My::Server::MgmtNode
      properties:
        #avz: { get_param: avz }
        image: { get_param: centos_7_image_id }
        ansible_ssh_user: ec2-user
        mynodename:
         list_join: [ '-', [ { get_param: "OS::stack_name" }, 'mgmt%index%' ]]
        ssh_key: { get_param: ssh_key }
        security_groups: [ default, { get_resource: SSHMonashSecGroup }, { get_resource: SlurmSecGroup }, { get_resource: NFSSecGroup }, { get_resource: MySQLSecGroup } ]
Jafar Lie's avatar
Jafar Lie committed
        project_name: { get_param: project_name }
Jafar Lie's avatar
Jafar Lie committed

Jafar Lie's avatar
Jafar Lie committed
  MgmtNodesU:
   type: "OS::Heat::ResourceGroup"
   properties:
    count: 2
    resource_def:
      type: My::Server::MgmtNode
      properties:
        #avz: { get_param: avz }
        image: { get_param: ubuntu_1804_image_id }
        ansible_ssh_user: ubuntu
        mynodename:
Jafar Lie's avatar
Jafar Lie committed
         list_join: [ '-', [ { get_param: "OS::stack_name" }, 'mgmtU%index%' ]]
Jafar Lie's avatar
Jafar Lie committed
        ssh_key: { get_param: ssh_key }
        security_groups: [ default, { get_resource: SSHMonashSecGroup }, { get_resource: SlurmSecGroup }, { get_resource: NFSSecGroup }, { get_resource: MySQLSecGroup } ]
  LoginNodesC:
   type: "OS::Heat::ResourceGroup"
   properties:
    count: 1
    resource_def:
     type: "OS::Nova::Server"
     properties:
      #availability_zone: { get_param: avz }
      flavor: m3.xsmall
      image: { get_param: centos_7_image_id }
      key_name: { get_param: ssh_key }
      name:
       list_join: [ '-', [ { get_param: "OS::stack_name" }, 'login%index%' ]]
      security_groups: [ default, { get_resource: SSHMonashSecGroup }, { get_resource: SlurmSecGroup }, { get_resource: NFSSecGroup } ]
      metadata:
       ansible_host_groups: [ LoginNodes ]
       ansible_ssh_user: ec2-user
       project_name: { get_param: project_name }
      networks:
       - network: { get_param: NetID }
Andreas Hamacher's avatar
Andreas Hamacher committed
  LoginNodesU:
   type: "OS::Heat::ResourceGroup"
   properties:
    count: 1
Andreas Hamacher's avatar
Andreas Hamacher committed
    resource_def:
     type: "OS::Nova::Server"
     properties:
      #availability_zone: { get_param: avz }
Andreas Hamacher's avatar
Andreas Hamacher committed
      flavor: m3.xsmall
Andreas Hamacher's avatar
Andreas Hamacher committed
      image: { get_param: ubuntu_1804_image_id }
      key_name: { get_param: ssh_key }
      name:
       list_join: [ '-', [ { get_param: "OS::stack_name" }, 'loginU%index%' ]]
      security_groups: [ default, { get_resource: SSHMonashSecGroup }, { get_resource: SlurmSecGroup }, { get_resource: NFSSecGroup } ]
      metadata:
       ansible_host_groups: [ LoginNodes ]
       ansible_ssh_user: ubuntu
       project_name: { get_param: project_name }
      networks:
Andreas Hamacher's avatar
Andreas Hamacher committed
       - network: { get_param: NetID }

  DesktopNodes:
   type: "OS::Heat::ResourceGroup"
   properties:
    count: 0
    resource_def:
     type: "OS::Nova::Server"
     properties:
      #availability_zone: { get_param: avz }
      flavor: m3.xsmall
      image: { get_param: centos_7_image_id }
      key_name: { get_param: ssh_key }
      name:
       list_join: [ '-', [ { get_param: "OS::stack_name" }, 'desktopc%index%' ]]
      security_groups: [ default, { get_resource: SSHMonashSecGroup }, { get_resource: SlurmSecGroup }, { get_resource: NFSSecGroup } ]
      metadata:
       ansible_host_groups: [ DesktopNodes, VisNodes, ComputeNodes ]
       ansible_ssh_user: ec2-user
       project_name: { get_param: project_name }
      networks:
       - network: { get_param: NetID }

  ComputeNodesU:
   type: "OS::Heat::ResourceGroup"
   properties:
    count: 1
    resource_def:
     type: "OS::Nova::Server"
     properties:
      #availability_zone: { get_param: avz }
      flavor: m3.xsmall
      image: { get_param: ubuntu_1804_image_id }
      key_name: { get_param: ssh_key }
      name:
       list_join: [ '-', [ { get_param: "OS::stack_name" }, 'computec%index%' ]]
      security_groups: [ default, { get_resource: SSHMonashSecGroup }, { get_resource: SlurmSecGroup }, { get_resource: NFSSecGroup } ]
      metadata:
       ansible_host_groups: [ ComputeNodes ]
       ansible_ssh_user: ubuntu
       project_name: { get_param: project_name }
      networks:
       - network: { get_param: NetID }

Andreas Hamacher's avatar
Andreas Hamacher committed
  ComputeNodesC:
   type: "OS::Heat::ResourceGroup"
   properties:
    count: 1
    resource_def:
     type: "OS::Nova::Server"
     properties:
      #availability_zone: { get_param: avz }
Andreas Hamacher's avatar
Andreas Hamacher committed
      flavor: m3.xsmall
Andreas Hamacher's avatar
Andreas Hamacher committed
      image: { get_param: centos_7_image_id }
      key_name: { get_param: ssh_key }
      name:
       list_join: [ '-', [ { get_param: "OS::stack_name" }, 'computec7%index%' ]]
      security_groups: [ default, { get_resource: SSHMonashSecGroup }, { get_resource: SlurmSecGroup }, { get_resource: NFSSecGroup } ]
      metadata:
       ansible_host_groups: [ ComputeNodes ]
       ansible_ssh_user: ec2-user
       project_name: { get_param: project_name }
      networks:
       - network: { get_param: NetID }

  UbuntuDesktopNodes:
   type: "OS::Heat::ResourceGroup"
   properties:
Jafar Lie's avatar
Jafar Lie committed
    count: 1
    resource_def:
     type: "OS::Nova::Server"
     properties:
      #availability_zone: { get_param: avz }
Jafar Lie's avatar
Jafar Lie committed
      flavor: mon.c10r35.gpu-k2
      image: { get_param: ubuntu_1804_image_id }
      key_name: { get_param: ssh_key }
      name:
Jafar Lie's avatar
Jafar Lie committed
       list_join: [ '-', [ { get_param: "OS::stack_name" }, 'gpudesktopu%index%' ]]
      security_groups: [ default, { get_resource: SSHMonashSecGroup }, { get_resource: SlurmSecGroup }, { get_resource: NFSSecGroup } ]
      metadata:
Jafar Lie's avatar
Jafar Lie committed
       ansible_host_groups: [ DesktopNodes, GPU, ComputeNodes, K1, VisNodes ]
       ansible_ssh_user: ubuntu
       project_name: { get_param: project_name }
      networks:
       - network: { get_param: NetID }

#  PySSHauthz:
#   type: "OS::Nova::Server"
#   properties:
#    name:
#     list_join: [ '-', [ { get_param: "OS::stack_name" }, 'pysshautz' ]]
#    availability_zone: { get_param: avz }
Andreas Hamacher's avatar
Andreas Hamacher committed
#    flavor: m3.xsmall
#    image: { get_param: ubuntu_1804_image_id }
#    key_name: { get_param: ssh_key }
#    security_groups: [ { get_resource: SSHMonashSecGroup }, { get_resource: webaccess } ]
#    metadata:
#     ansible_host_groups: [ PySSHauthz ]
#     ansible_ssh_user: ubuntu
#     project_name: { get_param: project_name }
#    networks:
#      - network: { get_param: NetID }