Heat fails to create volume if no availability zone provided

Bug #1580582 reported by Marcin Zbik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Invalid
Medium
Unassigned

Bug Description

All nova/cinder hosts are in non "nova" availability zone, I mean they are in, for example "my_az" availability zone. In such case Heat will fail to deploy nova server with block_device_mapping_v2 until on explicitly set availability_zone property for OS::Nova::Server

Part of template:

resources:
  server:
    type: OS::Nova::Server
    properties:
      user_data_format: SOFTWARE_CONFIG
      key_name: { get_param: key_name }
      block_device_mapping_v2:
        -
          boot_index: 0
          delete_on_termination: True
          device_name: vda
          volume_size: 80
          device_type: disk
          image_id: { get_param: image }
      flavor: { get_param: flavor }
      networks:
        - port: { get_resource: server_port }
      user_data:
        get_resource: server_init

Exact same behavior when booting with block_device_mapping (*NOT* v2) and when not specifying availability_zone in OS::Cinder::Volume

Request snippet from cinder-scheduler.log in DEBUG mode:

{
 'request_spec': {
  u 'source_replicaid': None,
  u 'volume_properties': {
   u 'volume_metadata': [],
   u 'availability_zone': u 'nova',
   u 'reservations': [u '0382a27d-ab15-442a-be63-63ec23cc3632', u '111c639b-0948-4c9e-8ef5-c02ba6d540b8'],
   u 'replication_status': u 'disabled',
   u 'snapshot_id': None,
   u 'id': u 'e3019d25-6275-42f8-9dcb-2f73d37e3837',
   u 'size': 80,
   u 'display_name': u '',
   u 'source_replicaid': None,
   u 'display_description': u '',
   u 'project_id': u 'd877486d3dd24be995b07e12285cc089',
   u 'metadata': {},
   u 'status': u 'creating',
   u 'volume_type_id': None,
   u 'multiattach': False,
   u 'source_volid': None,
   u 'qos_specs': None,
   u 'consistencygroup_id': None,
   u 'user_id': u '11a682025d5dceb1a431c02008a0369430f1b32365006691fc526b13da62abe8',
   u 'attach_status': u 'detached',
   u 'cgsnapshot_id': None,
   u 'encryption_key_id': None
  },
  u 'source_volid': None,
  u 'cgsnapshot_id': None,
  u 'image_id': u 'ce17b5db-5d4d-45a9-ad02-ad8e01d5302a',
  u 'snapshot_id': None,
  u 'consistencygroup_id': None,
  u 'volume_type': {},
  u 'volume_id': u 'e3019d25-6275-42f8-9dcb-2f73d37e3837'
 }
}

As one can see there is u 'availability_zone': u 'nova', which will obviously fail with NoValidHost. Workaround for this is to add availability_zone property to OS::Nova::Server (in case of block_device_mapping_v2) or to OS::Cinder::Volume (in case of block_device_mapping).

Heat from OpenStack Liberty (Version: 1:5.0.1-0ubuntu1~cloud0)

# heat-manage db_version
65

Revision history for this message
Thomas Herve (therve) wrote :

It looks like a Nova issue? Can you make it work with the equivalent nova boot command line call?

Changed in heat:
status: New → Incomplete
importance: Undecided → Medium
milestone: none → newton-1
Revision history for this message
Marcin Zbik (zbikmarc+launchpad) wrote :
Download full text (3.2 KiB)

It looks you are right:

Nova boot command:
nova boot --flavor m1.large --block-device source=image,id=ce17b5db-5d4d-45a9-ad02-ad8e01d5302a,dest=volume,size=60,shutdown=remove,bootindex=0 --nic net-id=36674c7e-8bd8-46cf-b3df-2926ed1ef373 instanceFromVolume

cinder-scheduler.log
Task 'cinder.scheduler.flows.create_volume.ExtractSchedulerSpecTask;volume:create' (7a3adbd4-6257-4714-8985-174a666e1eb9) transitioned into state 'SUCCESS' from state 'RUNNING' with result '{'request_spec': {u'source_replicaid': None, u'volume_properties': {u'volume_metadata': [], u'availability_zone': u'nova', u'reservations': [u'e5a1089b-28b7-47f0-a45c-f386925804f2', u'ae4428c6-554a-42cb-b7b9-9e84546c9946'], u'replication_status': u'disabled', u'snapshot_id': None, u'id': u'b80f8c57-7806-4f87-9663-ebcab3052e87', u'size': 60, u'display_name': u'', u'source_replicaid': None, u'display_description': u'', u'volume_admin_metadata': [], u'project_id': u'd877486d3dd24be995b07e12285cc089', u'metadata': {}, u'status': u'creating', u'volume_type_id': None, u'multiattach': False, u'source_volid': None, u'qos_specs': None, u'consistencygroup_id': None, u'user_id': u'1e54cb2fc8734e47984f9d7d3be93d97', u'attach_status': u'detached', u'cgsnapshot_id': None, u'encryption_key_id': None}, u'source_volid': None, u'cgsnapshot_id': None, u'image_id': u'ce17b5db-5d4d-45a9-ad02-ad8e01d5302a', u'snapshot_id': None, u'consistencygroup_id': None, u'volume_type': {}, u'volume_id': u'b80f8c57-7806-4f87-9663-ebcab3052e87'}}' _task_receiver /usr/lib/python2.7/dist-packages/taskflow/listeners/logging.py:178
2016-05-11 16:09:19.254 17300 DEBUG cinder.scheduler.manager [req-3316c438-0f41-469b-ad45-724b3afcd55c 1e54cb2fc8734e47984f9d7d3be93d97 d877486d3dd24be995b07e12285cc089 - - -] Task 'cinder.scheduler.flows.create_volume.ScheduleCreateVolumeTask;volume:create' (4b400d37-400d-48d5-b0d6-0c236cd4f7e4) transitioned into state 'RUNNING' from state 'PENDING' _task_receiver /usr/lib/python2.7/dist-packages/taskflow/listeners/logging.py:190
2016-05-11 16:09:19.271 17300 DEBUG cinder.openstack.common.scheduler.base_filter [req-3316c438-0f41-469b-ad45-724b3afcd55c 1e54cb2fc8734e47984f9d7d3be93d97 d877486d3dd24be995b07e12285cc089 - - -] Starting with 8 host(s) get_filtered_objects /usr/lib/python2.7/dist-packages/cinder/openstack/common/scheduler/base_filter.py:77
2016-05-11 16:09:19.271 17300 INFO cinder.openstack.common.scheduler.base_filter [req-3316c438-0f41-469b-ad45-724b3afcd55c 1e54cb2fc8734e47984f9d7d3be93d97 d877486d3dd24be995b07e12285cc089 - - -] Filter AvailabilityZoneFilter returned 0 host(s)
2016-05-11 16:09:19.272 17300 WARNING cinder.scheduler.filter_scheduler [req-3316c438-0f41-469b-ad45-724b3afcd55c 1e54cb2fc8734e47984f9d7d3be93d97 d877486d3dd24be995b07e12285cc089 - - -] No weighed hosts found for volume with properties: {}
2016-05-11 16:09:19.275 17300 ERROR cinder.scheduler.flows.create_volume [req-3316c438-0f41-469b-ad45-724b3afcd55c 1e54cb2fc8734e47984f9d7d3be93d97 d877486d3dd24be995b07e12285cc089 - - -] Failed to run task cinder.scheduler.flows.create_volume.ScheduleCreateVolumeTask;volume:create: No valid host was found. No weighed hosts available

Should I recreate this bug on Nova ...

Read more...

Revision history for this message
Thomas Herve (therve) wrote :

yes please!

Changed in heat:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.