@@ -595,10 +595,9 @@ def create_nics(self, radl, credentials, subscription_id, group_name, subnets, n
595595
596596 return res
597597
598- def get_azure_vm_create_json (self , group_name , vm_name , nics , radl ,
598+ def get_azure_vm_create_json (self , group_name , vm_name , nics , system ,
599599 instance_type , custom_data , compute_client , tags ):
600600 """ Create the VM parameters structure. """
601- system = radl .systems [0 ]
602601 url = urlparse (system .getValue ("disk.0.image.url" ))
603602 # the url has to have the format: azr://publisher/offer/sku/version
604603 # azr://Canonical/UbuntuServer/16.04.0-LTS/latest
@@ -733,6 +732,8 @@ def get_azure_vm_create_json(self, group_name, vm_name, nics, radl,
733732 })
734733 else :
735734 disk_size = system .getFeature ("disk." + str (cont ) + ".size" ).getValue ('G' )
735+ device_letter = chr (ord ('c' ) + cont - 1 )
736+ system .setValue (f"disk.{ cont } .device" , f"/dev/sd{ device_letter } " )
736737 self .log_info ("Adding a %s GB disk." % disk_size )
737738 data_disks .append ({
738739 'name' : '%s_disk_%d' % (vm_name , cont ),
@@ -857,7 +858,7 @@ def create_vms(self, rg_name, inf, radl, requested_radl, num_vm, location,
857858 custom_data = self .get_cloud_init_data (radl , vm )
858859 instance_type = self .get_instance_type (radl .systems [0 ], credentials , subscription_id )
859860 vm_parameters = self .get_azure_vm_create_json (rg_name , vm_name ,
860- nics , radl , instance_type , custom_data ,
861+ nics , vm . info . systems [ 0 ] , instance_type , custom_data ,
861862 compute_client , tags )
862863
863864 async_vm_creation = compute_client .virtual_machines .begin_create_or_update (rg_name ,
0 commit comments