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:08:36 +0000
commiteba87483eaea45905b4f260130f319404aa17fa5 (patch)
tree278a3e020cf34d64e3673c9b4fadac5b963416c4
parenta729170c9ff6c56dd2f73a3b899299bbc44ea80e (diff)
Not implicitly set vol_device_name to vdastable/pike
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 0df60f4dba64e45486d9ef4ea5a24e0ee4f05355)
Notes
Notes (review): Code-Review+2: Akihiro Motoki <amotoki@gmail.com> Code-Review+2: Ivan Kolodyazhny <e0ne@e0ne.info> Workflow+1: Ivan Kolodyazhny <e0ne@e0ne.info> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 15 Apr 2019 15:46:18 +0000 Reviewed-on: https://review.openstack.org/649029 Project: openstack/horizon Branch: refs/heads/stable/pike
-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 ed4b049..cf9cdb5 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
@@ -731,11 +731,9 @@
731 function setFinalSpecBootImageToVolume(finalSpec) { 731 function setFinalSpecBootImageToVolume(finalSpec) {
732 if (finalSpec.vol_create) { 732 if (finalSpec.vol_create) {
733 // Specify null to get Autoselection (not empty string) 733 // Specify null to get Autoselection (not empty string)
734 var deviceName = finalSpec.vol_device_name ? finalSpec.vol_device_name : null;
735 finalSpec.block_device_mapping_v2 = []; 734 finalSpec.block_device_mapping_v2 = [];
736 finalSpec.block_device_mapping_v2.push( 735 finalSpec.block_device_mapping_v2.push(
737 { 736 {
738 'device_name': deviceName,
739 'source_type': bootSourceTypes.IMAGE, 737 'source_type': bootSourceTypes.IMAGE,
740 'destination_type': bootSourceTypes.VOLUME, 738 'destination_type': bootSourceTypes.VOLUME,
741 'delete_on_termination': finalSpec.vol_delete_on_instance_delete, 739 '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 d2451e8..891d937 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
@@ -869,7 +869,6 @@
869 869
870 it('sets volume options appropriately', function() { 870 it('sets volume options appropriately', function() {
871 expect(model.newInstanceSpec.vol_create).toBe(false); 871 expect(model.newInstanceSpec.vol_create).toBe(false);
872 expect(model.newInstanceSpec.vol_device_name).toBe('vda');
873 expect(model.newInstanceSpec.vol_delete_on_instance_delete).toBe(false); 872 expect(model.newInstanceSpec.vol_delete_on_instance_delete).toBe(false);
874 expect(model.newInstanceSpec.vol_size).toBe(1); 873 expect(model.newInstanceSpec.vol_size).toBe(1);
875 }); 874 });
@@ -892,7 +891,6 @@
892 model.newInstanceSpec.scheduler_hints = {}; 891 model.newInstanceSpec.scheduler_hints = {};
893 model.newInstanceSpec.vol_create = true; 892 model.newInstanceSpec.vol_create = true;
894 model.newInstanceSpec.vol_delete_on_instance_delete = true; 893 model.newInstanceSpec.vol_delete_on_instance_delete = true;
895 model.newInstanceSpec.vol_device_name = "volTestName";
896 model.newInstanceSpec.vol_size = 10; 894 model.newInstanceSpec.vol_size = 10;
897 model.newInstanceSpec.server_groups = []; 895 model.newInstanceSpec.server_groups = [];
898 896
@@ -928,7 +926,6 @@
928 it('should set final spec in format required for Block Device Mapping v2', function() { 926 it('should set final spec in format required for Block Device Mapping v2', function() {
929 var finalSpec = model.createInstance(); 927 var finalSpec = model.createInstance();
930 var expectedBlockDevice = [{ 928 var expectedBlockDevice = [{
931 device_name: 'volTestName',
932 source_type: 'image', 929 source_type: 'image',
933 destination_type: 'volume', 930 destination_type: 'volume',
934 delete_on_termination: true, 931 delete_on_termination: true,
@@ -960,8 +957,6 @@
960 model.newInstanceSpec.vol_delete_on_instance_delete = 'yep'; 957 model.newInstanceSpec.vol_delete_on_instance_delete = 'yep';
961 958
962 var finalSpec = model.createInstance(); 959 var finalSpec = model.createInstance();
963 expect(finalSpec.block_device_mapping.volTestName)
964 .toBe('imAnID:vol::yep');
965 expect(finalSpec.source_id).toBe(''); 960 expect(finalSpec.source_id).toBe('');
966 }); 961 });
967 962
@@ -971,7 +966,6 @@
971 966
972 var finalSpec = model.createInstance(); 967 var finalSpec = model.createInstance();
973 var expectedBlockDevice = [{ 968 var expectedBlockDevice = [{
974 device_name: 'volTestName',
975 source_type: 'image', 969 source_type: 'image',
976 destination_type: 'volume', 970 destination_type: 'volume',
977 delete_on_termination: true, 971 delete_on_termination: true,
@@ -989,8 +983,6 @@
989 model.newInstanceSpec.vol_delete_on_instance_delete = 'yep'; 983 model.newInstanceSpec.vol_delete_on_instance_delete = 'yep';
990 984
991 var finalSpec = model.createInstance(); 985 var finalSpec = model.createInstance();
992 expect(finalSpec.block_device_mapping.volTestName)
993 .toBe('imAnID:snap::yep');
994 expect(finalSpec.source_id).toBe(''); 986 expect(finalSpec.source_id).toBe('');
995 }); 987 });
996 988
@@ -1047,15 +1039,6 @@
1047 expect(finalSpec.nics).toEqual(finalNetworks); 1039 expect(finalSpec.nics).toEqual(finalNetworks);
1048 }); 1040 });
1049 1041
1050 it('provides null for device_name when falsy', function() {
1051 model.newInstanceSpec.source_type.type = 'image';
1052 model.newInstanceSpec.vol_device_name = false;
1053 model.newInstanceSpec.vol_create = true;
1054
1055 var finalSpec = model.createInstance();
1056 expect(finalSpec.block_device_mapping_v2[0].device_name).toBeNull();
1057 });
1058
1059 it('should not have meta property if no metadata specified', function() { 1042 it('should not have meta property if no metadata specified', function() {
1060 metadata = {}; 1043 metadata = {};
1061 1044