Skip to content
Snippets Groups Projects
pv176-init.json 2.29 KiB
Newer Older
Martin Cuchran's avatar
Martin Cuchran committed
{
    "heat_template_version": "2016-04-08",
Martin Cuchran's avatar
Martin Cuchran committed
    "parameters":{
        "lab_size":{
            "type": "number",
            "label": "Cluster size",
            "description": "Number of server instances.",
            "default": "2"
        }
    },
Martin Cuchran's avatar
Martin Cuchran committed
    "resources":{
Martin Cuchran's avatar
Martin Cuchran committed
        "pv176-net":{
            "type": "Lib::private_network",
Martin Cuchran's avatar
Martin Cuchran committed
            "description": "Private network,subnet and router"
Martin Cuchran's avatar
Martin Cuchran committed
        },
Martin Cuchran's avatar
Martin Cuchran committed


        "instance_ports": {
            "type": "OS::Heat::ResourceGroup",
            "properties":{
                "count": { "get_param": "lab_size" },
                "resource_def":{
Martin Cuchran's avatar
Martin Cuchran committed
                    "type": "Lib::server_port",
Martin Cuchran's avatar
Martin Cuchran committed
                    "properties": { 
Martin Cuchran's avatar
Martin Cuchran committed
                        "name": "PV176-port-%index%",
                        "network":{
Martin Cuchran's avatar
Martin Cuchran committed
                            "get_attr": ["pv176-net","network_subnet"]
Martin Cuchran's avatar
Martin Cuchran committed
                            }
Martin Cuchran's avatar
Martin Cuchran committed
                    }
                }
            }
        },
Martin Cuchran's avatar
Martin Cuchran committed
        "vms":{
Martin Cuchran's avatar
Martin Cuchran committed
            "type": "OS::Heat::ResourceGroup",
Martin Cuchran's avatar
Martin Cuchran committed
            "depends_on": "instance_ports",
Martin Cuchran's avatar
Martin Cuchran committed
            "properties":{
                "count": { "get_param": "lab_size" },
                "resource_def":{
Martin Cuchran's avatar
Martin Cuchran committed
                    "type": "Lib::server_vm",
Martin Cuchran's avatar
Martin Cuchran committed
                    "properties":{
                        "name": "PV176-server-%index%",
Martin Cuchran's avatar
Martin Cuchran committed
                        "network": "PV176-port-%index%",
                        "data": {"get_file": "https://gitlab.ics.muni.cz/396462/PV176/raw/master/Openstack/server-init.ps1"}
Martin Cuchran's avatar
Martin Cuchran committed
                    }
Martin Cuchran's avatar
Martin Cuchran committed
                }
            }
        },
        "floating_ips":{
            "type": "OS::Heat::ResourceGroup",
Martin Cuchran's avatar
Martin Cuchran committed
            "depends_on": "vms",
            "properties":{
                "count": { "get_param": "lab_size" },
                "resource_def":{
                    "type": "Lib::server_floating_ip",
                    "properties":{
                        "server_name":"PV176-server-%index%"
                    }
                } 
            }
Martin Cuchran's avatar
Martin Cuchran committed
        }
Martin Cuchran's avatar
Martin Cuchran committed
    },
    "outputs":{
Martin Cuchran's avatar
Martin Cuchran committed
        "network":{
Martin Cuchran's avatar
Martin Cuchran committed
            "value":{ "get_attr": ["pv176-net"] }
Martin Cuchran's avatar
Martin Cuchran committed
        },
        "port_ids":{
Martin Cuchran's avatar
Martin Cuchran committed
            "value": {"get_attr": ["instance_ports","port"]}
Martin Cuchran's avatar
Martin Cuchran committed
        },
Martin Cuchran's avatar
Martin Cuchran committed
        "pv176-vms":{
            "value": {"get_attr": ["vms","vm"]}
Martin Cuchran's avatar
Martin Cuchran committed
        },
        "ips":{
            "value": {"get_attr": ["floating_ips"]}
Martin Cuchran's avatar
Martin Cuchran committed
        }
Martin Cuchran's avatar
Martin Cuchran committed
    }
}