There is no bootable disk when create vm from image with bdm args.

Bug #1441990 reported by wanghao on 2015-04-09
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)

Bug Description

Version of Nova in my Devstack :
commit c1e383ca55bee667ff6cfdaa35a213a61ea7ab3a
Merge: 581ca4f e0a3d60
Author: Jenkins <email address hidden>
Date: Wed Mar 18 01:06:50 2015 +0000

When I create a vm from image and take the bdm args like this :

nova boot --image 0c466b13-163c-4f2f-adfd-cde58d79b33c --flavor wanghaotype --nic net-id=b8708653-66e4-4f33-91a7-97eb0c65b54e --block-device source=blank,dest=volume,device=vdb,bootindex=0,size=1 wanghao

It worke but the vm don't have bootable disk because the vm's xml only have this :

    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source dev='/dev/disk/by-path/'/>
      <target dev='vdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>

I think we should forbid this kind of parameter combination.

wanghao (wanghao749) on 2015-04-09
Changed in nova:
assignee: nobody → wanghao (wanghao749)

Fix proposed to branch: master

Changed in nova:
status: New → In Progress
Feodor Tersin (ftersin) wrote :

Looks like
Could you reproduce your case with both nova and novaclient from master branch?
(Set LIBS_FROM_GIT=python-novaclient in Devstack's local.conf to use the latest novaclient)

wanghao (wanghao749) wrote :

Yes, In master branch, novaclient has supported to boot vm with bdm args that boot_index=1. But in nova side , this issue still exist if not using novaclient to boot vm. Now it need user to add duplicate bdm args like 'source=image, dest=local, boot_index=0', although user has specified 'image_ref' arg to boot vm. So this patch want to make it easy when boot vm from image and with bdm args.

Feodor Tersin (ftersin) wrote :

The example of nova command in the description contains bootindex=0 for a blank volume, but later you mention bootindex=1. Which case is right?

Change abandoned by wanghao (<email address hidden>) on branch: master
Reason: Abandon this patch since we have frozen V2 api and fixed this issue in other way.

melanie witt (melwitt) wrote :

Proposed patch is currently abandoned so setting back to New.

Changed in nova:
assignee: wanghao (wanghao749) → nobody
status: In Progress → New
tags: added: compute
wangxiyuan (wangxiyuan) on 2015-06-19
Changed in nova:
assignee: nobody → wangxiyuan (wangxiyuan)

@wangxiyuan (wangxiyuan):

Since you are set as assignee, I switch the status to "In Progress".

Changed in nova:
status: New → In Progress
wanghao (wanghao749) on 2015-06-30
Changed in nova:
assignee: wangxiyuan (wangxiyuan) → wanghao (wanghao749)
wangxiyuan (wangxiyuan) on 2015-06-30
Changed in nova:
assignee: wanghao (wanghao749) → nobody
wanghao (wanghao749) on 2015-06-30
Changed in nova:
assignee: nobody → wanghao (wanghao749)
wanghao (wanghao749) wrote :

@Feodor Tersin : Sorry for the confusion description, I have updated this, that is clear enough.

description: updated
Feodor Tersin (ftersin) wrote :

I've checked your case against recent

commit e36585bc6a8d3b9bff72e967a098391c3364e2e4
Merge: 39c4cc5 0e367d2
Author: Jenkins <email address hidden>
Date: Wed Jul 8 22:38:35 2015 +0000

Nova fails to boot the instance with the same

ERROR (BadRequest): Block Device Mapping is Invalid: Boot sequence for the instance and image/block device mapping combination is not valid.

message for both simple image and volume-backed image cases.

wanghao (wanghao749) wrote :

@Feodor, If you used novaclient command to create VM, it will raise exception like this. Because the client will add a block_device_mapping like this:

"block_device_mapping_v2": [{"source_type": "image", "delete_on_termination": true, "boot_index": 0, "uuid": "f69790be-ed6f-4806-b270-f85365a2e31b", "destination_type": "local"}, {"source_type": "blank", "device_name": "vdb", "volume_size": "1", "boot_index": "0", "destination_type": "volume"}]

So, the nova will check this dulicate boot_index=0 and raise this error.

But if using REST client tool instead of novaclient to send the creation request, it will be reproduced.

There is my request body by using Postman Tool to send REST request:

  "server": {
    "name": "wanghao",
    "imageRef": "XXXXXX",
    "block_device_mapping_v2": [{"source_type": "blank",
                                 "device_name": "vdb",
                                 "volume_size": "1",
                                 "boot_index": "0",
  "flavorRef": 1,
  "max_count": 1,
  "min_count": 1,
  "networks": [{"uuid": "XXXXXX"}]

You can have a try. :)

@wanghao, are you still working on this ?

Change abandoned by Michael Still (<email address hidden>) on branch: master
Reason: This patch has been sitting unchanged for more than 12 weeks. I am therefore going to abandon it to keep the nova review queue sane. Please feel free to restore the change if you're still working on it.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers