dnska

heat-json-example.jso

Mar 15th, 2022
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.63 KB | None | 0 0
  1. This OpenStack Heat template creates two instances on a logical network with a logical router attached.
  2.  
  3. ===
  4. https://gist.github.com/scottslowe/485fa69644d646052149
  5. ===
  6.  
  7. heat-json-example.json
  8. {
  9.   "AWSTemplateFormatVersion" : "2010-09-09",
  10.   "Description" : "Sample Heat template that spins up multiple instances and a private network (JSON)",
  11.   "Resources" : {
  12.     "heat_network_01" : {
  13.       "Type" : "OS::Neutron::Net",
  14.       "Properties" : {
  15.         "name" : "heat-network-01"
  16.       }
  17.     },
  18.  
  19.     "heat_subnet_01" : {
  20.       "Type" : "OS::Neutron::Subnet",
  21.       "Properties" : {
  22.         "name" : "heat-subnet-01",
  23.         "cidr" : "10.10.10.0/24",
  24.         "dns_nameservers" : ["172.16.1.11", "172.16.1.6"],
  25.         "enable_dhcp" : "True",
  26.         "gateway_ip" : "10.10.10.254",
  27.         "network_id" : { "Ref" : "heat_network_01" }
  28.       }
  29.     },
  30.  
  31.     "heat_router_01" : {
  32.       "Type" : "OS::Neutron::Router",
  33.       "Properties" : {
  34.         "admin_state_up" : "True",
  35.         "name" : "heat-router-01"
  36.       }
  37.     },
  38.  
  39.     "heat_router_01_gw" : {
  40.       "Type" : "OS::Neutron::RouterGateway",
  41.       "Properties" : {
  42.         "network_id" : "604146b3-2e0c-4399-826e-a18cbc18362b",
  43.         "router_id" : { "Ref" : "heat_router_01" }
  44.       }
  45.     },
  46.  
  47.     "heat_router_int0" : {
  48.       "Type" : "OS::Neutron::RouterInterface",
  49.       "Properties" : {
  50.         "router_id" : { "Ref" : "heat_router_01" },
  51.         "subnet_id" : { "Ref" : "heat_subnet_01" }
  52.       }
  53.     },
  54.  
  55.     "instance0_port0" : {
  56.       "Type" : "OS::Neutron::Port",
  57.       "Properties" : {
  58.         "admin_state_up" : "True",
  59.         "network_id" : { "Ref" : "heat_network_01" },
  60.         "security_groups" : ["b0ab35c3-63f0-48d2-8a6b-08364a026b9c"]
  61.       }
  62.     },
  63.  
  64.     "instance1_port0" : {
  65.       "Type" : "OS::Neutron::Port",
  66.       "Properties" : {
  67.         "admin_state_up" : "True",
  68.         "network_id" : { "Ref" : "heat_network_01" },
  69.         "security_groups" : ["b0ab35c3-63f0-48d2-8a6b-08364a026b9c"]
  70.       }
  71.     },
  72.  
  73.     "instance0" : {
  74.       "Type" : "OS::Nova::Server",
  75.       "Properties" : {
  76.         "name" : "heat-instance-01",
  77.         "image" : "73669ac0-8677-498d-9d97-76af287bcf32",
  78.         "flavor": "m1.xsmall",
  79.         "networks" : [{
  80.           "port" : { "Ref" : "instance0_port0" }
  81.         }]
  82.       }
  83.     },
  84.  
  85.     "instance1" : {
  86.       "Type" : "OS::Nova::Server",
  87.       "Properties" : {
  88.         "name" : "heat-instance-02",
  89.         "image" : "73669ac0-8677-498d-9d97-76af287bcf32",
  90.         "flavor": "m1.xsmall",
  91.         "networks" : [{
  92.           "port" : { "Ref" : "instance1_port0" }
  93.         }]
  94.       }
  95.     }
  96.   }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment