Hi all,

I used a heat template to launch a server and attach cinder volume to it.
I found that if I use the block_device_mapping parameter in my server properties, then it will took a very long time to detach the volume when I delete the stack; without block_device_mapping, the volume will be immediately detached.

And I don't see any difference from the VM's perspective, whether I use block_device_mapping or not, the volume will be attached the my VM as 'vdb'.

I am curious about what does this block_device_mapping mean and what difference does nova behave under the hood.

Here's my heat template:

heat_template_version: 2013-05-23

description: |
  jfdkfjdk System
outputs:
  instance_ip:
    description: the ip address
    value: {get_attr: [Myserver, networks, OAM120, 0]}
parameters:
  image_name:
    label: Image
    type: string
    default: MCcloudinit

  flavor_name:
    label: fff
    type: string
    default: 4x8x160
  prinet1:
    label: Netffd
    type: string
    default: OAM120
resources:
  Myserver:
    metadata:
      mytest_id: tzhou002isgreat
    type: OS::Nova::Server
    properties:
      availability_zone: nova
      block_device_mapping: [
        {volume_id: {get_resource: disk1},
        delete_on_termination: 'true',
        device_name: vdb}]
      flavor: { get_param: flavor_name }
      image: { get_param: image_name }
      config_drive: 'True'
      name:
        str_replace:
          params:
            $system_name: {get_param: "OS::stack_name"}
          template: $system_name-0-0-1
      networks:
      - network: {get_param: prinet1}
      security_groups: [default]
  disk1:
    type: OS::Cinder::Volume
    properties:
      availability_zone: nova
      name: server1_disk1
      size: '1'
  disk_attach:
    type: OS::Cinder::VolumeAttachment
    properties:
      instance_uuid: {get_resource: Myserver}
      volume_id: {get_resource: disk1}

  mymultipartmime:
    properties:
      parts:
      - config: {get_resource: 'Myserver'}
      - config: {get_resource: 'disk1'}
    type: OS::Heat::MultipartMime






_______________________________________________
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to     : [email protected]
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

Reply via email to