summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Desrochers <eric.desrochers@canonical.com>2019-03-20 14:56:02 -0400
committerEric Desrochers <eric.desrochers@canonical.com>2019-04-01 14:00:34 +0000
commit79a4c3bd1aac1473f0d524d98c4cb96475cde498 (patch)
tree817e3df4d2d9bfcde4f816abd1d7e2bb382f7a46
parentf89f7a84341a53cdc6595a994ef0c6047c4f0b86 (diff)
downloadhorizon-79a4c3bd1aac1473f0d524d98c4cb96475cde498.tar.gz
Not implicitly set vol_device_name to vda
Using a scsi decorated image with: hw_disk_bus='scsi' hw_scsi_model='virtio-scsi' This solve the case where an instance is launched with 'image' selected as boot source with a new volume. This will result in /dev/vda instead of /dev/sda as it should. Not specifying device name in setFinalSpecBootImageToVolume() leaves the decision to nova to determine it. Example: ------- VM boot volume without scsi meta data decoration: Attached To 0a0cd660-7ce3-4033-9983-2e1099edc5f0 on /dev/vda VM boot volume with scsi meta data decoration: Attached To 91f50dbc-8bdf-4293-84ea-fc5df27b5ee4 on /dev/sda -------- Note: This commit doesn't address cases for where instances are launched using existing volume and snapshot, this will involve more work to migrate the code from BDMv1 to BDMv2. Closes-Bug #1560965 Change-Id: I9d114c2c2e6736a8f1a8092afa568f930b656f09 (cherry picked from commit 4788c4d2f59b8aa08e5f599a6d2c327b6004dc0c)
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js2
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js17
2 files changed, 0 insertions, 19 deletions
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js
index d4184059a..ef016af0a 100644
--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js
+++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js
@@ -747,11 +747,9 @@
function setFinalSpecBootImageToVolume(finalSpec) {
if (finalSpec.vol_create) {
// Specify null to get Autoselection (not empty string)
- var deviceName = finalSpec.vol_device_name ? finalSpec.vol_device_name : null;
finalSpec.block_device_mapping_v2 = [];
finalSpec.block_device_mapping_v2.push(
{
- 'device_name': deviceName,
'source_type': bootSourceTypes.IMAGE,
'destination_type': bootSourceTypes.VOLUME,
'delete_on_termination': finalSpec.vol_delete_on_instance_delete,
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js
index e663b107b..cd1d0ded5 100644
--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js
+++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js
@@ -898,7 +898,6 @@
it('sets volume options appropriately', function() {
expect(model.newInstanceSpec.vol_create).toBe(false);
- expect(model.newInstanceSpec.vol_device_name).toBe('vda');
expect(model.newInstanceSpec.vol_delete_on_instance_delete).toBe(false);
expect(model.newInstanceSpec.vol_size).toBe(1);
});
@@ -921,7 +920,6 @@
model.newInstanceSpec.scheduler_hints = {};
model.newInstanceSpec.vol_create = true;
model.newInstanceSpec.vol_delete_on_instance_delete = true;
- model.newInstanceSpec.vol_device_name = "volTestName";
model.newInstanceSpec.vol_size = 10;
model.newInstanceSpec.server_groups = [];
@@ -957,7 +955,6 @@
it('should set final spec in format required for Block Device Mapping v2', function() {
var finalSpec = model.createInstance();
var expectedBlockDevice = [{
- device_name: 'volTestName',
source_type: 'image',
destination_type: 'volume',
delete_on_termination: true,
@@ -989,8 +986,6 @@
model.newInstanceSpec.vol_delete_on_instance_delete = 'yep';
var finalSpec = model.createInstance();
- expect(finalSpec.block_device_mapping.volTestName)
- .toBe('imAnID:vol::yep');
expect(finalSpec.source_id).toBe('');
});
@@ -1000,7 +995,6 @@
var finalSpec = model.createInstance();
var expectedBlockDevice = [{
- device_name: 'volTestName',
source_type: 'image',
destination_type: 'volume',
delete_on_termination: true,
@@ -1018,8 +1012,6 @@
model.newInstanceSpec.vol_delete_on_instance_delete = 'yep';
var finalSpec = model.createInstance();
- expect(finalSpec.block_device_mapping.volTestName)
- .toBe('imAnID:snap::yep');
expect(finalSpec.source_id).toBe('');
});
@@ -1076,15 +1068,6 @@
expect(finalSpec.nics).toEqual(finalNetworks);
});
- it('provides null for device_name when falsy', function() {
- model.newInstanceSpec.source_type.type = 'image';
- model.newInstanceSpec.vol_device_name = false;
- model.newInstanceSpec.vol_create = true;
-
- var finalSpec = model.createInstance();
- expect(finalSpec.block_device_mapping_v2[0].device_name).toBeNull();
- });
-
it('should not have meta property if no metadata specified', function() {
metadata = {};