OpenStackへの複数のサーバーの作成とボリュームの接続

OpenStackへの複数のサーバーの作成とボリュームの接続

openstack mitakaでHeatテンプレートを使用して複数のサーバーを展開する必要があり、サーバーには新しく作成されたシンダーボリュームがあり、サーバーの作成時に接続する必要があります。つまり、あるサーバーは新しく作成されたボリュームを受け取る必要があります。

問題を発見しました。以下のコードは機能しますが、2つ以上のサーバーインスタンスを作成しようとすると、単一のVM IDの代わりにスタックIDに新しいボリュームを関連付けようとします。

heat_template_version: 2015-10-15

resources:
  nalla:
    type: OS::Heat::ResourceGroup
    properties:
      count: 2
      resource_def:
        type: OS::Nova::Server
        properties:
          name: nalla_%index%
          image: cirros
          flavor: m1.extra_tiny
          networks:
          - network: self_service

  vm_volume:
    type: OS::Cinder::Volume
    properties:
      size: 1

  volume_attachment:
    type: OS::Cinder::VolumeAttachment
    properties:
      volume_id: { get_resource: vm_volume }
      instance_uuid: { get_resource: nalla }


outputs:
  instance_ip:
    description: IP address of the instance
    value: { get_attr: [nalla, first_address] }

間違い:

stack_status          | CREATE_FAILED                                                                                      |
| stack_status_reason   | Resource CREATE failed: Error: resources.volume_attachment: Failed to attach volume a9753ffb-f02e- |
|                       | 4ebd-9630-b498bb8171c8 to server 800a2b01-021d-413d-9657-10b6cc711a91 - Instance 800a2b01-021d-    |
|                       | 413d-9657-10b6cc711a91 could not be found. (HTTP 404) (Request-ID: req-c63ad056-75ae-47fe-         |
|                       | 95b3-c7118c82e2b3)          

ベストアンサー1

おすすめ記事