block device mapping : booting up attached volumes with no boot index when multiple bootable volumes are used
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Description
===========
provide 2 block device mappings, both bootable volumes with only 1 of them having a boot_index (i.e. only 1 specified as boot device) and both have different bus types. Observe booted instance is actually an instance of the image with no boot_index!
Steps to reproduce
==================
Created volume from cirros image
Created volume from ubuntu image
Attempted to create instance sourced from ubuntu volume and also have the cirros volume attached
- set boot index to 0 for ubuntu volume
- set no boot index for cirros (in trial 2, i set it to -1 explicitly so it would only be an attached volume)
- bus type provided for ubuntu volume was 'ide'
- bus type provided for cirros volume was 'virtio'
- send server payload
- observed the instance is booted from the cirros volume despite having no boot index!
sample payload :
{"server"
NOTE : when the ubuntu volume is the only volume and the bus type is IDE, the created instance is an ubuntu instance
Also, if both volumes have the bus types set to virtio, the ubuntu instance is correctly booted.
Appears to be some bus type related issue, but it wasn't documented anywhere and there's no error.
Expected result
===============
Boot from the volume with boot index provided or fail with error
Actual result
=============
Boots from the other volume, even though it has no boot index.
Environment
===========
Openstack Kilo
hypervisor : libvirt + KVM
storage : LVM
networking : neutron with openvswitch
tags: | added: volumes |
Changed in nova: | |
status: | New → Confirmed |
assignee: | nobody → Lee Yarwood (lyarwood) |
Changed in nova: | |
assignee: | Lee Yarwood (lyarwood) → nobody |
I think this because the boot sequence in libvirt: http:// libvirt. org/formatdomai n.html# elementsOSBIOS.
In the section boot:
"Thus, e.g., a domain configured to boot from "hd" with vdb, hda, vda, and hdc disks assigned to it will boot from vda (the sorted list is vda, vdb, hda, hdc). Similar domain with hdc, vda, vdb, and hda disks will boot from hda (sorted disks are: hda, hdc, vda, vdb)."
The block_device_ mapping_ v2 in your sample: :"03b3c938- ed05-41a3- af92-5344431892 ae","source_ type":" volume" ,"destination_ type":" volume" ,"delete_ on_termination" :"false" ,"disk_ bus": "virtio" },{"uuid" :"7cebbbc0- 113e-452b- b577-9043140656 bf","boot_ index": "0","source_ type":" volume" ,"destination_ type":" volume" ,"delete_ on_termination" :"false" ,"disk_ bus": "ide" },{"uuid" :"5870a3d6- f475-4312- b26f-5162d76b90 74","source_ type":" volume" ,"destination_ type":" volume" ,"delete_ on_termination" :"false" ,"disk_ bus": "virtio" }]
[{"uuid"
Before instance create the device_name will set for each device: :"03b3c938- ed05-41a3- af92-5344431892 ae", type":" volume" , name":" /dev/vda" , # Add device_name by disk_bus, the virtio mapping to "vd*" n_type" :"volume" , on_termination" :"false" , :"7cebbbc0- 113e-452b- b577-9043140656 bf", index": "0", type":" volume" , n_type" :"volume" , on_termination" :"false" , :"5870a3d6- f475-4312- b26f-5162d76b90 74", type":" volume" , name":" /dev/vdb" , n_type" :"volume" , on_termination" :"false" ,
[{
"uuid"
"source_
"device_
"destinatio
"delete_
"disk_bus": "virtio" },
{
"uuid"
"boot_
"source_
"device_name": "/dev/hda", # ide mapping to "hd*"
"destinatio
"delete_
"disk_bus": "ide" },
{
"uuid"
"source_
"device_
"destinatio
"delete_
"disk_bus": "virtio" }]
I think the disk sequence after sorted by libvirt is:
1. /dev/vda
2. /dev/vdb
3. /dev/hda