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

Bug #1441990 reported by wanghao
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

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/ip-192.168.86.76:3260-iscsi-iqn.2010-10.org.openstack:volume-e264ca3b-a23a-4d51-9f27-0561c9fca75c-lun-1'/>
      <target dev='vdb' bus='virtio'/>
      <serial>e264ca3b-a23a-4d51-9f27-0561c9fca75c</serial>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>

I think we should forbid this kind of parameter combination.

Tags: compute
wanghao (wanghao749)
Changed in nova:
assignee: nobody → wanghao (wanghao749)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/171984

Changed in nova:
status: New → In Progress
Revision history for this message
Feodor Tersin (ftersin) wrote :

Looks like https://bugs.launchpad.net/nova/+bug/1433609
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)

Revision history for this message
wanghao (wanghao749) wrote :

@ftersin:
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.

Revision history for this message
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?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

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

Revision history for this message
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)
Changed in nova:
assignee: nobody → wangxiyuan (wangxiyuan)
Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

@wangxiyuan (wangxiyuan):

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

Changed in nova:
status: New → In Progress
wanghao (wanghao749)
Changed in nova:
assignee: wangxiyuan (wangxiyuan) → wanghao (wanghao749)
wangxiyuan (wangxiyuan)
Changed in nova:
assignee: wanghao (wanghao749) → nobody
wanghao (wanghao749)
Changed in nova:
assignee: nobody → wanghao (wanghao749)
Revision history for this message
wanghao (wanghao749) wrote :

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

description: updated
Revision history for this message
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.

Revision history for this message
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",
                                 "destination_type":
                                 "volume"}],
  "flavorRef": 1,
  "max_count": 1,
  "min_count": 1,
  "networks": [{"uuid": "XXXXXX"}]
 }

You can have a try. :)

Revision history for this message
Pushkar Umaranikar (pushkar-umaranikar) wrote :

@wanghao, are you still working on this ?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/171984
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.

Changed in nova:
assignee: wanghao (wanghao749) → Stephen Finucane (stephenfinucane)
Matt Riedemann (mriedem)
Changed in nova:
assignee: Stephen Finucane (stephenfinucane) → wanghao (wanghao749)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.opendev.org/171984

Changed in nova:
status: In Progress → New
assignee: wanghao (wanghao749) → nobody
Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :

As per Dan comments from the https://review.opendev.org/171984 this is not a bug as the behavior could be useful in some cases.

Changed in nova:
status: New → 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.