在 openstack 上使用加热模板部署多个虚拟机



如何使用热量模板部署多个虚拟机。

heat_template_version: 2016-10-14
description: Sample template to deploy Multiple VM's...
parameters:
image_name_1:
type: string
label: mmee_fsb2
description: instance1
default: mmee_fsb2
image_name_2:
type: string
label: mmee_pxeboot
description: MMEE-PXE-instance2
default: mmee_pxeboot
network_id_E1:
type: string
label: d1a517ed-ba3f-45ba-8fc7-afa06c1d742f
description: Admin External Network
default: Admin
network_id_I1:
type: string
label: eb683be0-0722-4e51-95de-a33fb7402cc1
description: Internal-1 Network
default: Internal-1
network_id_I2:
type: string
label: 5a33a7be-eee1-4c32-9e1b-fb227e377309
description: Internal-2 Network
default: Internal-2
resources:
FSBB_VM:
type: OS::Nova::Server
properties:
availability_zone: haz81
image: { get_param: image_name_1 }
flavor: 4vcpu_10240MBmem_160GBdisk_1hg
key_name:
networks:
- network: { get_param : network_id_E1 }
- network: { get_param : network_id_I1 }
- network: { get_param : network_id_I2 }
resources:
FSBB_VM:
type: OS::Nova::Server
properties:
availability_zone: haz51
image:  { get_param: image_name_1 }
flavor: 4vcpu_10240MBmem_160GBdisk_1hg
key_name:
networks:
- network: { get_param : network_id_E1 }
- network: { get_param : network_id_I1 }
- network: { get_param : network_id_I2 }

在热模板中有parametersresourcesoutputsversion部分。这些部分只能定义一次。在您的热模板中resources您定义了两次部分名称,这将引发错误。

尝试像这样更改:

heat_template_version: 2016-10-14
description: Sample template to deploy Multiple VM's...
parameters:
image_name_1:
type: string
label: mmee_fsb2
description: instance1
default: mmee_fsb2
image_name_2:
type: string
label: mmee_pxeboot
description: MMEE-PXE-instance2
default: mmee_pxeboot
network_id_E1:
type: string
label: d1a517ed-ba3f-45ba-8fc7-afa06c1d742f
description: Admin External Network
default: Admin
network_id_I1:
type: string
label: eb683be0-0722-4e51-95de-a33fb7402cc1
description: Internal-1 Network
default: Internal-1
network_id_I2:
type: string
label: 5a33a7be-eee1-4c32-9e1b-fb227e377309
description: Internal-2 Network
default: Internal-2
resources:
FSBB_VM1:
type: OS::Nova::Server
properties:
availability_zone: haz81
image: { get_param: image_name_1 }
flavor: 4vcpu_10240MBmem_160GBdisk_1hg
key_name:
networks:
- network: { get_param : network_id_E1 }
- network: { get_param : network_id_I1 }
- network: { get_param : network_id_I2 }
FSBB_VM2:
type: OS::Nova::Server
properties:
availability_zone: haz51
image:  { get_param: image_name_1 }
flavor: 4vcpu_10240MBmem_160GBdisk_1hg
key_name:
networks:
- network: { get_param : network_id_E1 }
- network: { get_param : network_id_I1 }
- network: { get_param : network_id_I2 }

相关内容

  • 没有找到相关文章

最新更新