Openstack热环境参数文件默认值无效错误

Openstack热环境参数文件默认值无效错误,openstack,openstack-heat,Openstack,Openstack Heat,我正在尝试创建一个包含模板文件和环境参数文件的堆栈。以下是我的详细情况 在模板文件中: v6_ip: type: string description: ipv6 address constraints: - length: { min: 1, max: 46 } default: 0 v6_prefix_len: type: number description: ipv6 prefix length constraints: - range: {

我正在尝试创建一个包含模板文件和环境参数文件的堆栈。以下是我的详细情况

在模板文件中:

v6_ip:
  type: string
  description: ipv6 address
  constraints:
    - length: { min: 1, max: 46 }
  default: 0

v6_prefix_len:
  type: number
  description: ipv6 prefix length
  constraints:
    - range: { min: 0, max: 128 }
  default: 0

v6_gateway:
  type: string
  description: ipv6 default gateway
  constraints:
    - length: { min: 1, max: 46 }
  default: 0

server:
    type: OS::Nova::Server
    properties:
      name: { get_param : my_name }
      metadata:
      config_drive: True
      user_data:
        params:      
          $IPV4: { get_param: v4_ip }
          $V4_NETMASK: { get_param: v4_netmask }
          $V4_GW: { get_param: v4_gateway }
          $IPV6: { get_param: v6_ip }
          $V6_PREFIX: { get_param: v6_prefix_len }
          $V6_GW: { get_param: v6_gateway }
v4_ip: 192.168.11.179
v4_netmask: 255.255.240.0
v4_gateway: 192.168.0.254
v6_ip: fd5d:d50a:8c17:2110::2019
v6_prefix_len: 64
v6_gateway: fd5d:d50a:8c17:2110::ff
环境文件:

v6_ip:
  type: string
  description: ipv6 address
  constraints:
    - length: { min: 1, max: 46 }
  default: 0

v6_prefix_len:
  type: number
  description: ipv6 prefix length
  constraints:
    - range: { min: 0, max: 128 }
  default: 0

v6_gateway:
  type: string
  description: ipv6 default gateway
  constraints:
    - length: { min: 1, max: 46 }
  default: 0

server:
    type: OS::Nova::Server
    properties:
      name: { get_param : my_name }
      metadata:
      config_drive: True
      user_data:
        params:      
          $IPV4: { get_param: v4_ip }
          $V4_NETMASK: { get_param: v4_netmask }
          $V4_GW: { get_param: v4_gateway }
          $IPV6: { get_param: v6_ip }
          $V6_PREFIX: { get_param: v6_prefix_len }
          $V6_GW: { get_param: v6_gateway }
v4_ip: 192.168.11.179
v4_netmask: 255.255.240.0
v4_gateway: 192.168.0.254
v6_ip: fd5d:d50a:8c17:2110::2019
v6_prefix_len: 64
v6_gateway: fd5d:d50a:8c17:2110::ff
当我尝试创建堆栈时,出现以下错误:

错误:参数“v6_网关”无效:无效的默认值0(的对象) 类型“int”没有len()

我已经将
v6\u网关
定义为字符串,默认值为0。对于
v4\u网关
它也接受同样的情况。为什么它会为
v6\u网关抛出错误?又如何解决呢


PS:我使用的是openstack newton版本。

问题是默认网关是一个数字,而不是字符串。如果您确实需要默认的
0
保持原样有效,可以使用撇号将其括起来

v6_gateway:
  type: string
  description: ipv6 default gateway
  constraints:
    - length: { min: 1, max: 46 }
  default: '0'

说实话,我也想尝试一下。但是,对于IPv4和IPv6的所有其他细节,我使用的都是相同的。它只是在这里抛出了错误。可以让我试着回美国。