1

i need to deploy multiple server using Heat template in openstack mitaka, and also this server should have newly created cinder volumes and they should get attached at server creation time, i.e one server should get one newly created volume,,

i have already noticed a problem , the below code is running but when i try to create 2 or more server instances ,, it tries to attach new volume to the stack id instead of individual vm 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] }

Error:

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)          

0

You must log in to answer this question.

Browse other questions tagged .