I boot an instance with ephemeral disk in kilo, but return http request error:
eg:
nova boot --flavor 2 --image 5905bd7e-a87f-4856-8401-b8eb7211c84d --nic net-id=12ace164-d996-4261-9228-23ca0680f7a8 --ephemeral size=5,format=ext3 test_vm1
ERROR (BadRequest): Block Device Mapping is Invalid: Boot sequence for the instance and image/block device mapping combination is not valid. (HTTP 400) (Request-ID: req-b571662f-e554-49a7-979f-763f34b4b162)
The error occurs in nova-api.log, not nova-compute. Here is the log:
[root@5-3-13 ~(keystone_admin)]# nova image-list
+--------------------------------------+--------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+--------+--------+--------+
| 7f050e44-a58a-4640-b7ec-50829e73de28 | cirros | ACTIVE | |
+--------------------------------------+--------+--------+--------+
[root@5-3-13 ~(keystone_admin)]# nova flavor-list
+----------+----------------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----------+----------------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
+----------+----------------+-----------+------+-----------+------+-------+-------------+-----------+
[root@5-3-13 ~(keystone_admin)]# nova flavor-show 2
+----------------------------+----------+
| Property | Value |
+----------------------------+----------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 20 |
| extra_specs | {} |
| id | 2 |
| name | m1.small |
| os-flavor-access:is_public | True |
| ram | 2048 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+----------------------------+----------+
[root@5-3-13 ~(keystone_admin)]# nova net-list
+--------------------------------------+-------+------+
| ID | Label | CIDR |
+--------------------------------------+-------+------+
| fbeb89f8-7023-4fc3-b259-ac3b399ae214 | net1 | None |
+--------------------------------------+-------+------+
[root@5-3-13 ~(keystone_admin)]# nova boot --flavor 2 --image 7f050e44-a58a-4640-b7ec-50829e73de28 --nic net-id=fbeb89f8-7023-4fc3-b259-ac3b399ae214 --ephemeral size=5,format=ext3 test
ERROR (BadRequest): Block Device Mapping is Invalid: Boot sequence for the instance and image/block device mapping combination is not valid. (HTTP 400) (Request-ID: req-4fff7690-ce9b-4866-9f74-da851149ced5)
[root@-5-3-13 ~(keystone_admin)]# tail -f /var/log/nova/nova-api.log
2015-12-01 10:30:32.263 17226 INFO nova.osapi_compute.wsgi.server [req-0d695b05-ca10-4e7e-ac33-c6c3ea5a1e0a 1687d2a547d448d6b9ba8b9d04c97571 563d53e7eda74e20ae375ebc754742f9 - - -] 10.43.211.168 "GET /v2/563d53e7eda74e20ae375ebc754742f9/images/7f050e44-a58a-4640-b7ec-50829e73de28 HTTP/1.1" status: 200 len: 883 time: 0.6789351
2015-12-01 10:30:32.302 17226 INFO nova.osapi_compute.wsgi.server [req-b331c7df-a0ab-4b05-892d-7465e79d5692 1687d2a547d448d6b9ba8b9d04c97571 563d53e7eda74e20ae375ebc754742f9 - - -] 10.43.211.168 "GET /v2/563d53e7eda74e20ae375ebc754742f9/flavors/2 HTTP/1.1" status: 200 len: 624 time: 0.0244460
2015-12-01 10:30:33.189 17226 INFO nova.api.openstack.wsgi [req-43938f64-7d06-4bec-9f45-076d2eec6e47 1687d2a547d448d6b9ba8b9d04c97571 563d53e7eda74e20ae375ebc754742f9 - - -] HTTP exception thrown: Block Device Mapping is Invalid: Boot sequence for the instance and image/block device mapping combination is not valid.
2015-12-01 10:30:33.191 17226 INFO nova.osapi_compute.wsgi.server [req-43938f64-7d06-4bec-9f45-076d2eec6e47 1687d2a547d448d6b9ba8b9d04c97571 563d53e7eda74e20ae375ebc754742f9 - - -] 10.43.211.168 "POST /v2/563d53e7eda74e20ae375ebc754742f9/os-volumes_boot HTTP/1.1" status: 400 len: 385 time: 0.8854868
add log to /nova/compute/api.py, _validate_bdm return boot_index is [],
2015-11-18 10:48:53.816 15403 INFO nova.compute.api [req-042cb90f-040f-4e2f-80b4-30b024a0e35c c769c5799c3440ab837bc2157b931679 d7eec1198eb4415bad7d7d306afe212e - - -] 33 block_device_mapping is:[{'guest_format': u'ext3', 'boot_index': -1, 'no_device': None, 'connection_info': None, 'snapshot_id': None, 'volume_size': 5, 'device_name': None, 'disk_bus': None, 'image_id': None, 'source_type': u'blank', 'device_type': None, 'volume_id': None, 'destination_type': u'local', 'delete_on_termination': True}]
2015-11-18 10:48:53.817 15403 INFO nova.compute.api [req-042cb90f-040f-4e2f-80b4-30b024a0e35c c769c5799c3440ab837bc2157b931679 d7eec1198eb4415bad7d7d306afe212e - - -] _check_and_transform_bdm base_options is :{'vm_state': 'building', 'pci_requests': InstancePCIRequests(instance_uuid=<?>,requests=[InstancePCIRequest,InstancePCIRequest,InstancePCIRequest,InstancePCIRequest]), 'availability_zone': u'8350-VdcCompA155M1L5', 'ramdisk_id': '', 'instance_type_id': 5, 'user_data': None, 'numa_topology': None, 'vm_mode': None, 'reservation_id': 'r-vfnvgc63', 'user_id': u'c769c5799c3440ab837bc2157b931679', 'display_description': u'v005', 'key_data': None, 'power_state': 0, 'progress': 0, 'project_id': u'd7eec1198eb4415bad7d7d306afe212e', 'metadata': {}, 'ephemeral_gb': 0, 'access_ip_v6': None, 'access_ip_v4': None, 'kernel_id': '', 'key_name': None, 'display_name': u'v005', 'system_metadata': {}, 'architecture': None, 'root_gb': 20, 'locked': False, 'memory_mb': 2048, 'vcpus': 1, 'image_ref': u'9afc715f-f625-4d26-83e9-5dce3b9ac309', 'root_device_name': None, 'auto_disk_config': False, 'os_type': None, 'config_drive': ''},image_meta is {'status': u'active', 'name': u'v05', 'deleted': False, 'container_format': u'bare', 'created_at': datetime.datetime(2015, 11, 17, 8, 36, 50, tzinfo=<iso8601.iso8601.Utc object at 0x5d5c3d0>), 'disk_format': u'raw', 'updated_at': datetime.datetime(2015, 11, 17, 8, 36, 51, tzinfo=<iso8601.iso8601.Utc object at 0x5d5c3d0>), 'id': u'9afc715f-f625-4d26-83e9-5dce3b9ac309', 'owner': u'd7eec1198eb4415bad7d7d306afe212e', 'min_ram': 0, 'checksum': u'f78c0bd8506d54bf7ddf6631337c90a7', 'min_disk': 0, 'is_public': False, 'deleted_at': None, 'properties': {}, 'size': 108986368}, legacy_bdm is:False, block_device_mapping is [{'guest_format': u'ext3', 'boot_index': -1, 'no_device': None, 'connection_info': None, 'snapshot_id': None, 'volume_size': 5, 'device_name': None, 'disk_bus': None, 'image_id': None, 'source_type': u'blank', 'device_type': None, 'volume_id': None, 'destination_type': u'local', 'delete_on_termination': True}],root_device_name is vda, image_ref is: 9afc715f-f625-4d26-83e9-5dce3b9ac309
2015-11-18 10:48:53.817 15403 INFO nova.compute.api [req-042cb90f-040f-4e2f-80b4-30b024a0e35c c769c5799c3440ab837bc2157b931679 d7eec1198eb4415bad7d7d306afe212e - - -] image_defined_bdms is:[]
2015-11-18 10:48:53.818 15403 INFO nova.compute.api [req-042cb90f-040f-4e2f-80b4-30b024a0e35c c769c5799c3440ab837bc2157b931679 d7eec1198eb4415bad7d7d306afe212e - - -] root_in_image_bdms is:False
2015-11-18 10:48:53.818 15403 INFO nova.compute.api [req-042cb90f-040f-4e2f-80b4-30b024a0e35c c769c5799c3440ab837bc2157b931679 d7eec1198eb4415bad7d7d306afe212e - - -] block_device_mapping is:[{'guest_format': u'ext3', 'boot_index': -1, 'no_device': None, 'connection_info': None, 'snapshot_id': None, 'volume_size': 5, 'device_name': None, 'disk_bus': None, 'image_id': None, 'source_type': u'blank', 'device_type': None, 'volume_id': None, 'destination_type': u'local', 'delete_on_termination': True}]
2015-11-18 10:48:53.818 15403 INFO nova.compute.api [req-042cb90f-040f-4e2f-80b4-30b024a0e35c c769c5799c3440ab837bc2157b931679 d7eec1198eb4415bad7d7d306afe212e - - -] image_defined_bdms is:[]
2015-11-18 10:48:53.819 15403 INFO nova.compute.api [req-042cb90f-040f-4e2f-80b4-30b024a0e35c c769c5799c3440ab837bc2157b931679 d7eec1198eb4415bad7d7d306afe212e - - -] 44 block_device_mapping is:BlockDeviceMappingList(objects=[BlockDeviceMapping(UNKNOWN)])
2015-11-18 10:48:53.897 15403 INFO nova.compute.api [req-042cb90f-040f-4e2f-80b4-30b024a0e35c c769c5799c3440ab837bc2157b931679 d7eec1198eb4415bad7d7d306afe212e - - -] create_db_entry block_device_mapping is :BlockDeviceMappingList(objects=[BlockDeviceMapping(UNKNOWN)])
2015-11-18 10:48:53.900 15403 INFO nova.compute.api [req-042cb90f-040f-4e2f-80b4-30b024a0e35c c769c5799c3440ab837bc2157b931679 d7eec1198eb4415bad7d7d306afe212e - - -] _validate_bdm instance_type is:Flavor(created_at=None,deleted=False,deleted_at=None,disabled=False,ephemeral_gb=0,extra_specs={},flavorid='2',id=5,is_public=True,memory_mb=2048,name='m1.small',projects=<?>,root_gb=20,rxtx_factor=1.0,swap=0,updated_at=None,vcpu_weight=0,vcpus=1)
2015-11-18 10:48:53.900 15403 INFO nova.compute.api [req-042cb90f-040f-4e2f-80b4-30b024a0e35c c769c5799c3440ab837bc2157b931679 d7eec1198eb4415bad7d7d306afe212e - - -] _validate_bdm all_mappings is:BlockDeviceMappingList(objects=[BlockDeviceMapping(UNKNOWN)])
2015-11-18 10:48:53.901 15403 INFO nova.compute.api [req-042cb90f-040f-4e2f-80b4-30b024a0e35c c769c5799c3440ab837bc2157b931679 d7eec1198eb4415bad7d7d306afe212e - - -] 555 boot_indexes is:[]
I think the instance with ephemeral disk should be able to boot from the image, instead of invalid boot sequence.
need help, thanks.