openstack编排heat(云主机类型,云主机,网络)

  1. 在自行搭建的OpenStack平台上,编写heat模板createnet.yml,模板作用为创建网络。

    排错中,希望大佬可以指正以下错误

ERROR: Property error: : resources.subnet.properties: : Value must be a string; got [{u'get_resources': u'network'}]

下面是配置 vim server.yml

heat_template_version: 2013-05-23
description: Test Template
resources:
  network:
    type: OS::Neutron::Net
    properties:
      admin_state_up: true
      name: "Heat-Network"
      shared: false
  subnet:
    type: OS::Neutron::Subnet
    properties:
      cidr: 2.2.2.0/24
      gateway_ip: 2.2.2.1
      allocation_pools:
        - start: 2.2.2.2
          end: 2.2.2.10
      enable_dhcp: true
      host_routes: []
      ip_version: 4
      name: "Heat-Subnet"
      network_id:
        - get_resources: network
outputs:
  network_id:
    description: IP address of the server in the private network
    value: { get_attr: [ network,subnet,show ] }
 

  1. 在自行搭建的OpenStack平台上,编写heat模板createvm.yml文件,模板作用为按照要求创建一个云主机。

heat_template_version: 2013-05-23

description: Test Template

resources:

  server:

    type: OS::Nova::Server

    properties:

      name: "Test server"

      image: xy

      flavor: xy

      networks:

      - network: extnet

outputs:

  server_private_ip:

    description: IP address of the server in the private network

    value: { get_attr: [ server,first_address ] }      

    heat stack-create mystack -f server.yml
  1. 在自行搭建的OpenStack平台上,编写heat模板server.yml,模板作用为创建名为“m1.flavor”、ID为1234、内存为1024MB、硬盘为10GB、vcpu数量为2的云主机类型。

heat_template_version: 2013-05-23

description: Test Template

resources:

  flavor1:

    type: OS::Nova::Flavor

    properties:

      name: "Test Heat server"

      flavorid: "1111"

      disk: 10

      ram: 1024

      vcpus: 2

outputs:

  flavor_id:

    description: IP address of the server in the private network

          value: { get_attr: [ flavor1, show ] }  

heat stack-create xystack -f server.yml

  • 9
    点赞
  • 37
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Akers119

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值